summaryrefslogtreecommitdiff
path: root/tests/ref/seek
Commit message (Collapse)AuthorAge
* avformat/matroskaenc: Don't waste bytes on Video element length fieldsAndreas Rheinhardt2022-01-19
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskaenc: Don't waste bytes on SimpleTags length fieldsAndreas Rheinhardt2022-01-19
| | | | | | | Also check the (user-provided) tags for being overlong; the earlier code had an implicit unchecked size_t->int conversion. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavf/mov: Change default to prefer TFDT time and allow for fallback to SIDX ↵Thilo Borgmann2021-11-05
| | | | or TFDT
* avformat/matroskaenc: Pass dispositions through unchanged by defaultAndreas Rheinhardt2021-08-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Up until now, the Matroska muxer did not use the dispositions it is given as-is; instead it by default overrode the disposition of the first track of a kind (audio, video, subtitles) if no track of this kind has the default disposition set. And up until recently, it also enforced by default that no more than one track of each kind be marked as default. The rationale for the former is that there are lots of containers which lack the concept of default streams, so that it is not uncommon for no stream to be marked as default at all; the rationale for the latter was that up until recently, it was dubious whether the Matroska specification allowed more than one default stream for track type (e.g. mkvmerge disallowed it). It was this point which led to the implementation of the above mentioned behaviour inspired by mkvmerge. Yet the Matroska specifications have changed and now explicitly allow to set more than one track of each type as default, so that the main reason of not using the dispositions as-is was rendered moot. Therefore this commit changes the default to pass the disposition through. The matroska-mpegts-remux FATE-test has been updated to still use the old "infer" mode so that it is still covered by FATE; the matroska-zero-length-block test has also been updated to cover the infer_no_subs mode. The references for lots of other FATE tests needed to be updated because of a newly added FlagDefault element with value zero (whereas a FlagDefault with value 1 needn't be coded at all, as it coincided with the default value of said element). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/dv: fix timestamps of audio packets in case of dropped corrupt ↵Marton Balint2020-12-06
| | | | | | | | | | | | | | | | | audio frames By using the frame counter (and the video time base) for audio pts we lose some timestamp precision but we ensure that video and audio coming from the same DV frame are always in sync. This patch also makes timestamps after seek consistent and it should also fix the timestamps when the audio clock is unlocked and have a completely indpendent clock source. (E.g. runs on fixed 48009 Hz which should have been exact 48000 Hz) Fixes out of sync timestamps in ticket #8762. Signed-off-by: Marton Balint <cus@passwd.hu>
* aviobuf: Increase the default SHORT_SEEK_THRESHOLD to 32 KBMartin Storsjö2020-11-12
| | | | | | | | | | | | | | | | | | The previous threshold, 4 KB, maybe was reasonable when it was set (in 2010), but in today's settings and with typical network speeds and data sizes, it's pretty small. 32 KB probably is a more reasonable default now, regardless of input. This changes the test references for two seek tests. When using the normal seek function, which boils down to the lseek(2) function, a seek to an out of bounds position doesn't return an error, but that condition is only reported when doing the subsequent read (which returns EOF). When doing more seeks by fast forwarding, the fact that the seeked to destination is out of bounds is noticed and reported sooner in these cases. Signed-off-by: Martin Storsjö <martin@martin.st>
* avcodec/adpcm_ima_swf: fix frame size to 4096Zane van Iperen2020-11-07
| | | | | | | | | SWF File Format Specification, Version 19 says this is 1 raw sample + 4095 nibbles. https://www.adobe.com/content/dam/acom/en/devnet/pdf/swf-file-format-spec.pdf Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avformat/matroskaenc: Don't ignore tags of chapters written lateAndreas Rheinhardt2020-05-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-21
| | | | | | | | | 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: Make output more deterministicAndreas Rheinhardt2020-04-13
| | | | | | | | | | | | | | | | | | | | | 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: Don't waste bytes writing durationsAndreas Rheinhardt2020-04-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/movenc: ensure we don't write the major brand as a compatible brand ↵James Almer2019-12-21
| | | | | | 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-21
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mpegtsenc: get rid of packet counting for sdt/pat/pmtMarton Balint2019-08-23
| | | | | | | | | | | | | 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/matroskaenc: Don't waste bytes writing level 1 elementsAndreas Rheinhardt2019-05-08
| | | | | | | | | | | 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-08
| | | | | | | | | | 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>
* Merge commit 'f8df5e2f31a5ba7b30a0e1caaaf5a03c753b3f9b'James Almer2019-03-14
|\ | | | | | | | | | | | | * 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-16
| | | | | | | | | | 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-14
|\| | | | | | | | | | | | | * 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-16
| | | | | | | | Rename some tests in the process for consistency and simplicity.
* | Merge commit 'eb8a8115994434b548523cf0bca6a4a74784e79c'James Almer2019-03-14
|\| | | | | | | | | | | | | * 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-16
| | | | | | | | Rename some tests in the process for consistency and simplicity.
| * mkv: Update the seek test to match 5d3953a5dcLuca Barbato2017-02-22
| |
| * ffv1: Remove version 2 and mark version 3 as non-experimentalLuca Barbato2016-06-29
| | | | | | | | | | The encoder produces bitstream compatible with the current specification and version 2 is set as reserved (non-standardizable).
* | avformat/mxfenc: Add Padding BitsMichael Niedermayer2018-05-08
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/mxfenc: Correct KAG alignment of prefaceMichael Niedermayer2018-05-08
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/yuv4mpegdec: simplify mathPaul B Mahol2018-05-03
| | | | | | | | | | | | This one actually works with hd1080 y4m files when seeking backwards. Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | avformat/yuv4mpegdec: fix seeking backwardsPaul B Mahol2018-04-25
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | avcodec/eac3: add support for dependent streamPaul B Mahol2018-03-29
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | avformat/pcm: decrease delay when reading PCM streams.Philipp M. Scholl2018-03-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Thanks for the discussion. Here's the next version, now with /25 and removed ff_log2(). The blocksize of the PCM decoder is hard-coded. This creates unnecessary delay when reading low-rate (<100Hz) streams. This creates issues when multiplexing multiple streams, since other inputs are only opened/read after a low-rate input block was completely read. This patch decreases the blocksize for low-rate inputs, so approximately a block is read every 40ms. This decreases the startup delay when multiplexing inputs with different rates. Signed-off-by: Philipp M. Scholl <pscholl@bawue.de> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf/mov.c: Use the correct offset to shift timestamp when seeking.Sasi Inguva2018-03-10
| | | | | | | | | | | | | | | | 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>
* | fate: remove ffm reference filesJames Almer2018-01-06
| | | | | | | | | | | | | | Missed in c17f4761443b471f47fa8f0a5bcff078cdff9479 and 8bbd8c8d52dbcb15773717d3512f8fb68e860bf2 Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat/mxfdec: fix last packet timestampsMarton Balint2017-12-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current edit unit cannot be reliably determined for the last packet of a video stream, because we can't query the start offset of the next edit unit from the index. This caused missing timestamps for the last video packet. Therefore from now on, we allow setting the PTS even if we are not sure of the current edit unit if mxf_set_current_edit_unit returned a specific failure, and the assumed current edit unit is the last. Fixes last packet timestamp of: ffprobe -fflags nofillin -show_packets tests/data/lavf/lavf.mxf -select_streams v Signed-off-by: Marton Balint <cus@passwd.hu>
* | libavformat/mov.c: use calculated dts offset when seeking in streamsJonas Licht2017-10-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Subtract the calculated dts offset from the requested timestamp before seeking. This fixes an error "Error while filtering: Operation not permitted" observed with a short file which contains only one key frame and starts with negative timestamps. Then, av_index_search_timestamp() returns a valid negative timestamp, but mov_seek_stream bails out with AVERROR_INVALIDDATA. Fixes ticket #6139. Signed-off-by: Jonas Licht <jonas.licht@fem.tu-ilmenau.de> Signed-off-by: Peter Große <pegro@friiks.de> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | fate: add mxf_dv25/dvcpro50 regression testsTobias Rapp2017-09-18
| | | | | | | | Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
* | avformat/mov: Fix trampling of ctts during seeks when sidx support is enabled.Dale Curtis2017-08-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | mjpegenc: enable optimal huffman coding by defaultRostislav Pehlivanov2017-04-09
| | | | | | | | | | | | | | | | As it gives excellent encoding gains at an insignificant speed increase and passes fate without problems, it should now be safe to enable by default. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* | ffmpeg, ffprobe: don't "merge" side data into packet data by defaultwm42017-03-14
| | | | | | | | | | | | | | | | Preparation for potentially disabling merged side data by default in the libs. Do this in particular because it affects fate tests. The changed tests either reflect added packet side data, or the changed packet size due to merged side data removal reducing the packet size.
* | lavf/flvdec: init AVPacket::pos to FLVTAG offsetSuman-2016-10-26
| | | | | | | | | | | | Current code doesn't initialize AVPacket::pos. Made it point to FLVTAG so flv_read_packet can decode from pos Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/matroskaenc: write a DisplayUnit element when aspect ratio is unknownJames Almer2016-10-15
| | | | | | | | | | | | | | | | | | | | | | We don't currently support values 1 (centimeters), 2 (inches) or 3 (DAR), only the default value 0 (pixels) which doesn't need to be written. The fate refs are updated as unknown SAR is now signaled in the output files with the addition of the new element. Reviewed-by: Carl Eugen Hoyos <ceffmpeg@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat/matroskaenc: write a CRC32 element on InfoJames Almer2016-10-06
| | | | | | | | | | | | | | | | | | Finishes implementing ticket #4347 Tested-by: Dave Rice <dave@dericed.com> Tested-by: Jerome Martinez <jerome@mediaarea.net> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat/matroskaenc: write a CRC32 element on TagsJames Almer2016-10-06
| | | | | | | | | | | | | | | | | | Implements part of ticket #4347 Tested-by: Dave Rice <dave@dericed.com> Tested-by: Jerome Martinez <jerome@mediaarea.net> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat/matroskaenc: write a CRC32 element on TracksJames Almer2016-10-06
| | | | | | | | | | | | | | | | | | Implements part of ticket #4347 Tested-by: Dave Rice <dave@dericed.com> Tested-by: Jerome Martinez <jerome@mediaarea.net> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat/matroskaenc: write a CRC32 element on SeekHeadJames Almer2016-10-06
| | | | | | | | | | | | | | | | | | Implements part of ticket #4347 Tested-by: Dave Rice <dave@dericed.com> Tested-by: Jerome Martinez <jerome@mediaarea.net> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat/matroskaenc: write a CRC32 element on each ClusterJames Almer2016-10-06
| | | | | | | | | | | | | | | | | | Implements part of ticket #4347 Tested-by: Dave Rice <dave@dericed.com> Tested-by: Jerome Martinez <jerome@mediaarea.net> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* | libavformat/matroskadec: Add test for seeking with codec delay.Chris Cunningham2016-07-30
| | | | | | | | | | | | Also cleanup parens for the skip_to_timecode check. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | tests/fate: add dnxhr encoding testsMark Reid2016-07-24
| | | | | | | | | | | | added sws_flags flags and tested against x86_32 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf/img2dec: add pnm pipe demuxersClément Bœsch2016-06-22
| |
* | avformat/au: Write MetaData in AU Sun audio file headerThomas Bernard2016-06-03
| | | | | | | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>