summaryrefslogtreecommitdiff
path: root/libavformat/movenc.c
Commit message (Collapse)AuthorAge
* avformat/movenc: Avoid allocation for small dynamic buffersAndreas Rheinhardt2019-11-28
| | | | | | | | By using avio_get_dyn_buf() + ffio_free_dyn_buf() instead of avio_close_dyn_buf() + av_free() one can avoid an allocation + copy for small dynamic buffers. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* aformat/movenc: add missing padding to output track extradataJames Almer2019-09-26
| | | | | | | Fixes ticket #8183. Tested-by: Thierry Foucu <tfoucu@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/movenc: Fix undefined shiftAndreas Rheinhardt2019-09-26
| | | | | | Fixes the movenc FATE-test. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/movenc: don't hardcode the colr box sizeJames Almer2019-09-19
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/movenc: add muxing support for Dolby TrueHD streamsJames Almer2019-08-24
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/movenc: use unspecified language by defaultMarton Balint2019-07-12
| | | | | | English was used before. Signed-off-by: Marton Balint <cus@passwd.hu>
* lavf/movenc: Pass correct pointer to av_log().Carl Eugen Hoyos2019-04-09
|
* lavf/movenc: fix tmcd writing for non-MP4/MOV modesGyan Doshi2019-04-03
| | | | | | | write_tmcd allows tmcd track to be created with any mode but in mov_write_header, index for first tmcd track is only set for modes MP4 or MOV, causing a crash if tmcd creation is attempted with other modes.
* avformat/movenc: Fix skip_trailer when global_sidx is enabledKarthick J2019-04-02
|
* avformat/movenc: free eac3 private data only when closing the streamJames Almer2019-03-31
| | | | | | | | | This makes sure the data is available when writing the moov atom during the second pass triggered by the faststart movflag. Fixes ticket #7780 Signed-off-by: James Almer <jamrial@gmail.com>
* libavformat/movenc: mov: added subtitle codec tags to codec tag listPaweł Wegner2019-03-18
| | | | | | | | This fixes avformat_query_codec incorrectly returning 0 for mov container and mov_text subtitles. Signed-off-by: Paweł Wegner <pawel.wegner95@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/movenc: Add more error checking when writing sample entries.Nikolas Bowe2019-02-07
| | | | | | | | | | Fixes a problem where a sample entry which cannot be written correctly appears to succeed, but produces an invalid file. For example, this command: ffmpeg -f lavfi -i sine=frequency=1000:duration=5 -codec:a ac3 -movflags +empty_moov -frag_duration 5000000 /tmp/foo.mp4 produced a file with the ac-3 sample entry, but no AC3SpecificBox (dac3) child, which is invalid according to ETSI TS 102 366. Reviewed-by: Baptiste Coudurier <baptiste.coudurier@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf/movenc: Mention video_track_timescale as option to fix the timescale.Carl Eugen Hoyos2019-01-24
| | | | | Smarter improvements for this error message were suggested in the past but this is certainly an improvement.
* avformat/movenc: treat ALAC same as FLAC and write correct infoPaul B Mahol2018-12-14
| | | | Fixes #7291.
* avformat/movenc: Added an option to disable SIDX atomkjeyapal@akamai.com2018-12-11
|
* avformat/movenc: get number of written bytes from bitstream writerPaul B Mahol2018-11-22
| | | | Update fate test.
* avformat/movenc: fix size calculation in mov_write_eac3_tag()Paul B Mahol2018-11-22
| | | | Otherwise it would assert when flushing bits.
* avformat/movenc: Remove unneeded variable from mov_find_codec_tag()Michael Niedermayer2018-10-07
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/movenc: remove experimental checks for AV1 streamsJames Almer2018-09-09
| | | | | | The spec has been finalized. Signed-off-by: James Almer <jamrial@gmail.com>
* lavf/movenc: Fail when codec tag is invalid for formatJohn Stebbins2018-09-08
| | | | | | Fixes ticket #6897 Signed-off-by: James Almer <jamrial@gmail.com>
* lavf/movenc: Add GoPro metadata to permitted mp4 "codecs"John Stebbins2018-09-08
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/movenc: implicitly enable negative CTS offsets for ismvJan Ekström2018-08-24
| | | | | | | | | | | ISMV lacks any sort of edit list support, as well as tfxd is effectively the PTS of the fragment for most intents and purposes. Thus, if b-frames are requested without negative CTS offsets you end up with N frames' worth of delay (tfxd PTS plus the CTS offset of the first sample). Negative CTS offsets enable the first sample to have CTS=DTS, and thus a/v desync due to b-frame reorder delay is avoided.
* avformat/movenc: support Opus packets with more than 60ms of audio when ↵James Almer2018-08-24
| | | | | | | | | | writing the Sample Group Description Since libopus 1.2, packets of sizes 80ms, 100ms and 120ms are allowed. Fixes assertion failures when trying to mux such streams. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/av1: update ff_isom_write_av1c() to the latest revision of the specJames Almer2018-08-17
| | | | | | | | | | This will get ISOBMFF and Matroska up to date with the revised AV1 Codec Configuration Box spec. For now keep propagating raw OBUs as extradata until all libavcodec modules are adapted to handle AV1CodecConfigurationRecord formatted extradata. Tested-by: Thomas Daede <bztdlinux@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/movenc: add support for AV1 streamsJames Almer2018-07-20
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/movenc: add reason for minf->hdlr in MOV onlyGyan Doshi2018-07-14
|
* avformat/movenc: Write version 2 of audio atom if channels is not knownMichael Niedermayer2018-07-09
| | | | | | | | | | | The version 1 needs the channel count and would divide by 0 Fixes: division by 0 Fixes: fpe_movenc.c_1108_1.ogg Fixes: fpe_movenc.c_1108_2.ogg Fixes: fpe_movenc.c_1108_3.wav Found-by: #CHEN HONGXU# <HCHEN017@e.ntu.edu.sg> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/movenc: Check input sample countMichael Niedermayer2018-07-08
| | | | | | | | | | | | | | Fixes: division by 0 Fixes: fpe_movenc.c_199_1.wav Fixes: fpe_movenc.c_199_2.wav Fixes: fpe_movenc.c_199_3.wav Fixes: fpe_movenc.c_199_4.wav Fixes: fpe_movenc.c_199_5.wav Fixes: fpe_movenc.c_199_6.wav Fixes: fpe_movenc.c_199_7.wav Found-by: #CHEN HONGXU# <HCHEN017@e.ntu.edu.sg> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/movenc: Use mov->fc consistently for av_log()Michael Niedermayer2018-06-28
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/movenc: Do not pass AVCodecParameters in avpriv_request_sampleMichael Niedermayer2018-06-28
| | | | | | | | Fixes: out of array read Fixes: ffmpeg_crash_8.avi Found-by: Thuan Pham, Marcel Böhme, Andrew Santosa and Alexandru Razvan Caciulescu with AFLSmart Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/movenc: Check that frame_types other than ↵Michael Niedermayer2018-06-28
| | | | | | | | | | EAC3_FRAME_TYPE_INDEPENDENT have a supported substream id Fixes: out of array access Fixes: ffmpeg_bof_1.avi Found-by: Thuan Pham, Marcel Böhme, Andrew Santosa and Alexandru Razvan Caciulescu with AFLSmart Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/movenc: allow hdlr name field to be emptyGyan Doshi2018-06-21
| | | | | | Both QTFF and the ISOBMFF standards allow it. Fixes #7262
* avformat/movenc: read track title from correct keyGyan Doshi2018-06-19
| | | | | | | | | | da9cc22d5bd allowed the MOV muxer to relay a custom stream handler name, whether populated from the input stream or user-set. However, the entry key didn't match the key set by the MOV demuxer, so it wasn't effective. Fixed. Due to the change, four FATE refs have to be updated. Verified that the target payload of the tests hasn't changed in terms of CRC.
* avformat/movenc: fix recognization of cover image streamsTimo Teräs2018-06-13
| | | | | | | | | | For chapter images, the mov demux produces streams with disposition set to attached_pic+timed_thumbnails. This patch fixes to properly recognize streams that should be encoded as cover image (ones with only and only attached_pic disposition set). Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/movenc: properly handle cover image codecsTimo Teräs2018-06-13
| | | | | | | | | | | Find codec tag for attached images using appropriate list of supported image formats. This fixes writing the cover image to m4v/m4a and other container formats that do not allow these codecs as a track. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/movenc: creating producer reference time (PRFT) boxVishwanath Dixit2018-05-29
| | | | | | | | | The producer reference time box supplies relative wall-clock times at which movie fragments, or files containing movie fragments (such as segments) were produced. The box is mainly useful in live streaming use cases. A media player can parse the box and utilize the time fields to measure and improve the latency during real time playout.
* avformat/movenc: support writing iTunes cover imageTimo Teräs2018-04-17
| | | | | | | | | | | | | | | | | | | | | | | | | | Fixes https://trac.ffmpeg.org/ticket/2798 This makes movenc handle AV_DISPOSITION_ATTACHED_PIC and write the associated pictures in iTunes cover atom. This corresponds to how 'mov' demuxer parses and exposes the cover images when reading. Most of the existing track handling loops properly ignore these 'virtual streams' as MOVTrack->entry is never incremented for them. However, additional tests are added as needed to ignore them. Tested to produce valid output with: ffmpeg -i movie.mp4 -i thumb.jpg -disposition:v:1 attached_pic \ -map 0 -map 1 -c copy movie-with-cover.mp4 The cover image is also copied correctly with: ffmpeg -i movie-with-cover.mp4 -map 0 -c copy out.mp4 AtomicParseley says that the attached_pic stream is properly not visible in the main tracks of the file. Signed-off-by: Timo Teräs <timo.teras@iki.fi>
* avformat/movenc: forbid muxing AV1 streams until the spec is finishedJames Almer2018-04-16
| | | | | | | This prevents creating potentially broken files, as both the AV1 and the AV1 in ISOMBFF specs are unfinished. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/movenc: use correct iTunes copyright atomTimo Teräs2018-04-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support for writing copyright metadata was added in commit bed4fc54c9 for 3GP, MOV and iTunes metadata. 3GP and MOV cases are formally specified. However, iTunes format does not have specification, and it seems to have been assumed that it would use the same atom as MOV (both being Apple formats). However, Apple uses 'cprt' atom for iTunes metadata (do note that the iTunes 'cprt' encoding is generic iTunes ItemList atom, not the 3GP 'cprt' encoding. These are also inside different parent atoms). Most references trying to document iTunes atoms mention only the 'cprt' tag. See: - http://atomicparsley.sourceforge.net/mpeg-4files.html - http://mutagen.readthedocs.io/en/latest/api/mp4.html Same applies to other software supporting this tag. Most of them encode and decode only the 'cprt' atom. ffmpeg mov demuxer supports both atoms in this context. There are few pieces of other software that support similarly both 'cprt' and the incorrect '\251cpy' atom in this context. I believe they do it in order to read the ffmpeg encoded incorrect copyright atom. In light of the above this changes the copyright atom to 'cprt' as it seems to be supported univerally and is the correct atom to use. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/movenc: add rtp_hinting_needed() helper functionTimo Teräs2018-04-04
| | | | | | | | This is shared test and this simplifies code a bit. Follow up commit will have additional tests for this function. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf/movenc: write track title metadata for mov filesCourtland Idstrom2018-03-22
| | | | | | | | | Track title (atom 'name') is a well defined user data atom for mov files. Existing code (for mp4) only writes title metadata if present. Relevant reference docs: https://developer.apple.com/library/content/documentation/QuickTime/Reference/QTRef_AtomsResources/Content/QTRef_AtomsResources4.html#//apple_ref/doc/uid/TP40004285-DontLinkChapterID_1--udta- https://developer.apple.com/library/content/documentation/QuickTime/QTFF/QTFFChap2/qtff2.html#//apple_ref/doc/uid/TP40000939-CH204-63839
* avformat/movenc: move the concatenated eac3 packet referenceJames Almer2018-03-15
| | | | | | | Simplifies code. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/movenc: addition of flag to fragment at every frameVishwanath Dixit2018-02-20
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mov: add VP8 codec supportJames Almer2018-02-06
| | | | | | | | | | | | | Demuxing only. Muxing is disabled as altref frame handling is not defined in the spec, and there's no way to know the presence of such frames during stream initialization. Based on a patch by Steven Liu. Fixes ticket #7000 Reviewed-by: Carl Eugen Hoyos <ceffmpeg@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: migrate to AVFormatContext->urlMarton Balint2018-01-28
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/movenc: Add support for more colorspacesSteven Robertson2017-12-15
| | | | | | | | With FCPX 10.4, Apple has expanded the set of colorspace, primaries, and trc flags officially supported in QuickTime files. The expanded set matches the codepoints used in ffmpeg and many other specs. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf/movenc: add sdtp (sample dependency) boxJohn Stebbins2017-12-02
| | | | | | The sdtp is required by the AppleTV 4K in order to play 2160p60 video. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/movenc: write clap atom for uncompressed yuv in movDave Rice2017-11-20
| | | | | | fixes 6145 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/movenc: correct ImageDescription for uncompressed ycbcrDave Rice2017-11-20
| | | | | | | Per https://developer.apple.com/library/content/technotes/tn2162/_index.html Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf/movenc: allow writing avc3 sample entry typeJohn Stebbins2017-11-16
| | | | | | | The avc3 sample entry type is useful for adaptive streaming. It permits parameter sets to be written inline in the video stream. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>