Commit Graph

25334 Commits

Author SHA1 Message Date
Stephen Hutchinson
1e36e1f258 avisynth: pass audio channel layout
Signed-off-by: Stephen Hutchinson <qyot27@gmail.com>
2023-07-19 19:33:20 -04:00
Zhao Zhili
be7ac511a6 avformat/mov: avss box should be AV_CODEC_ID_CAVS
I cannot find the spec, but according to the original commit
d4fdba0df7, it's CAVS. e571305a71 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>
2023-07-19 22:43:33 +08:00
Steven Liu
2cd09fec9f avformat/flvdec: support demux vp9 in enhanced flv
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>
2023-07-18 09:46:37 +08:00
Steven Liu
0693a2a86e avformat/flvenc: support mux vp9 in enhanced flv
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>
2023-07-18 09:46:29 +08:00
Steven Liu
23b02557e9 avformat/flvdec: support demux av1 in enhanced flv
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>
2023-07-18 09:46:22 +08:00
Steven Liu
7a5e9a68b0 avformat/flvenc: support mux av1 in enhanced flv
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>
2023-07-18 09:46:16 +08:00
Steven Liu
ac5cc66f9e avformat/flvdec: support demux hevc in enhanced flv
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>
2023-07-18 09:46:06 +08:00
Steven Liu
aa83654d94 avformat/flvenc: support mux hevc in enhanced flv
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>
2023-07-18 09:45:57 +08:00
Marton Balint
36f4e6f8f4 avformat/hlsenc: use av_random_bytes() for generating AES128 key
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>
2023-07-16 11:48:31 +02:00
Dai, Jianhui J
3b358f151d avformat/ivfenc: Set the "number of frames" in IVF header
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>
2023-07-09 16:56:58 -04:00
Andreas Rheinhardt
e52676e20b avformat/evc: Don't cast const away, avoid loop
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-07-09 03:05:00 +02:00
Andreas Rheinhardt
e5ab2dab2c avformat/evcdec: Check that enough data has been read
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>
2023-07-09 02:40:14 +02:00
Anton Khirnov
ac616afa62 lavf/dv: stop setting a random video bitrate
A real value is determined from the bytestream.
2023-07-07 12:13:05 +02:00
Andreas Rheinhardt
83c0f7b046 avformat/evcdec: Avoid nonsense casts
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>
2023-07-07 03:47:29 +02:00
Zhao Zhili
d4b989c94d avformat/asfdec_f: fix need_parsing flag for codec mpeg4
AVSTREAM_PARSE_FULL_ONCE is only implemented for H.264.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-07-04 04:49:48 +08:00
Zhao Zhili
3eb7968ed9 avformat/asfdec_f: support bmp_tags_unofficial
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-07-04 04:49:48 +08:00
Kacper Michajłow
0cd2e7dcfb
avformat/http: copy only mime type from Content-Type
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>
2023-06-29 17:28:46 -04:00
Andreas Rheinhardt
f780e07149 avformat/ac4dec: Constify demuxer
The discrepancy between the definition and the declaration
in allformats.c is actually UB.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-06-29 20:22:58 +02:00
James Almer
05186be641 avformat/version: bump minor after recent additions
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-29 14:12:50 -03:00
Thomas Siedel
45a8a62df9 avformat/rawenc: add H266/VVC muxer
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-29 14:12:50 -03:00
Thomas Siedel
ac2b25f4e5 avformat: add demuxer and probe support for H266/VVC
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>
2023-06-29 14:12:50 -03:00
James Almer
6ff95758e6 avformat/evc: use get_ue_golomb_long()
This partially reverts commit d0fc1b3507, which reintroduced a regression
originally fixed in 5e9986fd2d.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-27 12:52:38 -03:00
Zhao Zhili
af3f120785 avformat/mov: fix overallocation when reading pssh/saiz
mov_try_read_block() allocates 1MB at least, which can be more than
enough. It was called when reading saiz box, which can appear
periodically inside fmp4. This consumes a lot of memory.

We can fix mov_try_read_block() by clamp 'block_size' with 'size'.
However, the function is harmful than helpful. It avoids allocating
large memory when the real data is small. Even in that case, if
allocating large memory directly failed, it's fine to return ENOMEM;
if allocating success and reading doesn't match the given size, it's
fine to free and return AVERROR_INVALIDDATA. In other cases, it's a
waste of CPU and memory.

So I decided to remove the function, and replace it by call
av_malloc() and avio_read() directly.

mov_read_saiz() and mov_read_pssh() need more check, but they don't
belong to this patch.

Fixes #7641 and #9243.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-06-24 12:58:15 +08:00
James Almer
528dd5637d avformat/evc: remove duplicate defines
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-23 08:37:23 -03:00
James Almer
3d1199dff6 avformat/evc: add range checks to evcc_parse_sps and return proper error codes
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-23 08:37:23 -03:00
James Almer
552879d621 avformat/evc: remove duplicate check
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-23 08:37:23 -03:00
James Almer
d0fc1b3507 avformat/evc: remove unnecessary struct
And don't use get_ue_golomb_long() for known small values.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-23 08:37:23 -03:00
James Almer
25ce1c8333 avformat/id3v2: check the return value of avio_close_dyn_buf()
Fixes ticket #10424.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-22 21:00:15 -03:00
James Almer
c7183a22db avformat/evc: move NALU length and type parsing functions to a header
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-21 13:31:14 -03:00
James Almer
d0d20f16ce avformat/evcdec: use an unsigned type for nalu_size
But ensure the value returned by evc_read_nal_unit_length() fits in an int.
Should prevent integer overflows later in the code.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-21 13:31:14 -03:00
James Almer
a6a5e53595 avformat/evcdec: flush the bsf on EOF
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-21 13:31:14 -03:00
James Almer
43ace56c7e avformat/evcdec: remove unnecessary av_packet_unref() calls
And return proper error codes.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-21 13:31:14 -03:00
James Almer
2276bcc52a avformat/evcdec: ensure there are enough bytes to seekback
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-21 13:31:14 -03:00
Romain Beauxis
468615f204 libavformat/mpegts.c: fix hardcoded 5-bytes skip for metadata streams.
Before the introduction of AV_CODEC_ID_TIMED_ID3 for timed_id3 metadata streams
in mpegts (commit 4a4437c0fb), AV_CODEC_ID_SMPTE_KLV
was the only existing codec for metadata.

It seems that this codec has a 5-bytes metadata header[1] that, for some reason,
was always skipped when decoding data packets.

However, when working with a AV_CODEC_ID_TIMED_ID3 streams, this results in the
5 first bytes of the payload being cut-off, which includes essential informations
such as the ID3 tag version.

This patch fixes the issue by keeping the 5-bytes skip only for AV_CODEC_ID_SMPTE_KLV
streams.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-20 21:08:06 -03:00
Michael Niedermayer
6a9d13acc2
avformat/jpegxl_anim_dec: fix out of array read using buffer padding
Fixes: out of array read
Fixes: 59828/clusterfuzz-testcase-minimized-ffmpeg_dem_JPEGXL_ANIM_fuzzer-5029813220671488

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-06-20 12:47:31 -04:00
James Almer
3f48815501 avformat/evcdec: don't set AVCodecParameters.framerate
It's not necessary. Setting AVStream.avg_frame_rate is enough.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-20 11:35:21 -03:00
James Almer
5a2ff43384 avformat/evcdec: simplify au_end_found check
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-20 11:35:21 -03:00
James Almer
ca8a660176 avformat/evcdec: simplify probe function
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-20 11:35:21 -03:00
Andreas Rheinhardt
43991dbd05 avformat/assenc: Fix potential NULL + 1
Incrementing a NULL pointer is undefined behaviour,
yet this is what would happen in case trailer were NULL
before the check.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-06-20 16:15:08 +02:00
Tomas Härdin
4cc40c050a lavc/riffenc: Fix msrle support on Windows 95 2023-06-20 14:35:35 +02:00
Paul B Mahol
2cac3fd744 avformat: add raw AC-4 muxer 2023-06-20 12:47:00 +02:00
Yeoh, Hoong Tee
da4b2549c6 lavf/rtpenc_jpeg: Retrieve sampling factor from SOF0
In ff_rtp_send_jpeg, the type is defined based on PIX_FMT and
color-range parsed in. There is limitation on current design
where need to include support newly introduced PIX_FMT such as
AV_PIX_FMT_QSV and there might be more and more in future. Hence,
retrive the sampling factor from SOF0 in JPEG compressed header
directly. This introduces flexibility to handle different type of
new codec introduced in future.

Signed-off-by: Yeoh, Hoong Tee <hoong.tee.yeoh@intel.com>
2023-06-20 09:52:43 +08:00
Aman Karmani
961b17eace avformat/mpegts: add AC-4 2023-06-20 01:13:38 +02:00
Paul B Mahol
293e353460 avformat/isom_tags: add AC-4 2023-06-20 01:13:38 +02:00
Paul B Mahol
9c6538d4c2 avformat: add raw AC-4 demuxer 2023-06-20 01:13:38 +02:00
James Almer
17499f43b1 avformat/evc: remove unused variable
And check the correct one. Should fix use of uninitialized value warnings.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-19 17:34:15 -03:00
James Almer
e81eafcb97 avformat/evc: skip nalu header size bytes before parsing sps
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-19 17:21:19 -03:00
James Almer
048b8bdd5e avformat/evc: use get_bits_long() where needed
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-19 17:21:19 -03:00
James Almer
5e9986fd2d avformat/evc: use get_ue_golomb_long()
Fixes compilation of shared libraries, as well as correctly parses
width and height values.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-18 23:40:46 -03:00
Michael Niedermayer
9fc141f32d
avformat/jpegxl_anim_dec: Perform operations in a different order
Fixes: OOM
Fixes: 59802/clusterfuzz-testcase-minimized-ffmpeg_dem_JPEGXL_ANIM_fuzzer-5681765466112000

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-06-18 17:54:19 -04:00