1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-18 03:19:31 +02:00
Commit Graph

110071 Commits

Author SHA1 Message Date
James Almer
0d35634eaa avcodec/libdav1d: Fix unintended fallthrough
Based on a patch by Andreas Rheinhardt

Signed-off-by: James Almer <jamrial@gmail.com>
2023-03-15 12:42:43 -03:00
Zhao Zhili
9e1ffeda8c fate/mov: add PCM in mp4 test
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-03-15 00:12:59 +08:00
Zhao Zhili
d4ee177a36 avformat/movenc: add PCM in mp4 support
It's defined by ISO/IEC 23003-5.

Fixes ticket #10185

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-03-15 00:12:59 +08:00
Zhao Zhili
d7e864366b avformat/mov: parse ISO-14496-12 ChannelLayout
Only support chnl version 0 now.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-03-15 00:12:59 +08:00
Zhao Zhili
a3dc677b9f avformat/isom_tags: remove ipcm from movaudio_tags
ipcm is defined by ISO/IEC 23003-5, not defined by quicktime. After
adding ISO/IEC 23003-5 support, we don't need it for ticket #9219.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-03-15 00:12:59 +08:00
Zhao Zhili
d04dbf48fc avformat/mov: fix ISO/IEC 23003-5 support
Missing floating-point formats support.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-03-15 00:12:59 +08:00
Andreas Rheinhardt
a6e9d01f88 avcodec/libx264: Use av_pix_fmt_count_planes() where appropriate
This also fixes the number of planes for the NV formats
(this seems to not have caused any problems).

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-03-14 07:17:05 +01:00
Andreas Rheinhardt
19e35edaf1 avcodec/libx264: Use dedicated pointer for accesses
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-03-14 07:16:58 +01:00
Andreas Rheinhardt
df53d7a194 avcodec/libx264: Pass x264_picture_t* directly
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-03-14 07:16:54 +01:00
Andreas Rheinhardt
f456c192d9 avcodec/libx264: Fix leak in case of allocation failure
Fixes Coverity issue #1518906.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-03-14 07:16:51 +01:00
Andreas Rheinhardt
2732d0507c avfilter/vf_ssim360: Remove dead code
Fixes Coverity issue #1520669.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-03-14 07:16:45 +01:00
Andreas Rheinhardt
1091963d38 avfilter/vf_ssim360: Use correct type in sizeof
SSIM360Context.ssim360_hist is an array of four pointers to double;
so sizeof(*ssim360_hist[0]) (=sizeof(double)) is the correct size
to use to calculate the amount of memory to allocate, not
sizeof(*ssim360_hist) (which is sizeof(double*)).

Use FF_ALLOCZ_TYPED_ARRAY to avoid this issue altogether.

Fixes Coverity issue #1520671.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-03-14 07:16:06 +01:00
Andreas Rheinhardt
4175022bdb avcodec/libvpxdec: Constify VP9-decoder
Possible since 8d226fb978.

Reviewed-by: James Zern <jzern-at-google.com@ffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-03-13 23:36:53 +01:00
Andreas Rheinhardt
430dcd52b6 avcodec/libopencore-amr: Use frame_number instead of frame_num
Forgotten in 6b6f7db819.

Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-03-13 23:36:53 +01:00
Andreas Rheinhardt
7f825d3335 avcodec/libxavs: Use frame_num instead of frame_number
Forgotten in 6b6f7db819.

Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-03-13 23:36:53 +01:00
Jan Ekström
fba9d9609f avcodec/libsvtav1: use larger of bit rate and max rate for buffer size
Generally if maxrate is set, the calculation should be maxrate over
bufsize. This additionally enables CRF + maxrate & bufsize usage.

In order to keep negative values from enabling zero to be treated
as larger and causing a division by zero, check that one of the
variables is larger than zero.
2023-03-14 00:14:52 +02:00
Niklas Haas
1231003c3c avfilter/vf_libplacebo: remove deprecated field
This has not been functional since a year ago, including in our current
minimum dependency of libplacebo (v4.192.0). It also causes build errors
against libplacebo v6, so it needs to be removed from the code. We can
keep the option around for now, but it should also be removed soon.

Signed-off-by: Niklas Haas <git@haasn.dev>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-03-13 11:30:58 -03:00
Niklas Haas
11eca6018c avfilter/vf_libplacebo: wrap deprecated opts in FF_API define
Signed-off-by: Niklas Haas <git@haasn.dev>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-03-13 11:30:58 -03:00
Michael Niedermayer
7c130d6911
avcodec/mpeg12dec: Check input size
Fixes: Timeout
Fixes: 53599/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IPU_fuzzer-4950102511058944

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-03-12 22:33:13 +01:00
Michael Niedermayer
f669dd4dff
avcodec/escape124: Simplify unpack_codebook()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-03-12 22:33:12 +01:00
Michael Niedermayer
98df605f7a
avcodec/escape124: Fix some return codes
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-03-12 22:33:12 +01:00
Michael Niedermayer
87ad0a5dd7
avcodec/escape124: fix signdness of end of input check
Fixes: Timeout
Fixes: 56561/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ESCAPE124_fuzzer-5560363635834880

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-03-12 22:33:12 +01:00
James Almer
8e5e578453 avocdec/Makefile: add missing dependencies to av1 and libdav1d decoders
Missed in d6d5765051 and b465e6fed0
Respectively.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-03-12 16:31:54 -03:00
Stefano Sabatini
cd0d267b92 doc/examples/mux: rename alloc_picture to alloc_frame
The new name is consistent with the updated API.
2023-03-12 16:45:05 +01:00
Stefano Sabatini
dcf963f490 lavc/avcodec.h: extend documentation for avcodec_open2()
In particular, clarify how to set options in the codec context, and
mention when to use avcodec_parameters_to_context().

Fix trac issues:
http://trac.ffmpeg.org/ticket/5781
http://trac.ffmpeg.org/ticket/5838
2023-03-12 16:45:00 +01:00
James Almer
358588c820 Revert "avfilter/stack_internal: add missing header includes"
This reverts commit 205117d87f.

This didn't fix make checkheaders after all, and also broke compilation in some
scenarios.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-03-11 10:05:47 -03:00
Anton Khirnov
a3bf63c26e lavc/decode: stop mangling last_pkt_props->opaque
It is currently abused to store packet size, which breaks
AV_CODEC_FLAG_COPY_OPAQUE.

Use stream_index instead, which is unused in libavcodec and has the
same type as size.

Found-by: Martin Storsjö
2023-03-11 11:37:48 +01:00
James Almer
205117d87f avfilter/stack_internal: add missing header includes
Fixes make checkheaders

Signed-off-by: James Almer <jamrial@gmail.com>
2023-03-10 16:27:05 -03:00
James Almer
e60cd2e98b fate/vpx: add a vp9_superframe_bsf test
This splits a sample and merges it again, so it also tests the vp9_superframe_split bsf

Signed-off-by: James Almer <jamrial@gmail.com>
2023-03-10 16:27:05 -03:00
James Almer
68a858fcc9 avcodec/av1dec: make CBS parse only the OBU types we care about
Signed-off-by: James Almer <jamrial@gmail.com>
2023-03-10 16:27:05 -03:00
James Almer
d6d5765051 avcodec/av1dec: parse and export Metadata OBUs
This includes Mastering Display, Content light level, and some ITU-T T35
metadata like closed captions and HDR10+.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-03-10 16:27:05 -03:00
Timo Rothenpieler
7a8560cb22 avcodec/nvenc: avoid failing b_ref_mode check when unset 2023-03-10 13:17:21 +01:00
Anton Khirnov
fefcba1c1b lavfi/graphparser: use correct logging context 2023-03-10 13:04:25 +01:00
Anton Khirnov
ae95c87e64 lavc/libvpxenc: drop FrameListData.duration
It is write-only.
2023-03-10 13:00:53 +01:00
Anton Khirnov
942fb48c38 lavc/libvpxenc: handle queue desync more gracefully
If the packets returned by libvpx and our internal frame properties
queue get desynchronized for some reason (should not happen, but it is
not clear libvpx API guarantees this), we will keep adding to the queue
indefinitely and never remove anything.

Change the code to drain the queue even if timestamps do not match.
2023-03-10 13:00:53 +01:00
Anton Khirnov
62a241e505 lavc/libvpxenc: drop a useless condition
A non-NULL packet is always passed to frame_data_apply().
2023-03-10 13:00:53 +01:00
Anton Khirnov
5bda4ec6c3 lavc/libvpxenc: handle frame durations and AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE 2023-03-10 13:00:53 +01:00
Anton Khirnov
7141a37e2f lavc/libvpxenc: rename hdr10_plus_fifo and related objects
This AVFifo is used to propagate HDR metadata from input frames to
output packets, since libvpx does not allow passing through arbitrary
user data.

It will be extended to pass through other kinds of data in future
commits, so give it a more generic name.
2023-03-10 13:00:53 +01:00
Anton Khirnov
31fc61fb0c lavc/libvpxenc: reindent 2023-03-10 13:00:53 +01:00
Anton Khirnov
f367aa5db6 lavc/libvpxenc: drop frame_number
It is not used, except to check whether the packet is valid before
writing HDR metadata to the packet in storeframe(). However, that check
serves no purpose, as the encoded packet is already treated as valid
higher up in this function.
2023-03-10 13:00:53 +01:00
Anton Khirnov
d732db3a38 lavu/frame: improve AVFrame.opaque[_ref] documentation
Make them match each other, mention interaction with
AV_CODEC_FLAG_COPY_OPAQUE.
2023-03-10 13:00:53 +01:00
Wang Yaqiang
81bc7bc52e avformat/img2dec: fix unable to find svg format when the svg resources start with "<svg" or "<!--"
svg is xml, but <?xml is not required,
it can start with <svg and can have multiple empty lines,
or start with <!-- include some comments,
but must first line if start with <?xml.

Signed-off-by: Wang Yaqiang <wangyaqiang03@kuaishou.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2023-03-09 21:17:15 +01:00
asivery
1a4560ce4e avformat/aea: make the AEA demuxer return EOF at the end of file instead of EIO
Signed-off-by: asivery <asivery@protonmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2023-03-09 21:17:15 +01:00
Devin Heitmueller
aca7ef78cc avdevice/decklink_enc: fix unused variable compiler warnings
Due to refactoring, the ctx/cctx variables are never actually used
in ff_decklink_write_packet(), so just remove them.

Signed-off-by: Devin Heitmueller <dheitmueller@ltnglobal.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2023-03-08 23:53:26 +01:00
Devin Heitmueller
25d09ac0eb avdevice/decklink_enc: fix setting of last_pts to only be set for video
The ff_decklink_write_packet() was always caching the last pts
received, to be used when calling StopScheduledPlayback(). However
because audio and video are on different timebases and the call to
StopScheduledPlayback() expects the video timebase, we'll end up
sending a weird value to the stop routine if the last packet
received contained audio.

Move the setting of last_pts to just be for the video stream.

Signed-off-by: Devin Heitmueller <dheitmueller@ltnglobal.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2023-03-08 23:53:19 +01:00
Devin Heitmueller
8fd345f018 avdevice/decklink_enc: don't take for granted that first frame to decklink output will be PTS 0
The existing code assumed that the first frame received by the decklink
output would always be PTS zero.  However if running in other timing
modes than the default of CBR, items such as frame dropping at the
beginning may result in starting at a non-zero PTS.

For example, in our setup because we discard probing data and run
with "-vsync 2" the first video frame scheduled to the decklink
output will have a PTS around 170.  Scheduling frames too far into
the future will either fail or cause a backlog of frames scheduled
far enough into the future that the entire pipeline will stall.

Issue can be reproduced with the following command-line:

./ffmpeg -copyts -i foo.ts -f decklink -vcodec v210 -ac 2  'DeckLink Duo (4)'

Keep track of the PTS of the first frame received, so that when
we enable start playback we can provide that value to the decklink
driver.

Thanks to Marton Balint for review and suggestion to use
AV_NOPTS_VALUE rather than zero for the initial value.

Signed-off-by: Devin Heitmueller <dheitmueller@ltnglobal.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2023-03-08 23:53:15 +01:00
Michael J. Walsh
6f1c006959 avformat/http: cookie path attribute should be optional not compulsory
The path attribute in the Set-Cookie header is optional but treated by ffmpeg as being compulsory.

Signed-off-by: Michael J. Walsh <mjfwalsh@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2023-03-08 23:40:58 +01:00
jackarain
4e3916dbce avformat/tls: check for memory allocation failure when setting options
Signed-off-by: jackarain <jack.wgm@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2023-03-08 23:19:15 +01:00
jackarain
05ea0457fc avformat/udp: check for memory allocation failure when setting localaddr
Signed-off-by: jackarain <jack.wgm@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2023-03-08 23:14:09 +01:00
rcombs
f758d4fcb9 lavf/matroska: add support for ARIB captions 2023-03-08 14:57:54 -06:00