aboutsummaryrefslogtreecommitdiffstats
path: root/tests/ref/lavf
Commit message (Collapse)AuthorAgeFilesLines
* avformat/matroskaenc: Don't ignore tags of chapters written lateAndreas Rheinhardt2020-05-193-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Matroska muxer writes the Chapters early when chapters were already available when writing the header; in this case any tags pertaining to these chapters get written, too. Yet if no chapters had been supplied before writing the header, Chapters can also be written when writing the trailer if any are supplied. Tags belonging to these chapters were up until now completely ignored. This commit changes this: Writing the tags belonging to chapters has been moved to mkv_write_chapters(). If mkv_write_tags() has not been called yet (i.e. when chapters are written when writing the header), the AVIOContext for writing the ordinary Tags element is used, but not output, as this is left to mkv_write_tags() in order to only write one Tags element. Yet if mkv_write_tags() has already been called, mkv_write_chapters() will output a Tags element of its own which only contains the tags for chapters. When chapters are available initially, the corresponding tags will now be the first tags in the Tags element; but the ordering of tags in Tags is irrelevant anyway. This commit also makes chapter_id_offset local to mkv_write_chapters() as it is used only there and not reused at all. Potentially writing a second Tags element means that the maximum number of SeekHead entries had to be incremented. All the changes to FATE result from the ensuing increase in the amount of space reserved for the SeekHead (21 bytes more). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/matroskaenc: Don't waste bytes on length fieldsAndreas Rheinhardt2020-04-213-6/+6
| | | | | | | | | Several EBML Master elements for which a good upper bound of the final length was available were nevertheless written without giving an upper bound of the final length to start_ebml_master(), so that their length fields were eight bytes long. This has been changed. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/matroskaenc: Improve Cues in case of no videoAndreas Rheinhardt2020-04-201-2/+2
| | | | | | | | | | | | | | | | The Matroska muxer currently only adds CuePoints in three cases: a) For video keyframes. b) For the first audio frame in a new Cluster if in DASH-mode. c) For subtitles. This means that ordinary Matroska audio files won't have any Cues which impedes seeking. This commit changes this. For every track in a file without video track it is checked and tracked whether a Cue entry has already been added for said track for the current Cluster. This is used to add a Cue entry for each first packet of each track in each Cluster. Implements #3149. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/matroskaenc: Make output more deterministicAndreas Rheinhardt2020-04-133-6/+6
| | | | | | | | | | | | | | | | | | | | | Using random values for TrackUID and FileUID (as happens when the AVFMT_FLAG_BITEXACT flag is not set) has the obvious downside of making the output indeterministic. This commit mitigates this by writing the potentially random values with a fixed size of eight byte, even if their actual values would fit into less than eight bytes. This ensures that even in non-bitexact mode, the differences between two files generated with the same settings are restricted to a few bytes in the header. (Namely the SegmentUID, the TrackUIDs (in Tracks as well as when referencing them via TagTrackUID), the FileUIDs (in Attachments as well as in TagAttachmentUID) as well as the CRC-32 checksums of the Info, Tracks, Attachments and Tags level-1-elements.) Without this patch, there might be an offset/a size difference between two such files. The FATE-tests had to be updated because the fixed-sized UIDs are also used in bitexact mode. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/matroskaenc: Remove allocations for AttachmentsAndreas Rheinhardt2020-04-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If there are Attachments to write, the Matroska muxer currently allocates two objects: An array that contains an entry for each AttachedFile containing just the stream index of the corresponding stream and the FileUID used for this AttachedFile; and a structure with a pointer to said array and a counter for said array. These uids are generated via code special to Attachments: It uses an AVLFG in the normal and a sha of the attachment data in the bitexact case. (Said sha requires an allocation, too.) But now that an uid is generated for each stream in mkv_init(), there is no need any more to use special code for generating the FileUIDs of AttachedFiles: One can simply use the uid already generated for the corresponding stream. And this makes the whole allocations of the structures for AttachedFiles as well as the structures itself superfluous. They have been removed. In case AVFMT_FLAG_BITEXACT is set, the uids will be different from the old ones which is the reason why the FATE-test lavf-mkv_attachment needed to be updated. The old method had the drawback that two AttachedFiles with the same data would have the same FileUID. The new one doesn't. Also notice that the dynamic buffer used to write the Attachments leaks if an error happens when writing the buffer. By removing the allocations potential sources of errors have been removed. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/matroskaenc: Don't waste bytes writing durationsAndreas Rheinhardt2020-04-133-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Tags in the Matroska file format can be summarized as follows: There is a level 1-element called Tags containing one or many Tag elements each of which in turn contain a Targets element and one or many SimpleTags. Each SimpleTag roughly corresponds to a single key-value pair similar to an AVDictionaryEntry. The Targets meanwhile contains information to what the metadata contained in the SimpleTags contained in the containing Tag applies (i.e. to the file as a whole or to an individual track). The Matroska muxer writes such metadata. It puts the metadata of every stream into a Tag whose Targets makes it point to the corresponding track. And if the output is seekable, then it also adds another Tag for each track whose Targets corresponds to the track and where it reserves space in a SimpleTag to write the duration at the end of the muxing process into. Yet there is no reason to write two Tag elements for a track and a few bytes (typically 24 bytes per track) can be saved by adding the duration SimpleTag to the other Tag of the same track (if it exists). FATE has been updated because the output files changed. (Tests that write to unseekable output (pipes) needn't be updated (no duration tag has ever been written for them) and the same applies to tests without further metadata.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/matroskaenc: Avoid allocations for SeekHeadAndreas Rheinhardt2020-03-263-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Up until e7ddafd5, the Matroska muxer wrote two SeekHeads: One at the beginning referencing the main level 1 elements (i.e. not the Clusters) and one at the end, referencing the Clusters. This second SeekHead was useless and has therefore been removed. Yet the SeekHead-related functions and structures are still geared towards this usecase: They are built around an allocated array of variable size that gets reallocated every time an element is added to it although the maximum number of Seek entries is a small compile-time constant, so that one should rather include the array in the SeekHead structure itself; and said structure should be contained in the MatroskaMuxContext instead of being allocated separately. The earlier code reserved space for a SeekHead with 10 entries, although we currently write at most 6. Reducing said number implied that every Matroska/Webm file will be 84 bytes smaller and required to adapt several FATE tests; furthermore, the reserved amount overestimated the amount needed for for the SeekHead's length field and how many bytes need to be reserved to write a EBML Void element, bringing the total reduction to 89 bytes. This also fixes a potential segfault: If !mkv->is_live and if the AVIOContext is initially unseekable when writing the header, the SeekHead is already written when writing the header and this used to free the SeekHead-related structures that have been allocated. But if the AVIOContext happens to be seekable when writing the trailer, it will be attempted to write the SeekHead again which will lead to segfaults because the corresponding structures have already been freed. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/mxfenc: use a zero based continuity counterMarton Balint2020-03-021-2/+2
| | | | | | | | | | The standard does not seem to require the counter to be zero based, but some checker tools (MyriadBits MXFInspect, Interra Baton) have validations against 0 start... Fixes ticket #6781. Signed-off-by: Marton Balint <cus@passwd.hu>
* remove tests/ref/lavf/fitsMichael Niedermayer2020-01-301-18/+0
| | | | | | This appears to be forgotten in ac4b5d86222006fa71ffe5922e1a34f1422507d8 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/movenc: ensure we don't write the major brand as a compatible brand ↵James Almer2019-12-213-14/+14
| | | | | | more than once Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/movenc: write the major brand also as the first compatible brandJames Almer2019-12-214-20/+20
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/fitsdec: Use lrint()Michael Niedermayer2019-12-051-1/+1
| | | | | | | | | | Fixes: fate-fitsdec-bitpix-64 Possibly Fixes: -nan is outside the range of representable values of type 'unsigned short' Possibly Fixes: 17769/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FITS_fuzzer-5678314672357376 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mpegtsenc: get rid of packet counting for sdt/pat/pmtMarton Balint2019-08-231-2/+2
| | | | | | | | | | | | | The packet counting based approach caused excessive sdt/pat/pmt for VBR, so let's use a timestamp based approach instead similar to how we emit PCRs. SDT/PAT/PMT period should be consistent for both VBR and CBR from now on. Also change the type of sdt_period and pat_period to AV_OPT_TYPE_DURATION so no floating point math is necessary. Fixes ticket #3714. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/movenc: use unspecified language by defaultMarton Balint2019-07-122-4/+4
| | | | | | English was used before. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/matroskaenc: Don't waste bytes writing level 1 elementsAndreas Rheinhardt2019-05-083-6/+6
| | | | | | | | | | | Up until now, the length field of most level 1 elements has been written using eight bytes, although it is known in advance how much space the content of said elements will take up so that it would be possible to determine the minimal amount of bytes for the length field. This commit changes this. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/matroskaenc: Don't waste bytes in EBML HeaderAndreas Rheinhardt2019-05-083-6/+6
| | | | | | | | | | Up until now the EBML Header length field has been written with eight bytes, although the EBML Header is always so small that only one byte is needed for it. This patch saves seven bytes for every Matroska/Webm file. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* lavf/movenc: fix tmcd writing for non-MP4/MOV modesGyan Doshi2019-04-031-4/+4
| | | | | | | 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.
* fate/lavf-image: fix passed arguments for some high bit depth testsJames Almer2019-03-143-3/+3
| | | | | | Should fix fate failures on big endian targets. Signed-off-by: James Almer <jamrial@gmail.com>
* Merge commit 'f8df5e2f31a5ba7b30a0e1caaaf5a03c753b3f9b'James Almer2019-03-1411-15/+30
|\ | | | | | | | | | | | | * commit 'f8df5e2f31a5ba7b30a0e1caaaf5a03c753b3f9b': tests: Add a convenience function for video-only lavf tests Merged-by: James Almer <jamrial@gmail.com>
| * tests: Add a convenience function for video-only lavf testsDiego Biurrun2019-02-163-6/+6
| | | | | | | | | | Rename a test in the process for consistency and simplicity and remove the remnants of the now-unused lavf regression test scripts.
* | Merge commit '618d02c1fa9e74d490cace64a7d15762656b521c'James Almer2019-03-1431-116/+116
|\| | | | | | | | | | | | | * commit '618d02c1fa9e74d490cace64a7d15762656b521c': tests: Convert lavf container tests to non-legacy test scripts Merged-by: James Almer <jamrial@gmail.com>
| * tests: Convert lavf container tests to non-legacy test scriptsDiego Biurrun2019-02-1616-41/+41
| | | | | | | | Rename some tests in the process for consistency and simplicity.
* | Merge commit '896fe15dbb7b78de495c4a7dd75e7faec66778da'James Almer2019-03-141-38/+0
|\| | | | | | | | | | | | | * commit '896fe15dbb7b78de495c4a7dd75e7faec66778da': tests: Convert lavf pixfmt conversion tests to non-legacy test scripts Merged-by: James Almer <jamrial@gmail.com>
| * tests: Convert lavf pixfmt conversion tests to non-legacy test scriptsDiego Biurrun2019-02-161-38/+0
| | | | | | | | Also split monolithic lavf-pixfmt test into individual tests.
* | Merge commit 'a957e9379d11f2982d615f92c30580a57ea8bb40'James Almer2019-03-1434-99/+99
|\| | | | | | | | | | | | | * commit 'a957e9379d11f2982d615f92c30580a57ea8bb40': tests: Convert lavf image tests to non-legacy test scripts Merged-by: James Almer <jamrial@gmail.com>
| * tests: Convert lavf image tests to non-legacy test scriptsDiego Biurrun2019-02-1614-39/+39
| | | | | | | | Rename some tests in the process for consistency and simplicity.
* | Merge commit 'eb8a8115994434b548523cf0bca6a4a74784e79c'James Almer2019-03-1425-59/+60
|\| | | | | | | | | | | | | * commit 'eb8a8115994434b548523cf0bca6a4a74784e79c': tests: Convert audio-only lavf tests to non-legacy test scripts Merged-by: James Almer <jamrial@gmail.com>
| * tests: Convert audio-only lavf tests to non-legacy test scriptsDiego Biurrun2019-02-1614-33/+33
| | | | | | | | Rename some tests in the process for consistency and simplicity.
* | Merge commit 'a70eac7a9b193e8434b5bed90bd72aa4cb688363'James Almer2019-03-143-9/+9
|\| | | | | | | | | | | | | * commit 'a70eac7a9b193e8434b5bed90bd72aa4cb688363': tests: Convert image2pipe tests to non-legacy test scripts Merged-by: James Almer <jamrial@gmail.com>
| * tests: Convert image2pipe tests to non-legacy test scriptsDiego Biurrun2019-02-163-9/+9
| |
* | Merge commit 'dad5fd59f3d6a8311365314cfcde0ebcd15c2b01'James Almer2019-03-101-0/+1
|\| | | | | | | | | | | | | * commit 'dad5fd59f3d6a8311365314cfcde0ebcd15c2b01': tests: Enable CRC test for yuv4mpeg Merged-by: James Almer <jamrial@gmail.com>
| * tests: Enable CRC test for yuv4mpegDiego Biurrun2019-02-161-0/+1
| |
| * mpeg2enc: Don't mark all streams as component videoMark Thompson2017-08-204-4/+4
| | | | | | | | | | | | | | | | Since there is no information about the source format, "unspecified" is the correct value to write here. All tests using the MPEG-2 encoder are updated, as this changes the header on all outputs.
| * fate: Update fate-lavf-mkv after commit 5d3953a5dcJohn Stebbins2017-02-211-2/+2
| |
| * fate: Update fate-lavf-ts after commit 393596f9d5Martin Storsjö2016-05-171-1/+1
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | avformat/mxfenc: correctly set content package rate in system elementBaptiste Coudurier2018-10-121-1/+1
| |
* | avformat/mxfenc: update body partition with footer offsetBaptiste Coudurier2018-10-126-8/+8
| |
* | avformat/mxfenc: add mpeg-2 specific metadata, fix compatibility with sony ↵Baptiste Coudurier2018-10-126-8/+8
| | | | | | | | content browser
* | avformat/mxfenc: write index delta entry array needed by sony vegas pro 11Baptiste Coudurier2018-10-126-8/+8
| |
* | avformat/movenc: implicitly enable negative CTS offsets for ismvJan Ekström2018-08-241-3/+3
| | | | | | | | | | | | | | | | | | | | | | 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/audiointerleave: pad last audio frameBaptiste Coudurier2018-08-211-2/+2
| |
* | avcodec/xwddec: fix palette alphaMarton Balint2018-05-161-2/+2
| | | | | | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* | avformat/mxfenc: Add Sample width/height/x offset/y offset, Display x offset ↵Michael Niedermayer2018-05-126-8/+8
| | | | | | | | | | | | and F2 offset Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/mxfenc: Write transfer characteristicMichael Niedermayer2018-05-086-8/+8
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/mxfenc: Add Stored F2 Offset / Image Start/End Offset for D10Michael Niedermayer2018-05-086-8/+8
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/mxfenc: Write Audio Ref Level for D10Michael Niedermayer2018-05-086-8/+8
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/mxfenc: Add Padding BitsMichael Niedermayer2018-05-086-16/+16
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/mxfenc: add white/black ref /color rangeMichael Niedermayer2018-05-086-8/+8
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/mxfenc: Add vertical subsampling supportMichael Niedermayer2018-05-086-8/+8
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/mxfenc: Add object model versionMichael Niedermayer2018-05-086-8/+8
| | | | | | | | | | | | Other tools (XFConvert at least) write this as well. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>