aboutsummaryrefslogtreecommitdiff
path: root/libavformat/isom.h
AgeCommit message (Collapse)Author
2019-02-08avformat/mov.c: require tfhd to begin parsing trunchcunningham
Detecting missing tfhd avoids re-using tfhd track info from the previous moof. For files with multiple tracks, this may make a mess of the avindex and fragindex, which can later trigger av_assert0 in mov_read_trun(). Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-09-09Use QT format for audio sample descriptors depending on stsd version.Justin Ruggles
ISOBMFF does not allow AudioSampleEntryV1 in stsd version 0, so assume the descriptor format is QTFF SoundDescriptionV1. ISOBMFF does not define a version 2. This fixes audio decoding for some MP4 files generated with Apple tools. The additional fields present in SoundDescriptionV1/V2 need to be read in order to correctly read additional boxes that contain information required for decoding the stream. Fixes #7376. Also see: https://github.com/HandBrake/HandBrake/issues/1555 Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2018-09-08lavf/mov: add AVCodecTag entry for GoPro metadataJohn Stebbins
This allows for validation of the track type Signed-off-by: James Almer <jamrial@gmail.com>
2018-07-25lavf/isom: Make auxiliary_offsets consistently uint64_t.Carl Eugen Hoyos
Fixes a compilation warning if size_t != uint64_t: libavformat/mov.c: In function ‘mov_read_saio’: libavformat/mov.c:6207:45: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types] encryption_index->auxiliary_offsets = auxiliary_offsets; ^
2018-04-21avformat/mov: Fix parsing of saio/siaz atoms in encrypted content.Jacob Trimble
This doesn't support saio atoms with more than one offset. Signed-off-by: Jacob Trimble <modmaker@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-04-19avformat/mov: Remove old encryption info methods.Jacob Trimble
Signed-off-by: Jacob Trimble <modmaker@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-04-19avformat/mov: Increase support for common encryption.Jacob Trimble
- Parse schm atom to get different encryption schemes. - Allow senc atom to appear in track fragments. - Allow 16-byte IVs. - Allow constant IVs (specified in tenc). - Allow only tenc to specify encryption (i.e. no senc/saiz/saio). - Use sample descriptor to detect clear fragments. This doesn't support: - Different sample descriptor holding different encryption info. - Only first sample descriptor can be encrypted. - Encrypted sample groups (i.e. seig). - Non-'cenc' encryption scheme when using -decryption_key. Signed-off-by: Jacob Trimble <modmaker@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-03-10lavf/mov.c: Use the correct offset to shift timestamp when seeking.Sasi Inguva
Fixes seek for files with empty edits and files with negative ctts (dts_shift > 0). Added fate samples and tests. Signed-off-by: Sasi Inguva <isasi@isasi.mtv.corp.google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-12-02lavf/movenc: add sdtp (sample dependency) boxJohn Stebbins
The sdtp is required by the AppleTV 4K in order to play 2160p60 video. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-10-26Merge commit '604fbb3132e88727e496c96c92cfe02748c25a1a'James Almer
* commit '604fbb3132e88727e496c96c92cfe02748c25a1a': mov: Move code shared with CAF to a separate file Merged-by: James Almer <jamrial@gmail.com>
2017-10-23mov: fix decode of fragments that overlap in timeJohn Stebbins
When keyframe intervals of dash segments are not perfectly aligned, fragments in the stream can overlap in time. The previous sorting by timestamp causes packets to be read out of decode order and results in decode errors. Insert new "trun" index entries into index_entries in the order that the trun are referenced by the sidx. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-28lavf/mov: Allow reading very large files.Pablo Montilla
The Sample count in the time-to-sample table is defined as 32-bit unsigned integer by the QT specification. Fixes ticket #6700.
2017-09-27Merge commit '53ea595eec984e3109310e8bb7ff4b5786d91057'James Almer
* commit '53ea595eec984e3109310e8bb7ff4b5786d91057': mov: Rework stsc index validation See e26e6240b6700c5e8c16d0f092f1ad46805a723c. Merged-by: James Almer <jamrial@gmail.com>
2017-08-24avformat/mov: Fix trampling of ctts during seeks when sidx support is enabled.Dale Curtis
When sidx box support is enabled, the code will skip reading all trun boxes (each containing ctts entries for samples inthat box). If seeks are attempted before all ctts values are known, the old code would dump ctts entries into the wrong location. These are then used to compute pts values which leads to out of order and incorrectly timestamped packets. This patch fixes ctts processing by always using the index returned by av_add_index_entry() as the ctts_data index. When the index gains new entries old values are reshuffled as appropriate. This approach makes sense since the mov demuxer is already relying on the mapping of AVIndex entries to samples for correct demuxing. As a result of this all ctts entries are now 1-count. A followup change will be submitted to remove support for > 1 count entries which will simplify seeking. Notes for future improvement: Probably there are other boxes (stts, stsc, etc) that are impacted by this issue... this patch only attempts to fix ctts since it completely breaks packet timestamping. This patch continues using an array for the ctts data, which is not the most ideal given the rearrangement that needs to happen (via memmove as new entries are read in). Ideally AVIndex and the ctts data would be set-type structures so addition is always worst case O(lg(n)) instead of the O(n^2) that exists now; this slowdown is noticeable during seeks. Signed-off-by: Dale Curtis <dalecurtis@chromium.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-27avformat/mov: add support for reading Content Light Level BoxJames Almer
As defined in "VP Codec ISO Media File Format Binding v1.0" https://github.com/webmproject/vp9-dash/blob/master/VPCodecISOMediaFileFormatBinding.md Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
2017-05-27avformat/mov: add support for reading Mastering Display Metadata BoxJames Almer
As defined in "VP Codec ISO Media File Format Binding v1.0" https://github.com/webmproject/vp9-dash/blob/master/VPCodecISOMediaFileFormatBinding.md Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
2017-04-03mov: Move code shared with CAF to a separate fileDiego Biurrun
2017-03-31lavf/mov.c: Add -advanced_editlist option for mov format.Sasi Inguva
Adding an MOV format option to turn on/off the editlist supporting code, introduced in https://github.com/FFmpeg/FFmpeg/commit/ca6cae73db207f17a0d5507609de12842d8f0ca3 Signed-off-by: Sasi Inguva <isasi@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-10mov: Rework stsc index validationVittorio Giovara
In order to avoid potential integer overflow change the comparison and make sure to use the same unsigned type for both elements.
2017-02-01mov: fix decryption with edit listerankor
Retain the ranges of frame indexes when applying edit list in mov_fix_index. The index ranges are then used to keep track of the frame index of the current sample. In case of a discontinuity in frame indexes due to edit, update the auxiliary info position accordingly. Reviewed-by: Sasi Inguva <isasi@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-14Add missing #includes for standalone spherical-information-related headersDiego Biurrun
(cherry picked from commit f912fd767e55bbb5a1554bd99bacab007659609c) Signed-off-by: James Almer <jamrial@gmail.com>
2016-12-08Add missing #includes for standalone spherical-information-related headersDiego Biurrun
2016-12-07mov: Export spherical informationVittorio Giovara
This implements Spherical Video V1 and V2, as described in the spatial-media collection by Google. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-12-07mov: Export spherical informationVittorio Giovara
This implements Spherical Video V1 and V2, as described in the spatial-media collection by Google. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-11-30mov: Evaluate the movie display matrixVittorio Giovara
This matrix needs to be applied after all others have (currently only display matrix from trak), but cannot be handled in movie box, since streams are not allocated yet. So store it in main context, and apply it when appropriate, that is after parsing the tkhd one. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-11-03lavf/mov.c: Use the first sidx for tracks without sidx.Sasi Inguva
According to spec ISO_IEC_15444_12 "For any media stream for which no segment index is present, referred to as non‐indexed stream, the media stream associated with the first Segment Index box in the segment serves as a reference stream in a sense that it also describes the subsegments for any non‐indexed media stream." Signed-off-by: Sasi Inguva <isasi@google.com> Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-01mov: Evaluate the movie display matrixVittorio Giovara
This matrix needs to be applied after all others have (currently only display matrix from trak), but cannot be handled in movie box, since streams are not allocated yet. So store it in main context, and apply it when appropriate, that is after parsing the tkhd one. Fate tests are updated accordingly. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-10-24lavf/mov: improve `tref/chap` chapter handlingRodger Combs
3 parts: - Supports multiple chapter streams - Exports regular text chapter streams as opaque data. This prevents consumers from showing chapters as if they were regular subtitle streams. - Exports video chapter streams as thumbnails, and provides the first one as an attached_pic.
2016-08-29mov: Remove ancient heuristic hackDerek Buitenhuis
This breaks files with legitimate single-entry edit lists, and the hack, introduced in f03a081df09f9c4798a17d7e24446ed47924b11b, has no link to any known sample in its commit message. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2016-08-25mov: Remove ancient heuristic hackDerek Buitenhuis
This breaks files with legitimate single-entry edit lists, and the hack, introduced in f03a081df09f9c4798a17d7e24446ed47924b11b, has no link to any known sample in its commit message. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-07-13Merge commit '76729970049fe95659346503f7401a5d869f9959'Matthieu Bouron
* commit '76729970049fe95659346503f7401a5d869f9959': mov: Implement support for multiple sample description tables Notes: * The sc->stsc_data[index].id checks have been moved from the mov_read_stsc to mov_read_packet before the value is used in mov_change_extradata to not break playback of samples with broken stsc entries (see sample of ticket #1918). * sc->stsc_index is now checked against sc->stsc_count - 1 before it is incremented so it remains lesser than sc->stsc_count. Fixes a crash with: ./ffmpeg -i matrixbench_mpeg2.mpg -t 1 -frag_duration 200k test.mov ./ffprobe -show_packets test.mov Merged-by: Matthieu Bouron <matthieu.bouron@stupeflix.com>
2016-06-17mov: Implement support for multiple sample description tablesVittorio Giovara
Store data from each stsd in a separate extradata buffer, keep track of the stsc index for read and seek operations, switch buffers when the index differs. Decoder is notified with an AV_PKT_DATA_NEW_EXTRADATA packet side data. Since H264 supports this notification, and can be reset midstream, enable this feature only for multiple avcC's. All other stsd types (such as hvc1 and hev1) need decoder-side changes, so they are left disabled for now. This is implemented only in non-fragmented MOVs. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-03-06mov - support seek in encrypted mp4erankor
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-21mov: Add an option to toggle dref openingDerek Buitenhuis
This feature is mostly only used by NLE software, and is both of dubious value being enabled by default, and a possible security risk. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2016-01-20mov: Add an option to toggle dref openingDerek Buitenhuis
This feature is mostly only used by NLE software, and is both of dubious value being enabled by default, and a possible security risk. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-31avformat/mov: support cenc (common encryption)erankor
support reading encrypted mp4 using aes-ctr, conforming to ISO/IEC 23001-7. a new parameter was added: - decryption_key - 128 bit decryption key (hex) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-13avformat/mov: Enable parser for mp3s by old HandBrakeMichael Niedermayer
Fixes Ticket5047 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-05libavformat/mov.c: allow QuickTime metadata to come after traksNeil Birkbeck
QuickTime metadata can come after trak data. Add indicator for which trak is being parsed (-1 if none) so that global metadata after the trak can be parsed. Signed-off-by: Neil Birkbeck <neil.birkbeck@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-10avformat/mov: Add option to ignore chapters during parsingBryan Huh
Chapter-indexing can be expensive since chapters may be interspersed throughout the entire file and may require many seeks - especially costly when consuming a video over a remote protocol like http. Furthermore it is often unnecessary, especially when only trying to get video info (e.g. via ffprobe). Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-26mov: Add support parsing QuickTime Metadata Keys.Tinglin Liu
The Apple dev specification: https://developer.apple.com/library/mac/documentation/QuickTime/QTFF/Metadata/Metadata.html Basically the structure is like: |--meta |----hdlr |----keys |----ilst 1) The handler type in the metadata handler atom is ‘mdta’. 2) The key and value are stored separately for each key-value pair. The 'keys' atom stores the key table, while 'ilst' atom stores the values corresponding to the indices in the key table. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2015-10-09lavf/mov: add support for sidx fragment indexesRodger Combs
Fixes trac #3842
2015-07-19Add support for Audible AAX (and AAX+) filesVesselin Bontchev
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-03-18mov: Add option to keep exact packet sequence after seekingDerek Buitenhuis
The current behavior may produce a different sequence of packets after seeking, compared to demuxing linearly from the beginning. This is because the MOV demuxer seeks in each stream individually, based on timestamp, which may set each stream at a slightly different position than if the file would have been read sequentially. This makes implementing certain operations, such as segmenting, quite hard, and slower than need be. Therefore, add an option which retains the same packet sequence after seeking, as when a file is demuxed linearly.
2015-03-18mov: Add option to keep exact packet sequence after seekingDerek Buitenhuis
The current behavior may produce a different sequence of packets after seeking, compared to demuxing linearly from the beginning. This is because the MOV demuxer seeks in each stream individually, based on timestamp, which may set each stream at a slightly different position than if the file would have been read sequentially. This makes implementing certain operations, such as segmenting, quite hard, and slower than need be. Therefore, add an option which retains the same packet sequence after seeking, as when a file is demuxed linearly.
2015-01-02avformat/mov: move edit list heuristics into mov_build_index()Clément Bœsch
mov_read_elst() is now only responsible from storing the table in a data structure; this is consistent with other table readers functions.
2014-12-16avformat/mov: check atom nesting depthMichael Niedermayer
Fixes call stack overflow Fixes: case1_call_stack_overflow.mp4 Found-by: Michal Zalewski <lcamtuf@coredump.cx> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-08Merge commit 'b704b648f9ecb830874627db958a37e004107d1b'Michael Niedermayer
* commit 'b704b648f9ecb830874627db958a37e004107d1b': mov: parse XMP metadata on demand Conflicts: libavformat/isom.h libavformat/version.h See: 054c506e3da35471ea92dbedcaaf720d0754f04e The default is left unchanged at enabled We can change the default if people prefer but i do not want to do that in a merge. Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-08mov: parse XMP metadata on demandVittorio Giovara
The Extensible Metadata Platform tag can contain various kind of data which are not strictly related to the video file, such as history of edits and saves from the project file. So display XMP metadata only when the user explicitly requires it. Based on a patch by Marek Fort <marek.fort@chyronhego.com>.
2014-12-02Support muxing 4k AVC Intra in mov.Carl Eugen Hoyos
Reported and tested by Rens Dijkshoorn, rens onlinemedia nl
2014-12-02Merge commit 'e352b293712ff7cbde67eba3ce3f8510b037de09'Michael Niedermayer
* commit 'e352b293712ff7cbde67eba3ce3f8510b037de09': mov: Add an option for exporting all metadata Conflicts: libavformat/isom.h libavformat/mov.c libavformat/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>