summaryrefslogtreecommitdiff
path: root/libavformat
Commit message (Collapse)AuthorAge
* avformat/segment: calculate segment durations correctly.Gyan Doshi2023-01-16
| | | | | | | | | segment_time and segment_times are defined as duration specifications, not timestamps, so calculation of segment duration must account for initial timestamp. Fixed. FATE ref for segment-mp4-to-ts changed on account of avoiding premature segment cut at the end of the first segment.
* avformat/dtshddec: also read trailing padding in samplesPaul B Mahol2023-01-16
|
* lavf/spdifdec: support EAC3rcombs2023-01-13
| | | | | | Parsing should probably be enabled for all codecs, at least for headers, but e.g. the AAC parser produces 1-byte packets of zero padding with it, so I'm just enabling it for EAC3 for the moment.
* libavformat/dashenc: Enable HTTP persistent connections for dashenc_delete_fileBasel Sayeh2023-01-13
| | | | | | | | | | | Removed the unnecessary calls to ff_format_io_close this patch introduced in dashenc_delete_file. dashenc_delete_file functions open a new HTTP connection regardless of the http_persistent value, So change their behaviour to keep http connections open if http_persistent is set. Signed-off-by: Basel Sayeh <basel.sayeh@hotmail.com>
* libavformat/hlsenc: Enable HTTP persistent connections for hls_delete_fileBasel Sayeh2023-01-13
| | | | | | | | | | | Removed the unnecessary calls to ff_format_io_close this patch introduced in hls_delete_file. hls_delete_file functions open a new HTTP connection regardless of the http_persistent value, So change their behaviour to keep http connections open if http_persistent is set Signed-off-by: Basel Sayeh <basel.sayeh@hotmail.com>
* avformat/movenc: Add loop parameter to animated AVIFVignesh Venkatasubramanian2023-01-13
| | | | | | | | | | | | | | | | | | | | | | | The HEIF specification permits specifying the looping behavior of animated sequences by using the EditList (elst) box. The track duration will be set to the total duration of all the loops (or infinite) and the duration of a single loop will be set in the edit list box. The default behavior is to loop infinitely. Compliance verification: * This was added in libavif recently [1] and the files produced by ffmpeg after this change have EditList boxes similar to the ones produced by libavif (and avifdec is able to parse the loop count as intended). * ComplianceWarden is ok with the produced files. * Chrome is able to play back the produced files. [1] https://github.com/AOMediaCodec/libavif/commit/4d2776a3af53ae1aefdaed463b75ba12fd9cf8c2 Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com> Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/movenc: Add movie_timescale option to AVIFVignesh Venkatasubramanian2023-01-13
| | | | | | | | | | | | | Allow specifying the movie_timescale options to AVIF ouptut. This also makes sure that when movie_timescale is not specified, the default value of 1000 is used instead of 0. Animated AVIF files which don't specify the movie_timescale will have the correct duration written in the track and movie headers after this change (instead of writing 0). Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com> Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/nsvdec: add support for STARDIVA formatPaul B Mahol2023-01-12
|
* avformat/file: add S_IFBLK/S_ISBLK compatability macroZhao Zhili2023-01-12
| | | | | | They are not available on Windows. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/file: add fd protocolZhao Zhili2023-01-11
| | | | | | | Unlike the pipe protocol, fd protocol has seek support if it corresponding to a regular file. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/file: dup file descriptor for pipeZhao Zhili2023-01-11
| | | | Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/file: reindent after the previous commitZhao Zhili2023-01-11
| | | | Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/file: add fd option for pipeZhao Zhili2023-01-11
| | | | Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat: Rename IPFS to IPFS gatewayDerek Buitenhuis2023-01-09
| | | | | | | It is a URL rewriter for IPFS gateways, not an actual implementation of IPFS, and naming it as such was both incorrect and misleading. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* mov: Disable advanced_editlist for fragmented MP4 inputDerek Buitenhuis2023-01-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Advanced edit list support is entirely broken for fragmented MP4s, currently. mov_fix_index is never run in mov_build_index, since in fragmented MP4s the stco, stsz, stts, and stsc boxes have zero entries, with the index being filled in as each fragment's trun box is seen. The result of this is that the skip samples is never set properly, since half the code thinks it doesn't need to, as advanced_editlist is enabled, but as mov_fix_index is never called, it doesnt get set. This means that any edits for e.g. priming are not properly applied as skip samples side data. This also means remuxing to fragmented MP4 from progressive MP4 with lavf will quietly drop the edit list, currently. Example: $ ffmpeg -loglevel quiet -advanced_editlist 1 -i non_fragmented.mp4 -f md5 - MD5=d02d929f8eb4edef624758a298d5f7c6 $ ffmpeg -loglevel quiet -advanced_editlist 0 -i non_fragmented.mp4 -f md5 - MD5=d02d929f8eb4edef624758a298d5f7c6 $ ffmpeg -loglevel quiet -advanced_editlist 1 -i fragmented.mp4 -f md5 - MD5=e38b110f586fa886ff94e0ca98a95d59 <-- wrong, extra samples are output instead of being skipped $ ffmpeg -loglevel quiet -advanced_editlist 0 -i fragmented.mp4 -f md5 - MD5=d02d929f8eb4edef624758a298d5f7c6 We cannot call mov_fix_index after reading a trun box since mov_fix_index seems to assume it is only called once, on a fully complete index, an multiple calls to it don't seem like they'd work, so the "best" option seems to be disabling advanced edit list support entirely for the time being, as it is broken for these types of files. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* avformat/oggenc: don't flush twice when the last packet is side data onlyJames Almer2023-01-03
| | | | | | | | Commit 18f24527eb accidentally made side data only packets be handled like a flush request. Fix this regression by effectively ignoring them as was the original intention. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mux: use only valid timestamps when calculating packet distanceJames Almer2023-01-03
| | | | | | | | Fixes: signed integer overflow: 0 - -9223372036854775808 cannot be represented in type 'long int' Fixes: fate-cover-art-aiff-id3v2-remux, fate-cover-art-mp3-id3v2-remux and fate-mov-cover-image under ubsan. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/bonk: add support for ID3 metadataPaul B Mahol2023-01-02
|
* avformat/segment: add option min_seg_durationGyan Doshi2022-12-29
| | | | | | | New option can be used to avoid creating very short segments with inputs whose GOP size is variable or unharmonic with segment_time. Only effective with segment_time.
* avformat/mxfdec: Use 64bit in remainderMichael Niedermayer2022-12-28
| | | | | | | | | Fixes: signed integer overflow: 48000 * 223587 cannot be represented in type 'int' Fixes: 54513/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5817594836025344 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Tomas Härdin <git@haerdin.se> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/oggenc: ignore empty packetsJames Almer2022-12-27
| | | | | | | | | | Some encoders, like flac, can send side data only packets at the end. Eventually, said extradata update should ideally be used to update the header when writting to seekable output, but for now, ignore them. Should fix the undefined behavior of passing NULL to memcpy(). Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/lafdec: Check for EOF in header readingMichael Niedermayer2022-12-23
| | | | | | | | | | | Fixes: OOM testcase Fixes: 51527/clusterfuzz-testcase-minimized-ffmpeg_dem_LAF_fuzzer-5453663505612800 OOM can still happen after this as an arbitrary sized block is allocated and read this would require a redesign or some limit on the sample rate. Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/movenc: correct write_colr warning placementGyan Doshi2022-12-15
| | | | | | | | The old warning is no longer applicable in the inner block after c5b20cfe19. Reviewed-by: Zhao Zhili <quinkblack@foxmail.com> Signed-off-by: Gyan Doshi <ffmpeg@gyani.pro>
* avformat/fifo: use av_dict_iterateMarvin Scholz2022-12-01
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskaenc: use av_dict_iterateMarvin Scholz2022-12-01
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/http: use av_dict_iterateMarvin Scholz2022-12-01
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/asfenc: use av_dict_iterateMarvin Scholz2022-12-01
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/apetag: use av_dict_iterateMarvin Scholz2022-12-01
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/nutenc: use av_dict_iterateMarvin Scholz2022-12-01
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/id3v2enc: use av_dict_iterateMarvin Scholz2022-12-01
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/ffmetaenc: use av_dict_iterateMarvin Scholz2022-12-01
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/wtvenc: use av_dict_iterateMarvin Scholz2022-12-01
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/dump: use av_dict_iterateMarvin Scholz2022-12-01
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/lrcenc: use av_dict_iterateMarvin Scholz2022-12-01
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/hls: use av_dict_iterateMarvin Scholz2022-12-01
| | | | | | And constify oldentry too while at it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/flvenc: use av_dict_iterateMarvin Scholz2022-12-01
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/metadata: use av_dict_iterateMarvin Scholz2022-12-01
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/movenc: use av_dict_iterateMarvin Scholz2022-12-01
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/cafenc: use av_dict_iterateMarvin Scholz2022-12-01
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/vorbiscomment: use av_dict_iterateMarvin Scholz2022-12-01
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/smjpegenc: use av_dict_iterateMarvin Scholz2022-12-01
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* configure: Add (h264|hevc)_sei subsystemsAndreas Rheinhardt2022-12-01
| | | | | | | | | | | | | | | | | | Currently, several components select atsc_a53, despite not using anything from it themselves. They only select it because parsing SEI messages adds an indirect dependency. But using direct dependencies is more natural, so add dedicated subsystems for them. It already allows to remove a superfluous dependency of the HEVC QSV encoder on hevc_sei and atsc_a53. Adding new subsystems only becomes effective after a reconfiguration. In order to force this, some needed headers (which are only included implicitly before this commit) were included explicitly in libavformat/allformats.c. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mov: Set duration to zero if the duration is UINT_MAXSasi Inguva2022-11-29
| | | | | | | Fixes some MP4F files which have duration in mdhd set to UINT_MAX instead of zero. Signed-off-by: Sasi Inguva <isasi@google.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/id3v2: Check taglen in read_uslt()Michael Niedermayer2022-11-28
| | | | | | | | | Fixes: Timeout (read mostly the same data repeatly) Fixes: 52457/clusterfuzz-testcase-minimized-ffmpeg_dem_ALP_fuzzer-6610706313379840 Fixes: 53098/clusterfuzz-testcase-minimized-ffmpeg_dem_SOL_fuzzer-6481382981632000 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/wavenc: w64 muxer supports only 1 streamPaul B Mahol2022-11-25
|
* avformat/electronicarts: add option to return alpha channel in the main ↵Marton Balint2022-11-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | video stream in VP6A codec VP6 alpha in EA format is a second VP6 encoded video stream where only the Y component is used and is interpreted as the alpha channel of the first VP6 stream. The alpha VP6 stream is muxed separately from the main VP6 stream, has its own stream headers and packet headers. In theory the two streams might not even have the same resolution (although most likely that is not something that is seen or supported in the wild), but the format is capable of doing it. Merged VP6 alpha (also known as the VP6A codec) means that a packet of the video stream contains the corresponding packet of both VP6 substreams like this: {OffsetOfAlpha, DataPacket, AlphaDataPacket} So data and alpha data of a frame is merged to a single packet, this is how VP6 video with alpha is muxed in FLV and SWF. The first approach is more like how the demuxer sees data in the EA format, unfortunately it is different to what the FLV or SWF format expects, so - having no better place for it in the framework - I decided to do an optional format conversion in the EA demuxer. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/electronicarts: set packet_read in one placeMarton Balint2022-11-22
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/electronicarts: fix EOF checkMarton Balint2022-11-22
| | | | | | Similar to feof(), avio_feof() is only true after an actual overread. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/concatdec: check that there's extradata before trying to copy itJames Almer2022-11-17
| | | | | | The first argument for memcpy must not be NULL. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/vpcc: parse bitstream data to get profile and bitdepthJames Almer2022-11-17
| | | | | | | | Profile can be derived from values codecpar pixel format only with software formats. For hardware formats, we're forced to parse a frame header to get the required information. Signed-off-by: James Almer <jamrial@gmail.com>