Commit Graph

109801 Commits

Author SHA1 Message Date
James Almer
b37795688a avfilter/vf_showinfo: use av_frame_side_data_name() to print side data names
This ensures all defined types are supported, even if only to report
their presence and print their size if a custom implementation is
not added.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-01-13 18:30:51 -03:00
Jan Ekström
5de565107a avcodec/h2645_sei: add support for Ambient Viewing Environment SEI
Defined by H.274, this SEI message is utilized by iPhones to save
the nominal ambient viewing environment for the display of recorded
HDR content. The contents of the message are exposed to API users
as AVFrame side data containing AVAmbientViewingEnvironment.

As the DV RPU test sample is from an iPhone and includes Ambient
Viewing Environment SEI messages, its test result gets updated.
2023-01-13 21:26:27 +02:00
Jan Ekström
be76a9bd32 ffprobe: expose AVAmbientViewingEnvironment side data in AVFrames 2023-01-13 21:26:27 +02:00
Jan Ekström
002d0ec740 avutil: introduce AVAmbientViewingEnvironment side data
This enables exposing H.274 Ambient Viewing Environment
metadata in the framework.
2023-01-13 21:26:13 +02:00
Jan Ekström
f4bebc0c34 avcodec/cbs_{h2645,sei}: add support for Ambient Viewing Environment SEI
Defined by H.274, this SEI message is utilized by iPhones to save
the nominal ambient viewing environment for the display of recorded
HDR content.
2023-01-13 20:53:02 +02:00
rcombs
d3538dd293 lavf/spdifdec: support EAC3
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.
2023-01-13 11:22:59 -06:00
Basel Sayeh
6161eacc74 libavformat/dashenc: Enable HTTP persistent connections for dashenc_delete_file
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>
2023-01-13 14:02:33 +08:00
Basel Sayeh
77ad210fba libavformat/hlsenc: Enable HTTP persistent connections for hls_delete_file
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>
2023-01-13 14:01:02 +08:00
Vignesh Venkatasubramanian
54c488223b avformat/movenc: Add loop parameter to animated AVIF
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] 4d2776a3af

Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-01-13 20:03:36 +08:00
Vignesh Venkatasubramanian
f2b1750871 avformat/movenc: Add movie_timescale option to AVIF
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>
2023-01-13 20:03:28 +08:00
Michael Niedermayer
8e58d20e10
avcodec/bonk: Check ntaps against buffer size
Fixes: out of array read
Fixes: 48567/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_BONK_fuzzer-6739246658748416

Note: This issue was assigned to a unrelated theora bug

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-01-12 15:44:41 +01:00
Michael Niedermayer
977028f9f4
avcodec/bonk: Avoid undefined overflow in quant
Fixes: signed integer overflow: -2889074 * 2048 cannot be represented in type 'int'
Fixes: 51363/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_BONK_fuzzer-5660734784143360
Fixes: 48567/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_BONK_fuzzer-6617680050520064
Fixes: 48567/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_BONK_fuzzer-6743951854141440

No check is done for the overflow as this was rejected in last review, see the ML

Note: the 2nd and 3rd testcase was assigned by ossfuzz to a unrelated theora issue (48567)

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-01-12 15:44:41 +01:00
Michael Niedermayer
9f0602a717
avcodec/sgidec: do not forget the number of components in read_uncompressed_sgi()
Fixes: out of array access
Fixes: 48567/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SGI_fuzzer-6704753329700864
Fixes: 48567/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SGI_fuzzer-6683986844057600
Fixes: 48567/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SGI_fuzzer-6697387691474944

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>
2023-01-12 15:29:03 +01:00
Paul B Mahol
fc263f073e avformat/nsvdec: add support for STARDIVA format 2023-01-12 10:44:16 +01:00
Zhao Zhili
e30bf5acee avformat/file: add S_IFBLK/S_ISBLK compatability macro
They are not available on Windows.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-01-12 20:52:37 +08:00
Michael Niedermayer
379e43e6ec
avcodec/h274: fix include
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-01-11 12:12:27 +01:00
Michael Niedermayer
685c0cfd32
avcodec/h264_slice: Use unsigned for fgs seed computation
Fixes: signed integer overflow: 2147481600 + 13408 cannot be represented in type 'int'
Fixes: 53963/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-4650467311616000

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-01-11 12:12:27 +01:00
Michael Niedermayer
9ea2c79631
avcodec/tiff: Prettify code in dng_blit()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-01-11 12:12:26 +01:00
Michael Niedermayer
44f45711cc
avcodec/tiff: Check camera_calibration for 0
Fixes: division by 0
Fixes: 53926/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5680347889401856

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-01-11 12:12:26 +01:00
Michael Niedermayer
1b59de3770
avcodec/scpr: Test bx before use
Fixes: out of array access on 32bit
Fixes: 54850/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SCPR_fuzzer-5302669294305280

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-01-11 12:12:26 +01:00
Michael Niedermayer
50c0f2ddd3
avcodec/mvha: Check input size for HUFY before picture allocation
Fixes: Timeout
Fixes: 54772/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MVHA_fuzzer-5484199677394944

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-01-11 12:12:25 +01:00
Michael Niedermayer
2f48d227c1
avcodec/eac3dec: avoid float noise in fixed mode addition to overflow
Fixes: 2.28595e+09 is outside the range of representable values of type 'int'
Fixes: 54644/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AC3_FIXED_fuzzer-4816961584627712

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-01-11 12:12:25 +01:00
Zhao Zhili
9ea6d93218 avcodec/mediacodecdec: check ff_Build_SDK_INT return value
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-01-11 18:58:21 +08:00
Zhao Zhili
8586540ad1 avcodec/mediacodec_wrapper: get api level via NDK method
android_get_device_api_level() is a static inline before API level
29. It was implemented via __system_property_get(). We can do the
same thing, but I don't want to mess up with __system_property_get.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-01-11 18:58:14 +08:00
Zhao Zhili
8f35ee8240 avcodec/videotoolboxenc: fix error code
1. Fix return 0 on error.
2. Fix return OS error code passthrough.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-01-11 18:57:44 +08:00
Zhao Zhili
e7aca339ce avutil/hwcontext_videotoolbox: BGRA should be full range
HEVC alpha layer encoding is broken without the patch.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-01-11 18:57:20 +08:00
Zhao Zhili
0ef85a5471 avcodec/videotoolboxenc: pass error code through
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-01-11 18:57:20 +08:00
Zhao Zhili
5ab429d8df avcodec/videotoolboxenc: log when get_cv_pixel_format failed
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-01-11 18:57:20 +08:00
Zhao Zhili
52eb2396d7 fftools/ffmpeg_demux: prefer fd over pipe for seek support
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-01-11 18:50:36 +08:00
Zhao Zhili
244f3cfbe3 fftools/ffprobe: prefer fd over pipe for seek support
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-01-11 18:50:36 +08:00
Zhao Zhili
c926140558 fftools/ffplay: prefer fd over pipe for seek support
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-01-11 18:50:36 +08:00
Zhao Zhili
195ccf7ea8 fftools/ffmpeg_demux: disable stdin interaction for fd protocol
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-01-11 18:50:36 +08:00
Zhao Zhili
6e7c006e40 avformat/file: add fd protocol
Unlike the pipe protocol, fd protocol has seek support if it
corresponding to a regular file.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-01-11 18:50:36 +08:00
Zhao Zhili
e9fe1634d4 avformat/file: dup file descriptor for pipe
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-01-11 18:50:36 +08:00
Zhao Zhili
8d91a8faab avformat/file: reindent after the previous commit
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-01-11 18:50:36 +08:00
Zhao Zhili
49b8f043ca avformat/file: add fd option for pipe
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-01-11 18:50:36 +08:00
Lukas Rusak
0d7c452d84 avcodec/v4l2m2m: allow lower minimum buffer values
There is no reason to enforce a high minimum. In the context
of streaming only a few output buffers and capture buffers
are even needed for continuous playback. This also helps
alleviate memory pressure when decoding 4K media.

Signed-off-by: Aman Karmani <aman@tmm1.net>
2023-01-10 14:49:53 -08:00
Aman Karmani
18d9959fd9 avcodec/v4l2_m2m: log both v4l2 and av pixel formats during negotiation
Signed-off-by: Aman Karmani <aman@tmm1.net>
2023-01-10 14:47:24 -08:00
James Almer
0431f9805e avcodec/av1_parser: export timing information when present
Signed-off-by: James Almer <jamrial@gmail.com>
2023-01-10 09:08:09 -03:00
Anton Khirnov
54c0e72b42 lavfi/graphparser: drop a redundant label 2023-01-10 11:52:02 +01:00
Anton Khirnov
ca67a783ab lavfi/graphparser: improve applying graph-level sws options
The current code will apply them if the options string does not contain
a 'flags' substring, and will do so by appending the graph-level option
string to the filter option string (with the standard ':' separator).
This is flawed in at least the following ways:
- naive substring matching without actually parsing the options string
  may lead to false positives (e.g. flags are specified by shorthand)
  and false negatives (e.g. the 'flags' substring is not actually the
  option name)
- graph-level sws options are not limited to flags, but may set
  arbitrary sws options

This commit simply applies the graph-level options with
av_set_options_string() and lets them be overridden as desired by the
user-specified filter options (if any). This is also shorter and avoids
extra string handling.
2023-01-10 11:52:02 +01:00
Anton Khirnov
1c18530e93 lavfi/avfilter: process options for filters without a private class
It still makes sense to apply AVFilterContext-level options to such
filters.
2023-01-10 11:52:02 +01:00
Anton Khirnov
d234b4b193 lavfi/avfilter: simplify process_options()
This function currently treats AVFilterContext options and
filter-private options differently: the former are immediately applied,
while the latter are stored in a dictionary to be applied later.

There is no good reason for having two branches - storing all options in
the dictionary is simpler and achieves the same effect (since it is
later applied with av_opt_set_dict()).

This will also be useful in future commits.
2023-01-10 11:52:02 +01:00
Anton Khirnov
b6ba764552 lavfi/avfilter: export a multikey dict from process_options()
This way the function does not need to be able to match keys to
AVOptions, which will be useful in future commits.
2023-01-10 11:52:02 +01:00
Anton Khirnov
bd7c07c26a lavfi/avfilter: avoid a redundant av_opt_set_dict2() call
Current code first sets AVFilterContext-level options, then aplies the
leftover on the filter's private data. This is unnecessary, applying the
options to AVFilterContext with the AV_OPT_SEARCH_CHILDREN flag
accomplishes the same effect.
2023-01-10 11:52:02 +01:00
Anton Khirnov
a7b1b4bc23 lavfi: remove AVFilter.init_dict()
Nothing uses it anymore.

All options on all filters can now be set with normal AVOptions
mechanisms, such as av_opt_set*().
2023-01-10 11:52:02 +01:00
Anton Khirnov
018a8b9dc3 lavfi/vf_scale: allow passing options to swscale directly
Avoid using the dictionary mechanism, which is non-introspectable. As
this is the only user of AVFilter.init_dict(), this callback can now be
removed.
2023-01-10 11:52:02 +01:00
Anton Khirnov
260f391893 fftools/ffmpeg: always generate CFR output when -r is used
Current code may, depending on the muxer, decide to use VSYNC_VFR tagged
with the specified framerate, without actually performing framerate
conversion. This is clearly wrong and against the documentation, which
states unambiguously that -r should produce CFR output for video
encoding.

FATE test changes:
* nuv-rtjpeg: replace -r with '-enc_time_base -1', which keeps the
  original timebase. Output frames are now produced with proper
  durations.
* filter-mpdecimate: just drop the -r option, it is unnecessary
* filter-fps-r: remove, this test makes no sense and actually
  produces broken VFR output (with incorrect frame durations).
2023-01-10 11:49:28 +01:00
Anton Khirnov
e884360e91 doc/ffmpeg: improve -r documentation
Explain different behavior for encoding and streamcopy.
2023-01-10 11:49:28 +01:00
Anton Khirnov
7655249f72 fftools/ffmpeg: reindent after previous commit 2023-01-10 11:49:28 +01:00