aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
Commit message (Collapse)AuthorAgeFilesLines
...
* avformat/matroskaenc: Add const where appropriateAndreas Rheinhardt2023-08-101-4/+5
| | | | | | Also move getting the DOVI side data immediately before its use. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/dovi_isom: Don't use AVFormatContext* for logctxAndreas Rheinhardt2023-08-102-8/+11
| | | | | | | | Pass it as void* instead. While just at it, also constify the pointee of AVDOVIDecoderConfigurationRecord* in ff_isom_put_dvcc_dvvc(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskaenc: Avoid allocations when writing Dynamic HDR10+Andreas Rheinhardt2023-08-101-19/+7
| | | | | | Possible since 61b27b15fc924d7fa35baa61cfbc91568945f5db. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskaenc: Use dedicated pointer for accessesAndreas Rheinhardt2023-08-101-7/+13
| | | | | | Improves readability; also split overlong lines. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskaenc: Use proper AVIOContextAndreas Rheinhardt2023-08-101-1/+1
| | | | | | | | These two AVIOContexts currently coincide, but this is not guaranteed to remain so (in fact, I have plans to write each TrackEntry into its own AVIOContext). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskaenc: Remove unnecessary checkAndreas Rheinhardt2023-08-101-2/+2
| | | | | | | It is only WebVTT which is special in WebM; hypothetical future subtitle codecs in WebM will presumably use the ordinary code. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskaenc: Hoist check out of loopAndreas Rheinhardt2023-08-101-2/+6
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskaenc: Don't pretend to be able to mux RV30Andreas Rheinhardt2023-08-101-7/+3
| | | | | | | | | | | | | The demuxer uses a extradata offset of 26, so we would need to recreate the missing 26 bytes somehow in the muxer, but we just don't. Remuxed files (like real/rv30.rm from the FATE-suite) don't work due to missing extradata. (The extradata offset also applies to RV40 and the extradata is indeed lost upon remuxing, yet remuxing real/spygames-2MB.rmvb works; our RV40 decoder does not use extradata at all.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskaenc: Don't pretend to support unsupported codecsAndreas Rheinhardt2023-08-101-4/+0
| | | | | | | | | | | RV10 and RV20 are unsupported because creating the correct CodecPrivate is unsupported (the demuxer uses a codecpriv_offset of 26, so one would need to recreate the missing 26 bytes); COOK and SIPR are unsupported, because Matroska uses a packetization mode that is different from what FFmpeg uses in its packets (see matroska_parse_rm_audio() in the demuxer). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskaenc: Don't reserve unnecessarily many EBML elementsAndreas Rheinhardt2023-08-101-1/+1
| | | | | | | | | bda44f0f39e8ee646e54f15989d7845f4bf58d26 added code that potentially added another BlockMore master and BlockAdditional data as well as BlockAddID number, yet it bumped the number of EBML elements by four instead of only three. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskaenc: Support rotationsAndreas Rheinhardt2023-08-101-17/+83
| | | | | | | | | | | | | | | | | Matroska supports orthogonal transformations (both pure rotations as well as reflections) via its 3D-projection elements, namely ProjectionPoseYaw (for a horizontal reflection) as well as ProjectionPoseRoll (for rotations). This commit adds support for this. Support for this in the demuxer has been added in 937bb6bbc1e8654633737e69e403e95a37113058 and the sample used in the matroska-dovi-write-config8 FATE-test includes a displaymatrix indicating a rotation which is now properly written and read, thereby providing coverage for the relevant code in the muxer as well as the demuxer. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/sbgdec: Use avio_read_to_bprint() where appropriateAndreas Rheinhardt2023-08-091-38/+25
| | | | | | | | | | | Note: There is a slight difference in the handling of the max_file_size option: The earlier code used it to mean to limit the size of the buffer to allocate; the new code treats it more literally as maximum size to read from the input. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/movenc: fix sample size being zero in pcmCZhao Zhili2023-08-061-1/+6
| | | | | | | | bits_per_raw_sample might not set when remux raw PCM. Fix #10433. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/rawdec: Don't include avcodec.hAndreas Rheinhardt2023-08-051-2/+0
| | | | | | Possible since 2850584876e52beaddf7a9f30e9914dad7115618. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/internal: Use forward declaration for AVCodecDescriptorAndreas Rheinhardt2023-08-052-2/+2
| | | | | | | | | | | This avoids including lavc/codec_desc.h everywhere and thereby forces users to include it directly instead of lazily and potentially unknowingly relying on indirect inclusions. Also add the proper inclusion to libavformat/demux.c, one of the two files that actually use the new field. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/evcdec: Remove unused headersAndreas Rheinhardt2023-08-051-4/+0
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/av1dec: Remove avcodec.h inclusionAndreas Rheinhardt2023-08-051-1/+0
| | | | | | Possible since 60ecf44b037c7961ac4e69f83ff315c11c5df922. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/flvdec: handle exheader fourcc correctly in metadataMarton Balint2023-08-031-45/+29
| | | | | | | | In metadata fourcc is carried in the AMF number, not as binary. Partially based on a patch by Steven Liu. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/hls_sample_encryption: Always free AC3HeaderInfo on errorAndreas Rheinhardt2023-08-021-4/+2
| | | | | | | | | | | | The code currently presumes that a return value of AVERROR(ENOMEM) implies that ac3hdr could not be allocated, so it need not be freed. Yet any avpriv_ac3_parse_header() might allocate more than the AC3HeaderInfo internally (it doesn't currently), so simply free it unconditionally. Fixes Coverity issues #1492870 and #1492868. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/avr: Check sample rateMichael Niedermayer2023-08-021-0/+3
| | | | | | | | | Fixes: 54979/clusterfuzz-testcase-minimized-ffmpeg_dem_AVR_fuzzer-6681035461230592 Fixes: Timeout Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/lrcdec: Fix declaration-after-statement warningAndreas Rheinhardt2023-07-291-2/+3
| | | | | | Happens since c0f867bf503e79eba8ee52e1ac53322f88ec2929. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* libavformat: fix incorrect handling of incomplete AVBPrint.Reimar Döffinger2023-07-2910-15/+56
| | | | | | | | | | | | | Change some internal APIs a bit to make it harder to make such mistakes. In particular, have the read chunk functions return an error when the result is incomplete. This might be less flexible, but since there has been no use-case for that so far, avoiding coding mistakes seems better. Add a function to queue a AVBPrint directly (ff_subtitles_queue_insert_bprint). Also fixes a leak in lrcdec when ff_subtitles_queue_insert fails. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* avformat/mov: enable identifying TTML subtitle streams as suchJan Ekström2023-07-281-2/+9
| | | | | | | | The contents are full TTML XML documents. TTML writing tests' results are updated as the streams are now properly identified as TTML ones. Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
* avformat/imf_cpl: Replace NULL content_title_utf8 by ""Michael Niedermayer2023-07-251-0/+4
| | | | | | Suggested-by: Pierre-Anthony Lemieux <pal@sandflow.com> Reviewed-by: Pierre-Anthony Lemieux <pal@sandflow.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/imf_cpl: xmlNodeListGetString() can return NULLMichael Niedermayer2023-07-251-2/+6
| | | | | | | | | Fixes: NULL pointer dereference Fixes: 60166/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5998301577871360 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Pierre-Anthony Lemieux <pal@sandflow.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/flvdec: fix size desync when reading timestamp offsetsHendrik Leppkes2023-07-251-2/+1
| | | | | | | | | The size offset was previously being accounted for in flv_set_video_codec for h264 and mpeg4, instead of being directly accounted for in the spot where its read, which desynced on HEVC streams. For clarity, move the size offset directly to the parsing, similar to how its done for all other header fields.
* avformat/flvenc: write proper timestamps when muxing hevcTimo Rothenpieler2023-07-251-1/+7
|
* avformat/id3v2: Free buffer in decode_str()Michael Niedermayer2023-07-221-1/+3
| | | | | | | | Fixes: memleak Fixes: 60058/clusterfuzz-testcase-minimized-ffmpeg_dem_IFF_fuzzer-5665259244093440 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/rka: bps < 8 is invalidMichael Niedermayer2023-07-221-1/+1
| | | | | | | | Fixes: division by zero Fixes: 57828/clusterfuzz-testcase-minimized-ffmpeg_dem_RKA_fuzzer-6571818338353152 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avisynth: pass audio channel layoutStephen Hutchinson2023-07-191-0/+6
| | | | Signed-off-by: Stephen Hutchinson <qyot27@gmail.com>
* avformat/mov: avss box should be AV_CODEC_ID_CAVSZhao Zhili2023-07-191-1/+1
| | | | | | | | | | | | I cannot find the spec, but according to the original commit d4fdba0df71, it's CAVS. e571305a714 changed it to AVS by accident. Ten years on, nothing happened. We still have the sample [1], however, since there is no cavs_mp4tofoobar bsf, the cavs decoder doesn't work. I don't know if there is any use case. [1] https://samples.ffmpeg.org/AVS/AVSFileFormat/AVSFileFormat.mp4 Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/flvdec: support demux vp9 in enhanced flvSteven Liu2023-07-181-2/+9
| | | | | | | | Tested-by: Tristan Matthews <tmatth@videolan.org> Tested-by: Neal Gompa <ngompa13@gmail.com> Reviewed-by: Tristan Matthews <tmatth@videolan.org> Reviewed-by: Neal Gompa <ngompa13@gmail.com> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/flvenc: support mux vp9 in enhanced flvSteven Liu2023-07-182-9/+15
| | | | | | | | Tested-by: Tristan Matthews <tmatth@videolan.org> Tested-by: Neal Gompa <ngompa13@gmail.com> Reviewed-by: Tristan Matthews <tmatth@videolan.org> Reviewed-by: Neal Gompa <ngompa13@gmail.com> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/flvdec: support demux av1 in enhanced flvSteven Liu2023-07-181-2/+10
| | | | | | | | Tested-by: Tristan Matthews <tmatth@videolan.org> Tested-by: Neal Gompa <ngompa13@gmail.com> Reviewed-by: Tristan Matthews <tmatth@videolan.org> Reviewed-by: Neal Gompa <ngompa13@gmail.com> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/flvenc: support mux av1 in enhanced flvSteven Liu2023-07-182-5/+19
| | | | | | | | Tested-by: Tristan Matthews <tmatth@videolan.org> Tested-by: Neal Gompa <ngompa13@gmail.com> Reviewed-by: Tristan Matthews <tmatth@videolan.org> Reviewed-by: Neal Gompa <ngompa13@gmail.com> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/flvdec: support demux hevc in enhanced flvSteven Liu2023-07-181-8/+50
| | | | | | | | Tested-by: Tristan Matthews <tmatth@videolan.org> Tested-by: Neal Gompa <ngompa13@gmail.com> Reviewed-by: Tristan Matthews <tmatth@videolan.org> Reviewed-by: Neal Gompa <ngompa13@gmail.com> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/flvenc: support mux hevc in enhanced flvSteven Liu2023-07-183-11/+47
| | | | | | | | Tested-by: Tristan Matthews <tmatth@videolan.org> Tested-by: Neal Gompa <ngompa13@gmail.com> Reviewed-by: Tristan Matthews <tmatth@videolan.org> Reviewed-by: Neal Gompa <ngompa13@gmail.com> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: use av_random_bytes() for generating AES128 keyMarton Balint2023-07-161-21/+2
| | | | | | | | | av_random_bytes() can use OS provided strong random functions and does not depend soley on openssl/gcrypt external libraries. Fixes ticket #10441. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/ivfenc: Set the "number of frames" in IVF headerDai, Jianhui J2023-07-092-11/+15
| | | | | | | | | | | | | | | | | Should set "number of frames" to bytes 24-27 of IVF header, not duration. It is described by [1], and confirmed by parsing all IVF files in [2]. This commit also updates the md5sum of refs to pass fate-cbs. [1] Duck IVF - MultimediaWiki https://wiki.multimedia.cx/index.php/Duck_IVF [2] webm/vp8-test-vectors https://chromium.googlesource.com/webm/vp8-test-vectors Signed-off-by: Jianhui Dai <jianhui.j.dai@intel.com> Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* avformat/evc: Don't cast const away, avoid loopAndreas Rheinhardt2023-07-091-11/+6
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/evcdec: Check that enough data has been readAndreas Rheinhardt2023-07-091-0/+2
| | | | | | | | Fixes potential use of uninitialized values in evc_read_nal_unit_length(). Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavf/dv: stop setting a random video bitrateAnton Khirnov2023-07-071-1/+0
| | | | A real value is determined from the bytestream.
* avformat/evcdec: Avoid nonsense castsAndreas Rheinhardt2023-07-071-3/+3
| | | | | | | | | | | | | For uint8_t buf[EVC_NALU_LENGTH_PREFIX_SIZE], &buf still points to the beginning of buf, but it is of type "pointer to array of EVC_NALU_LENGTH_PREFIX_SIZE uint8_t" (i.e. pointer arithmetic would operate on blocks of size EVC_NALU_LENGTH_PREFIX_SIZE). This is of course a different type than uint8_t*, which is why there have been casts in evc_read_packet(). But these are unnecessary if one justs removes the unnecessary address-of operator. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/asfdec_f: fix need_parsing flag for codec mpeg4Zhao Zhili2023-07-041-1/+1
| | | | | | AVSTREAM_PARSE_FULL_ONCE is only implemented for H.264. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/asfdec_f: support bmp_tags_unofficialZhao Zhili2023-07-041-0/+4
| | | | Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/http: copy only mime type from Content-TypeKacper Michajłow2023-06-291-1/+1
| | | | | | | | | Content-Type can include charset and boundary which is not a part of mime type and shouldn't be copied as such. Fixes HLS playback when the Content-Type includes additional fields. Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
* avformat/ac4dec: Constify demuxerAndreas Rheinhardt2023-06-291-1/+1
| | | | | | | The discrepancy between the definition and the declaration in allformats.c is actually UB. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/version: bump minor after recent additionsJames Almer2023-06-291-1/+1
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/rawenc: add H266/VVC muxerThomas Siedel2023-06-293-0/+25
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: add demuxer and probe support for H266/VVCThomas Siedel2023-06-294-2/+68
| | | | | | | Add demuxer to probe raw vvc and parse vvcc byte stream format. Co-authored-by: Nuo Mi <nuomi2021@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>