aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/movenc.c
Commit message (Collapse)AuthorAgeFilesLines
...
* | avformat/movenc: Avoid integer overflowMichael Niedermayer2016-05-291-1/+5
| | | | | | | | | | | | Fixes: CID1361947 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/movenc: Fix memleak of reshuffled packetMichael Niedermayer2016-05-281-2/+4
| | | | | | | | | | | | Fixes CID1361952 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/movenc: Rename reshuffles return variable to ensure it is not mixed upMichael Niedermayer2016-05-281-10/+10
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '74383def8f46805faf3391c98516b248108a9a6b'Derek Buitenhuis2016-05-121-1/+4
|\| | | | | | | | | | | | | * commit '74383def8f46805faf3391c98516b248108a9a6b': movenc: Handle pts == NOPTS when autoflushing Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * movenc: Handle pts == NOPTS when autoflushingMartin Storsjö2016-04-211-1/+4
| | | | | | | | | | | | | | This muxer generally handles pts == NOPTS by using dts instead; do this for consistency here as well. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '0abb07bad7026a945a31ba4047e6583c8b3fa3da'Derek Buitenhuis2016-05-121-1/+2
|\| | | | | | | | | | | | | * commit '0abb07bad7026a945a31ba4047e6583c8b3fa3da': movenc: Update a comment to reflect how the code actually behaves Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * movenc: Update a comment to reflect how the code actually behavesMartin Storsjö2016-04-191-1/+2
| | | | | | | | | | | | | | This codepath isn't quite as bad as it used to sound, if fragments are cut automatically at video packets. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '9200514ad8717c63f82101dc394f4378854325bf'Derek Buitenhuis2016-04-101-418/+448
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-231-261/+258
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | fix some a/an typosLou Logan2016-03-281-1/+1
| | | | | | | | Signed-off-by: Lou Logan <lou@lrcd.com>
* | lavf/movenc: Fix help output.Carl Eugen Hoyos2016-03-101-3/+3
| | | | | | | | Fixes ticket #5323.
* | lavf/movenc: Add support for palette side dataMats Peterson2016-03-041-19/+25
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | movenc: Timecode in MP4 Although MP4 does not have a concrete specification ↵Syed Andaleeb Roomy2016-02-281-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to store timecode information, the following technical note from Apple describes a way to achieve this via timecode track, similar to how it is done for MOV files. https://developer.apple.com/library/mac/technotes/tn2174/_index.html - Enabled creation of timecode tracks for MP4 in the same way as MOV. - Used nmhd as media information header of timecode track of MP4 instead of gmhd used in MOV, thus avoiding tcmi also, as recommended above. - Bypassed adding source reference field for MP4, as suggested above. Issue: https://trac.ffmpeg.org/ticket/4704 Signed-off-by: Syed Andaleeb Roomy <andaleebcse@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf/movenc: Add palette to video sample descriptionMats Peterson2016-02-271-2/+62
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/movenc: use ff_parse_creation_time_metadataMarton Balint2016-02-141-7/+1
| | | | | | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* | Merge commit '9f61abc8111c7c43f49ca012e957a108b9cc7610'Derek Buitenhuis2016-02-101-2/+2
|\| | | | | | | | | | | | | | | | | This also deprecates our old duplicated callbacks. * commit '9f61abc8111c7c43f49ca012e957a108b9cc7610': lavf: allow custom IO for all files Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * lavf: allow custom IO for all filesAnton Khirnov2016-01-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Some (de)muxers open additional files beyond the main IO context. Currently, they call avio_open() directly, which prevents the caller from using custom IO for such streams. This commit adds callbacks to AVFormatContext that default to avio_open2()/avio_close(), but can be overridden by the caller. All muxers and demuxers using AVIO are switched to using those callbacks instead of calling avio_open()/avio_close() directly. (de)muxers that use the URLProtocol layer directly instead of AVIO remain unconverted for now. This should be fixed in later commits.
* | Update demuxers and protocols for protocol whitelist supportMichael Niedermayer2016-02-021-1/+1
| | | | | | | | | | Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/movenc: Check that pkt duration is within 32bit rangeMichael Niedermayer2016-01-091-4/+4
| | | | | | | | | | | | | | Durations outside are not supported Fixes Ticket5114 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/movenc: Use strict_std_compliance from the muxer layer instead of ↵Michael Niedermayer2015-12-301-1/+1
| | | | | | | | | | | | the encoder layer Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '5845a8273e4694e0254ad728970b82bb64fd8bc0'Hendrik Leppkes2015-12-171-3/+6
|\| | | | | | | | | | | | | * commit '5845a8273e4694e0254ad728970b82bb64fd8bc0': movenc: use the CPB props side data Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * movenc: use the CPB props side dataAnton Khirnov2015-12-061-5/+8
| | | | | | | | | | Do not access the encoder options, since it makes no sense when the AVStream codec context is not the encoding context.
* | movenc: support cenc (common encryption)erankor2015-12-151-7/+85
| | | | | | | | | | | | | | | | | | | | | | | | support writing encrypted mp4 using aes-ctr, conforming to ISO/IEC 23001-7. 3 new parameters were added: - encryption_scheme - allowed values are none (default) and cenc-aes-ctr - encryption_key - 128 bit encryption key (hex) - encryption_kid - 128 bit encryption key identifier (hex) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat: use AV_OPT_TYPE_BOOL in a bunch of placesClément Bœsch2015-12-041-2/+2
| |
* | avformat/movenc: HE-AAC correct FourCC in ISMLYann Coupin2015-12-041-1/+11
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit 'ca489564ae150bc41764f175b88151d883e69ae0'Derek Buitenhuis2015-11-221-4/+15
|\| | | | | | | | | | | | | * commit 'ca489564ae150bc41764f175b88151d883e69ae0': movenc: add fallback audio track tref support Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * movenc: add fallback audio track tref supportJohn Stebbins2015-11-181-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | This feature allows making associations between audio tracks that apple players recognize. E.g. when an ac3 track has a tref that points to an aac track, devices that don't support ac3 will automatically fall back to the aac track. Apple used to *guess* these associations, but new products (AppleTV 4) no longer guess and this association can only be made explicitly now using the "fall" tref. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | Merge commit 'bef3b1f59f036aba4a5fe599b2480f6bd9e6b280'Derek Buitenhuis2015-11-181-4/+14
|\| | | | | | | | | | | | | * commit 'bef3b1f59f036aba4a5fe599b2480f6bd9e6b280': movenc: Allow setting start_dts/start_cts before writing actual packets Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * movenc: Allow setting start_dts/start_cts before writing actual packetsMartin Storsjö2015-11-111-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By writing a zero-sized packet, the caller can communicate the start_dts/start_cts for the stream without actually writing the first packet. This allows doing random-access writing of fragments when the start dts of the stream isn't zero, so that the edit list in the moov is written based on timestamps from the nominal start time signaled via the zero-sized packet, while the first proper packet written corresponds to a later fragment. To avoid potential unexpected behaviour, empty packets only set start_dts if the frag_discont flag is set. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '09e431b9e3674804172e7b0a0f865b65ec09739a'Derek Buitenhuis2015-11-171-4/+12
|\| | | | | | | | | | | | | * commit '09e431b9e3674804172e7b0a0f865b65ec09739a': movenc: Assume streams starting at pts=0 for discontinuous fragments with editlists Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * movenc: Assume streams starting at pts=0 for discontinuous fragments with ↵Martin Storsjö2015-11-111-4/+12
| | | | | | | | | | | | | | | | | | | | editlists This allows producing fragments discontinously where the video stream has b-frames (but starts at pts=0), but doesn't work for the cases with audio with preroll. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '8ad5124b7ecf7f727724e270a7b4bb8c7bcbf6a4'Hendrik Leppkes2015-11-111-0/+1
|\| | | | | | | | | | | | | * commit '8ad5124b7ecf7f727724e270a7b4bb8c7bcbf6a4': movenc: Automatically flush after writing the initial moov Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * movenc: Automatically flush after writing the initial moovMartin Storsjö2015-11-101-0/+1
| | | | | | | | | | | | | | | | In most other cases when writing fragmented mp4 files, the output IO context is flushed after each fragment. Also flush it after writing the initial moov, to have it behave in the same way. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Replace remaining occurances of av_free_packet with av_packet_unrefHendrik Leppkes2015-10-271-4/+4
| |
* | Merge commit '5ea5a24eb70646a9061b85af407fcbb5dd4f89fd'Hendrik Leppkes2015-10-271-8/+8
|\| | | | | | | | | | | | | * commit '5ea5a24eb70646a9061b85af407fcbb5dd4f89fd': movenc: Honor flush requests with delay_moov, when some tracks lack samples Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * movenc: Honor flush requests with delay_moov, when some tracks lack samplesMartin Storsjö2015-10-231-8/+8
| | | | | | | | | | | | | | | | This also makes sure that a fragmented file without the empty_moov flag (i.e. with a non-empty initial moov fragment) actually gets written, if some of the tracks turn out to not have any samples. Signed-off-by: Martin Storsjö <martin@martin.st>
* | avcodec: drop 2 suffix from avpriv_ac3_parse_header2Andreas Cadhalpun2015-10-221-2/+2
| | | | | | | | | | | | | | avpriv_ac3_parse_header was removed in commit 3dfb643. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | Merge commit '948f3c19a8bd069768ca411212aaf8c1ed96b10d'Hendrik Leppkes2015-09-291-1/+1
|\| | | | | | | | | | | | | * commit '948f3c19a8bd069768ca411212aaf8c1ed96b10d': lavc: Make AVPacket.duration int64, and deprecate convergence_duration Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
* | lavc: Switch bitrate to 64bit unless compatibility with avconv was requested.Michael Niedermayer2015-09-151-2/+2
| |
* | Merge commit '26ac22e5e7394346e9d59f800e7d4e91f4518d33'Hendrik Leppkes2015-08-181-7/+8
|\| | | | | | | | | | | | | | | | | | | | | * commit '26ac22e5e7394346e9d59f800e7d4e91f4518d33': movenc: Add a new flag for writing global sidx indexes for dash Conflicts: libavformat/movenc.c libavformat/movenc.h Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * movenc: Add a new flag for writing global sidx indexes for dashMartin Storsjö2015-08-121-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The double meaning of the faststart flag (moving a moov atom to the start of files, making them streamable, for non-fragmented files, vs inserting a global sidx index at the start of files for fragmented files) is confusing - see 40ed1cbf1 for explanation of its origins. Since the second meaning of the flag hasn't been part of any libav release yet, just rename it to get rid of the confusion without any extra deprecation (which wouldn't get rid of the potential confusion, of users adding -movflags faststart even for fragmented files, where it isn't needed for making them "streamable"). This gets back the old behaviour, where -movflags faststart doesn't have any effect for fragmented files. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '5f200bbf98efe50f63d0515b115d2ba8dae297bc'Hendrik Leppkes2015-08-101-0/+3
|\| | | | | | | | | | | | | * commit '5f200bbf98efe50f63d0515b115d2ba8dae297bc': movenc: Place the sidx index after the initial moov/mdat pair Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * movenc: Place the sidx index after the initial moov/mdat pairMartin Storsjö2015-08-101-0/+3
| | | | | | | | | | | | | | | | | | | | For fragmented files with non-empty moov, with a fragment index (sidx), place the index after the initial moov/mdat pair. Previously, for this pathological case, the index was written at the start of the file. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '83f254e65f938657a4dbec711e4c94252a72daf9'Hendrik Leppkes2015-08-101-10/+10
|\| | | | | | | | | | | | | | | | | | | | | * commit '83f254e65f938657a4dbec711e4c94252a72daf9': movenc: Rename reserved_moov_pos to reserved_header_pos Conflicts: libavformat/movenc.c libavformat/movenc.h Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * movenc: Rename reserved_moov_pos to reserved_header_posMartin Storsjö2015-08-101-7/+7
| | | | | | | | | | | | | | The same field is also used for writing the sidx index header, for fragmented files, when the faststart flag is used. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '8e34089e265a6b01e1e3301e8864439d26793753'Hendrik Leppkes2015-08-101-0/+2
|\| | | | | | | | | | | | | * commit '8e34089e265a6b01e1e3301e8864439d26793753': movenc: Check that frag_info entries exist in mov_write_sidx_tag Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * movenc: Check that frag_info entries exist in mov_write_sidx_tagMartin Storsjö2015-08-101-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | This fixes crashes with pathological cases when trying to write a sidx index (via the -movflags faststart option, in combination with fragmenting options), when no fragments actually have been written. (This is possible if the empty_moov flag isn't used, so that all actual packet data is written in the moov/mdat pair, and no moof/mdat pairs have been written.) In these pathological cases, no sidx should be written at all. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '059a934806d61f7af9ab3fd9f74994b838ea5eba'Michael Niedermayer2015-07-271-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '059a934806d61f7af9ab3fd9f74994b838ea5eba': lavc: Consistently prefix input buffer defines Conflicts: doc/examples/decoding_encoding.c libavcodec/4xm.c libavcodec/aac_adtstoasc_bsf.c libavcodec/aacdec.c libavcodec/aacenc.c libavcodec/ac3dec.h libavcodec/asvenc.c libavcodec/avcodec.h libavcodec/avpacket.c libavcodec/dvdec.c libavcodec/ffv1enc.c libavcodec/g2meet.c libavcodec/gif.c libavcodec/h264.c libavcodec/h264_mp4toannexb_bsf.c libavcodec/huffyuvdec.c libavcodec/huffyuvenc.c libavcodec/jpeglsenc.c libavcodec/libxvid.c libavcodec/mdec.c libavcodec/motionpixels.c libavcodec/mpeg4videodec.c libavcodec/mpegvideo.c libavcodec/noise_bsf.c libavcodec/nuv.c libavcodec/nvenc.c libavcodec/options.c libavcodec/parser.c libavcodec/pngenc.c libavcodec/proresenc_kostya.c libavcodec/qsvdec.c libavcodec/svq1enc.c libavcodec/tiffenc.c libavcodec/truemotion2.c libavcodec/utils.c libavcodec/utvideoenc.c libavcodec/vc1dec.c libavcodec/wmalosslessdec.c libavformat/adxdec.c libavformat/aiffdec.c libavformat/apc.c libavformat/apetag.c libavformat/avidec.c libavformat/bink.c libavformat/cafdec.c libavformat/flvdec.c libavformat/id3v2.c libavformat/isom.c libavformat/matroskadec.c libavformat/mov.c libavformat/mpc.c libavformat/mpc8.c libavformat/mpegts.c libavformat/mvi.c libavformat/mxfdec.c libavformat/mxg.c libavformat/nutdec.c libavformat/oggdec.c libavformat/oggparsecelt.c libavformat/oggparseflac.c libavformat/oggparseopus.c libavformat/oggparsespeex.c libavformat/omadec.c libavformat/rawdec.c libavformat/riffdec.c libavformat/rl2.c libavformat/rmdec.c libavformat/rtpdec_latm.c libavformat/rtpdec_mpeg4.c libavformat/rtpdec_qdm2.c libavformat/rtpdec_svq3.c libavformat/sierravmd.c libavformat/smacker.c libavformat/smush.c libavformat/spdifenc.c libavformat/takdec.c libavformat/tta.c libavformat/utils.c libavformat/vqf.c libavformat/westwood_vqa.c libavformat/xmv.c libavformat/xwma.c libavformat/yop.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * lavc: Consistently prefix input buffer definesVittorio Giovara2015-07-271-1/+1
| | | | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | avformat/movenc: Drop redundant bit exact field from contextMichael Niedermayer2015-07-181-6/+2
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>