summaryrefslogtreecommitdiff
path: root/libavformat/flvenc.c
Commit message (Collapse)AuthorAge
* avformat: Constify all muxer/demuxersAndreas Rheinhardt2021-04-27
| | | | | | | This is possible now that the next-API is gone. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/buffer: Switch AVBuffer API to size_tAndreas Rheinhardt2021-04-27
| | | | | | | Announced in 14040a1d913794d9a3fd6406a6d8c2f0e37e0062. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: use the buffer_size_t typedef where requiredJames Almer2021-03-10
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec, avformat: Remove unnecessary initializations of side data sizeAndreas Rheinhardt2020-06-22
| | | | | Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/flvenc: Avoid unnecessary seekAndreas Rheinhardt2020-01-17
| | | | | | | | | | | | | | When shifting the already written data in order to write the keyframe index, the flv muxer would first store the pre-shift size, then calculate how big the index will be eventually, then perform some seeks to update some size fields, then seek back to the end of the file to get the new position, followed by a seek to the position where writing will really start. Seeking back to the (already known) end position (that is actually used to perform this seek) to get the end position is of course unnecessary. It has been removed. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/flvenc: Fix leak of oversized packetsAndreas Rheinhardt2019-12-26
| | | | | | | Might happen for annex B H.264. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/flvenc: Forward errors from allocating keyframe indexAndreas Rheinhardt2019-12-26
| | | | | | | | | | | While the function adding a new element to the keyframe index checked the allocation, the caller didn't check the return value. This has been changed. To do so, the return value has been changed to an ordinary ret instead of pb->error. This doesn't pose a problem, as write_packet() in mux.c already checks for write errors (since 9ad1e0c1). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/flvenc: Don't reimplement ff_alloc_extradataAndreas Rheinhardt2019-12-11
| | | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/flvenc: Check pts for mpeg4/h264 (which need the value)Michael Niedermayer2019-11-09
| | | | | | Fixes: Ticket8152 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf/flvenc: Cosmetics: fix indentationJun Zhao2019-11-08
| | | | | | fix indentation Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* lavf/flvenc: add automatic bitstream filteringJun Zhao2019-06-25
| | | | | | | | add automatic bitstream filtering when mux AAC Reported-by: Yabo Wei weiyabogeijing@gmail.com Reviewed-by: Steven Liu<lq@onvideo.cn> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avformat/flvenc: Check audio packet sizeMichael Niedermayer2018-08-04
| | | | | | | | Fixes: Assertion failure Fixes: assert_flvenc.c:941_1.swf Found-by: #CHEN HONGXU# <HCHEN017@e.ntu.edu.sg> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* flvenc: Fix sequence header update timestampsAlex Converse2018-05-29
|
* flvenc: Factorize timestamp writingAlex Converse2018-05-29
| | | | | The code is trivial but the semantics in the spec are ambiguous. This should help keep parts of the muxer interpreting them consistently.
* avformat: migrate to AVFormatContext->urlMarton Balint2018-01-28
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/flvenc: flx flvflags no_metadata bugSteven Liu2017-03-14
| | | | | | | When use flvflags no_metadata , the FLV header will be cover by write tailer This commit fix the bug Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/flvenc: refine the flvenc shift_data codeSteven Liu2017-01-24
| | | | | | refine the flvenc shift_data move data option Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/flvenc: Check for extradata allocation failureMichael Niedermayer2017-01-03
| | | | | | Fixes CID1396539 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/flvenc: fix ticket 5976 and use old commitSteven Liu2016-11-26
| | | | | | | | | mythtv have problem with non-seekable dont write duration and filesize and there have problem with some other server and player with 0 value duation and filesize. So add a flv flags to fix the ticket and make a choose for users. Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/flvenc: add no_metadata to flvflagsSteven Liu2016-11-22
| | | | | | | some flv have no metadata, ffmpeg will same with the source flv stream. Signed-off-by: Steven Liu <lingjiujianke@gmail.com>
* avformat/flvenc: add add_keyframe_index optionSteven Liu2016-11-10
| | | | | | | | | | | | | | | | | | | | | Add keyframe index metadata Used to facilitate seeking; particularly for HTTP pseudo streaming. 1. read live streaming or file by sequence 2. if use add_keyframe_index option, add a mark flag at the position, use to insert new context at the last step. 3. add the keyframes *offset* and *timestamp* into a list 4. if use add_keyframe_index option, shift the metadata data from mark flag offset 5. insert the keyframes *offset* and *timestamp* from the list by sequence 6. free the list 7. end. Add FATE test case; Reviewed-by: Lou Logan <lou@lrcd.com> Signed-off-by: Steven Liu <liuqi@gosun.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/flvenc: support mp3 audio with 48khzfuqiuping2016-11-06
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/flvenc: do not attempt to write duration and filesize when not seekableSteven Liu2016-10-20
| | | | | | | Its impossible to update the filesize & duration values if seekback is not possible as with live streams Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/flvenc: add no_sequence_end flags for flvflagsSteven Liu2016-09-14
| | | | | | | | | | when split flv file by flv format at first, and cat flvs file into one flv file, the flv sequence end is be used, then the whole flv have many flv sequence end TAG. this flags can give user an option to ignore write sequence end TAG Signed-off-by: Steven Liu <lingjiujianke@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/flvenc: Add () around &Michael Niedermayer2016-09-14
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/flvenc: add FLVFlags for flvflags optionsSteven Liu2016-09-14
| | | | | | | add FLVFlags type, be used to add new FLVFlags options Signed-off-by: Steven Liu <lingjiujianke@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit '371df9ba71393a1c5429d5f40c76348b30e556c7'Matthieu Bouron2016-06-23
|\ | | | | | | | | | | | | * commit '371df9ba71393a1c5429d5f40c76348b30e556c7': flvenc: Provide output bytestream markers Merged-by: Matthieu Bouron <matthieu.bouron@stupeflix.com>
| * flvenc: Provide output bytestream markersMartin Storsjö2016-05-18
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | libavformat/flvenc: support for codec configuration change mid streamIvan2016-06-11
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | libavformat/flvenc: refactoring: extracted method for writing codec headersIvan2016-06-11
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '9200514ad8717c63f82101dc394f4378854325bf'Derek Buitenhuis2016-04-10
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '9200514ad8717c63f82101dc394f4378854325bf': lavf: replace AVStream.codec with AVStream.codecpar This has been a HUGE effort from: - Derek Buitenhuis <derek.buitenhuis@gmail.com> - Hendrik Leppkes <h.leppkes@gmail.com> - wm4 <nfxjfg@googlemail.com> - Clément Bœsch <clement@stupeflix.com> - James Almer <jamrial@gmail.com> - Michael Niedermayer <michael@niedermayer.cc> - Rostislav Pehlivanov <atomnuker@gmail.com> Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * lavf: replace AVStream.codec with AVStream.codecparAnton Khirnov2016-02-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, AVStream contains an embedded AVCodecContext instance, which is used by demuxers to export stream parameters to the caller and by muxers to receive stream parameters from the caller. It is also used internally as the codec context that is passed to parsers. In addition, it is also widely used by the callers as the decoding (when demuxer) or encoding (when muxing) context, though this has been officially discouraged since Libav 11. There are multiple important problems with this approach: - the fields in AVCodecContext are in general one of * stream parameters * codec options * codec state However, it's not clear which ones are which. It is consequently unclear which fields are a demuxer allowed to set or a muxer allowed to read. This leads to erratic behaviour depending on whether decoding or encoding is being performed or not (and whether it uses the AVStream embedded codec context). - various synchronization issues arising from the fact that the same context is used by several different APIs (muxers/demuxers, parsers, bitstream filters and encoders/decoders) simultaneously, with there being no clear rules for who can modify what and the different processes being typically delayed with respect to each other. - avformat_find_stream_info() making it necessary to support opening and closing a single codec context multiple times, thus complicating the semantics of freeing various allocated objects in the codec context. Those problems are resolved by replacing the AVStream embedded codec context with a newly added AVCodecParameters instance, which stores only the stream parameters exported by the demuxers or read by the muxers.
* | avformat: use ff_standardize_creation_time for formats writing all format ↵Marton Balint2016-03-03
| | | | | | | | | | | | | | string metadata Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* | avformat/flvenc: copyts in FLV muxerIvan2016-01-26
| | | | | | | | | | | | | | | | | | The purpose of this patch is to preserve timestamps when using ffmpeg for publishing RTMP streams, e.g. ffmpeg -i rtmp://source/stream -f flv rtmp://target/stream. There is a setting "copyts" for that purpose. Unfortunately it doesn't work with FLV muxer because it has its own timestamp correction which makes global setting "copyts" ineffective. This patch removes timestamp correction in FLV muxer. This means FLV will rely on ffmpeg timestamp correction which makes it possible to use copyts. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/flvenc: Add aac_seq_header_detect and flvflagsMaksym Veremeyenko2015-11-20
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | doc: fix spelling errorsAndreas Cadhalpun2015-06-14
| | | | | | | | | | | | | | | | | | | | | | Neccessary -> Necessary formated -> formatted thee -> the eventhough -> even though seperately -> separately Reviewed-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | Revert "avformat/flvenc: Allow muxing video codecs which are not explicitly ↵Michael Niedermayer2015-03-22
| | | | | | | | | | | | | | | | | | | | supported by the muxer" This commit has no known use case ATM as there are no unsupported video codecs in flv and could theoretically be use to generate broken files allthough that would be not entirely easy as tags/codecs still get sanity checked This reverts commit 76f4b117807c30a528539fc5c7a7e35cb288cfcf.
* | avformat/flvenc: Allow muxing video codecs which are not explicitly ↵Michael Niedermayer2015-03-22
| | | | | | | | | | | | | | | | | | | | | | | | supported by the muxer This allows stream copying video codecs before they are explicitly supported. The same feature was in the past useful for audio codecs in flv This partly reverts the changes from 735ab7c5e04e2316afbd56643c13de17a7ac89cd Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'e767c9e8f2eaa116b61b8b6881b401b54bd320f5'Michael Niedermayer2015-03-04
|\| | | | | | | | | | | | | | | | | | | * commit 'e767c9e8f2eaa116b61b8b6881b401b54bd320f5': flv: Validate and reject unsupported codecs Conflicts: libavformat/flvenc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * flv: Validate and reject unsupported codecsLuca Barbato2015-03-04
| | | | | | | | | | | | And provide a more informative message in case of failure. CC: libav-stable@libav.org
| * flvenc: Remove an unused variableMichael Niedermayer2014-11-22
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | avformat/flvenc: check that the codec_tag fits in the available bitsAndreas Cadhalpun2015-02-28
| | | | | | | | | | | | | | flags is later written with avio_w8 and if it doesn't fit in one byte it triggers an av_assert2. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/flvenc: accept AVMEDIA_TYPE_SUBTITLE instead of DATA for subtitlesMichael Niedermayer2015-01-22
| | | | | | | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/flvenc: omit more metadata elements with specific meaningMichael Niedermayer2015-01-05
| | | | | | | | | | Reviewed-by: Thilo Borgmann <thilo.borgmann@mail.de> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Print a warning if vp6 is muxed into flv: The output is flipped.Carl Eugen Hoyos2014-11-23
| | | | | | | | Fixes ticket #4132.
* | avformat/flvenc: remove unused variableMichael Niedermayer2014-11-17
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'c64f3615118d757dcf76040fe5407bf2b3883206'Michael Niedermayer2014-11-17
|\| | | | | | | | | | | | | * commit 'c64f3615118d757dcf76040fe5407bf2b3883206': flvenc: Send new metadata when FLAG_METADATA_UPDATED is set. Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * flvenc: Send new metadata when FLAG_METADATA_UPDATED is set.Andrew Stone2014-11-17
| | | | | | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | Merge commit '4d0cd5f58c892276716f46f4b2702915e5018215'Michael Niedermayer2014-11-17
|\| | | | | | | | | | | | | | | | | | | * commit '4d0cd5f58c892276716f46f4b2702915e5018215': flvenc: move metadata updates into a single function Conflicts: libavformat/flvenc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * flvenc: move metadata updates into a single functionAndrew Stone2014-11-17
| | | | | | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>