Commit Graph

105262 Commits

Author SHA1 Message Date
Anton Khirnov
be97d2a825 lavf: add a flag for experimental (de)muxers 2022-01-03 20:38:35 +01:00
Yu Yang
5e2a1f1e7d libavcodec/pthread_frame: remove duplicate pointers
'*src' and '*avctx' point to the same memory. It is enough to keep one of them.

Signed-off-by: Yu Yang <yuyang14@kuaishou.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2022-01-03 20:34:45 +01:00
Andreas Rheinhardt
064ab95cc7 configure: Make IMF demuxer require MXF demuxer
The former is useless without the latter.

Reviewed-by: Zane van Iperen <zane@zanevaniperen.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-03 16:21:41 +01:00
James Almer
a670cad2c4 fate/libswcale: add missing samples dependency to sws-slice tests
Signed-off-by: James Almer <jamrial@gmail.com>
2022-01-03 09:42:38 -03:00
Wu Jianhua
68d0a7e446 avfilter/vf_scale_vulkan: align struct ScaleVulkanContext
On 64 bit Operating System, sizeof(ScaleVulkanContext):
    reduce from 2400 to 2392 on Linux
    reduce from 2416 to 2408 on Windows

Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
2022-01-03 03:17:43 +01:00
Wu Jianhua
c7c37a8f22 transpose_vulkan: add passthrough option
The following command is on how to apply passthrough option:

ffmpeg -init_hw_device vulkan -i input.264 -vf hwupload=extra_hw_frames=16,transpose_vulkan=passthrough=landscape,hwdownload,format=yuv420p output.264

Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
2022-01-03 03:17:43 +01:00
Lynne
b84ce56589 hwcontext_vulkan: remove VK_EXT_hdr_metadata from autoloaded extensions list
We don't use it. Was copied from libplacebo's recommended defaults.
Creates problems with validation on Intel devices, where the driver
still advertizes it, even though it's not usable without a swapchain.
2022-01-03 03:16:45 +01:00
Michael Niedermayer
d6b2357edd avcodec/speexdec: Consider mode in frame size check
No speex samples with non default frame sizes are known (to me)
the official speexenc seems to only generate the 3 default ones.
Thus it may be that the fuzzer samples where the first non default
values encountered by the decoder.
Possibly the "<" should be "!="

Fixes: out of array access
Fixes: 42821/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SPEEX_fuzzer-5640695772217344

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-01-01 19:30:04 +01:00
Zhao Zhili
c417616762 lavc/{av1, h264, h265}_metadata_bsf: fix description of tick_rate
Users may take the description literally which leads to inverted
results.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Jun Zhao <barryjzhao@tencent.com
2022-01-01 10:43:17 +08:00
James Almer
0154f142f3 avformat/Makefile: add imf.h to SKIPHEADERS
Should fix "make checkheaders".

Signed-off-by: James Almer <jamrial@gmail.com>
2021-12-31 19:22:47 -03:00
erankor
6348be83e8 http: make caching of redirect url optional
added "cache_redirect" option to http.
when enabled, requests issued after seek will use the latest redirected
url.
when disabled, each call to seek will revert to the original url that
was sent to http_open.

currently, the default remains 'enabled', until the next major
libavformat bump, where it will change to 'disabled'.
2021-12-31 14:27:00 -05:00
Gyan Doshi
2f6360ff21 configure: bump year 2022-01-01 00:29:41 +05:30
Gyan Doshi
9cfc7a2440 avformat/mov: add option max_stts_delta
Very high stts sample deltas may occasionally be intended but usually
they are written in error or used to store a negative value for dts correction
when treated as signed 32-bit integers.

This option lets the user set an upper limit, beyond which the delta is clamped to 1.
Values greater than the limit if negative when cast to int32 are used to adjust onward dts.

Unit is the track time scale. Default is UINT_MAX - 48000*10 which
allows upto a 10 second dts correction for 48 kHz audio streams while
accommodating 99.9% of uint32 range.

Signed-off-by: Gyan Doshi <ffmpeg@gyani.pro>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
2021-12-31 14:44:20 +05:30
Pierre-Anthony Lemieux
6b7e4de0db
avformat/imf: Tests
Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-12-31 17:26:01 +10:00
Pierre-Anthony Lemieux
73f6cce936
avformat/imf: Demuxer
Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-12-31 17:26:01 +10:00
Limin Wang
d590e211a2 avformat: add bitpacked demuxer
Allows user can playback bitpacked pixel format directly:
ffplay -video_size 1280x720 -pixel_format yuv422p10 test.bitpacked
ffplay -f bitpacked -video_size 1280x720 -pixel_format uyvy422 test.yuv

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-12-31 07:08:43 +08:00
Michael Niedermayer
7cee3b3718 avcodec/apedec: fix integer overflow in 8bit samples
Fixes: signed integer overflow: 2147483542 + 128 cannot be represented in type 'int'
Fixes: 42812/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-6344057861832704

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-12-30 22:20:14 +01:00
Michael Niedermayer
c217ca7718 avformat/flvdec: timestamps cannot use the full int64 range
We do not support this as we multiply by 1000
Fixes: signed integer overflow: -45318575073853696 * 1000 cannot be represented in type 'long'
Fixes: 42804/clusterfuzz-testcase-minimized-ffmpeg_dem_LIVE_FLV_fuzzer-4630325425209344

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-12-30 22:20:14 +01:00
Michael Niedermayer
68f8292aa9 avcodec/targa: Check input size for uncompressed TGA before allocation
Fixes: Timeout
Fixes: 42667/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TARGA_fuzzer-5619236075077632

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-12-30 22:20:14 +01:00
Michael Niedermayer
afdbc940c6 avcodec/tiff: Remove messing with jpeg context
The whole concept is just not correct, also as it seems not to be needed
at all, all dng files i have decode without this.

Fixes: various crashes
Fixes: 42937/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-4625073334517760
Fixes: 42938/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-4643368217477120
Fixes: 42939/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-4925325908246528
Fixes: 42940/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-4925378806808576
Fixes: 42941/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-6202009265504256
Fixes: 42944/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-6076860998483968

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-12-30 22:20:14 +01:00
sfan5
65197e9c98 lavf/tls_mbedtls: fix handling of tls_verify=0
If ca_file was set, setting tls_verify=0 would not actually disable
verification.
2021-12-30 19:32:34 +02:00
sfan5
b32b32ba89 lavc/mediacodecdec: set codec profile and level from extradata for H264+HEVC
This value is later passed to MediaCodec and checked at decoder init.
Notably decoding of 10-bit streams before this commit would "work" without
returning errors but only return garbage output (on most Android devices).
2021-12-30 18:19:53 +02:00
Gyan Doshi
12f21849e5 doc/demuxers: add entry for aac 2021-12-30 17:10:30 +05:30
Cameron Gutman
30322ebe3c avcodec/v4l2_m2m_dec: dequeue frame if input isn't ready
The V4L2M2M API operates asynchronously, so multiple packets can
be enqueued before getting a batch of frames back. Since it was
only possible to receive a frame by submitting another packet,
there wasn't a way to drain those excess output frames from when
avcodec_receive_frame() returned AVERROR(EAGAIN).

Reviewed-by: Andriy Gelman <andriy.gelman@gmail.com>
Signed-off-by: Cameron Gutman <aicommander@gmail.com>
2021-12-28 18:12:47 -05:00
Limin Wang
63d5b6f935 avcodec/libx26[45]: reindent after last commit
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-12-28 14:19:38 +08:00
Limin Wang
7dfc3cc713 avcodec/libx26[45]: add udu_sei option to import user data unregistered SEIs
Most of user data unregistered SEIs are privated data which defined by user/
encoder. currently, the user data unregistered SEIs found in input are forwarded
as side-data to encoders directly, it'll cause the reencoded output including some
useless UDU SEIs.

I prefer to add one option to enable/disable it and default is off after I saw
the patch by Andreas Rheinhardt:

https://patchwork.ffmpeg.org/project/ffmpeg/patch/AM7PR03MB66607C2DB65E1AD49D975CF18F7B9@AM7PR03MB6660.eurprd03.prod.outlook.com/

How to test by cli:
ffmpeg -y -f lavfi -i testsrc -c:v libx264 -frames:v 1 a.ts
ffmpeg -y -i a.ts -c:v libx264 -udu_sei 1 b.ts
ffmpeg -y -i a.ts -c:v libx264 -udu_sei 0 c.ts

# check the user data unregistered SEIs, you'll see two UDU SEIs for b.ts.
# and mediainfo will show with wrong encoding setting info
ffmpeg -i b.ts -vf showinfo -f null -
ffmpeg -i c.ts -vf showinfo -f null -

This fixes tickets #9500 and #9557.

Reviewed-by: "zhilizhao(赵志立)" <quinkblack@foxmail.com>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-12-28 14:19:38 +08:00
Limin Wang
617452ce2c avcodec/qsvenc_h264: use AV_OPT_TYPE_BOOL for aud, a53cc, cavlc, look_ahead, pic_timing_sei options
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2021-12-27 11:36:23 +08:00
Limin Wang
c2a5389269 avcodec/qsvenc_hevc: use AV_OPT_TYPE_BOOL for aud option
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2021-12-27 11:36:15 +08:00
Zhang yuankun
db901276c0 avcodec/vaapi_encode_vp9: fix > 4k encode fail issue
This patch will fix following command:
ffmpeg -hwaccel vaapi -hwaccel_output_format vaapi -i input.264 \
-vf 'scale_vaapi=w=7680:h=4096' -c:v vp9_vaapi output.ivf

Max width of a vp9 tile is 4096. If the source frame > 4096, we need split to multiple tiles.

Reviewed-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Zhang yuankun <yuankunx.zhang@intel.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2021-12-27 11:19:27 +08:00
Nicolas Gaullier
dd7c0bc4f9 avformat/mxfenc: fix DNxHD GC element_type
The values for the essence element type were updated in the spec
from 0x05/0x06 (ST2019-4 2008) to 0x0C/0x0D (ST2019-4 2009).

Fixes ticket #6380.

Thanks-to: Philip de Nier <philip.denier@bbc.co.uk>
Thanks-to: Matthieu Bouron <matthieu.bouron@gmail.com>

Reviewed-by: Matthieu Bouron <matthieu.bouron@gmail.com>
Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>

Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Signed-off-by: Marton Balint <cus@passwd.hu>
2021-12-27 00:39:35 +01:00
Nicolas Gaullier
1cbeac0c2f avformat/mxfenc: fix DNxHD GC container_ul
Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Reviewed-by: Matthieu Bouron <matthieu.bouron@gmail.com>
Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Marton Balint <cus@passwd.hu>
2021-12-27 00:38:52 +01:00
Limin Wang
0c8741f819 avcodec/nvenc: add udu_sei option to import user data unregistered SEIs
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2021-12-25 14:12:26 +01:00
Michael Niedermayer
f3a949dc4c avformat/mvdec: Check bytes_per_sample
Fixes: division by zero
Fixes: 42814/clusterfuzz-testcase-minimized-ffmpeg_dem_MV_fuzzer-4787014237552640

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Reviewed-by: John-Paul Stewart <jpstewart@personalprojects.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-12-25 11:59:47 +01:00
Michael Niedermayer
10add8bb66 avcodec/cdgraphics: avoid signed overflow in alpha
Fixes: left shift of 255 by 24 places cannot be represented in type 'int'
Fixes: 42766/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CDGRAPHICS_fuzzer-5142826105569280

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>
2021-12-25 11:59:47 +01:00
Paul B Mahol
209488ccb0 avfilter: add anlmf filter 2021-12-25 11:32:41 +01:00
James Almer
2497a45562 avdevice/dshow: don't mix declarations and code
Signed-off-by: James Almer <jamrial@gmail.com>
2021-12-24 14:24:07 -03:00
James Almer
c147f7962c avdevice/dshow: remove unused variables
Signed-off-by: James Almer <jamrial@gmail.com>
2021-12-24 14:23:01 -03:00
Diederick Niehorster
a1c4929f65 avdevice/dshow: select format with extended color info
Some DirectShow devices (Logitech C920 webcam) expose each DirectShow
format they support twice, once without and once with extended color
information. During format selection, both match, this patch ensures
that the format with extended color information is selected if it is
available, else it falls back to a matching format without such
information. This also necessitated a new code path taken for default
formats of a device (when user didn't request any specific video size,
etc), because the default format may be one without extended color
information when a twin with extended color information is also
available. Getting the extended color information when available is
important as it allows setting the color space, range, primaries,
transfer characteristics and chroma location of the stream provided by
dshow, enabling users to get more correct color automatically out of
their device.

Closes: #9271

Signed-off-by: Diederick Niehorster <dcnieho@gmail.com>
Reviewed-by: Roger Pack <rogerdpack2@gmail.com>
2021-12-24 14:07:07 +05:30
Diederick Niehorster
dde92fb7d9 avdevice/dshow: discover source color range/space/etc
Enabled discovering a DirectShow device's color range, space, primaries,
transfer characteristics and chroma location, if the device exposes that
information. Sets them in the stream's codecpars.

Co-authored-by: Valerii Zapodovnikov <val.zapod.vz@gmail.com>
Signed-off-by: Diederick Niehorster <dcnieho@gmail.com>
Reviewed-by: Roger Pack <rogerdpack2@gmail.com>
2021-12-24 14:07:02 +05:30
Diederick Niehorster
5c90c13a56 fftools: provide media type info for devices
fftools now print info about what media type(s), if any, are provided by
sink and source avdevices.

Signed-off-by: Diederick Niehorster <dcnieho@gmail.com>
Reviewed-by: Roger Pack <rogerdpack2@gmail.com>
2021-12-24 14:06:56 +05:30
Diederick Niehorster
e4b9aee11c avdevice/dshow: add media type info to get_device_list
The list returned by get_device_list now contains info about what media
type(s), if any, can be provided by each device.

Signed-off-by: Diederick Niehorster <dcnieho@gmail.com>
Reviewed-by: Roger Pack <rogerdpack2@gmail.com>
2021-12-24 14:06:51 +05:30
Diederick Niehorster
a8a530331f avdevice: add info about media types(s) to AVDeviceInfo
An avdevice, regardless of whether its category says its an audio or
video device, may provide access to devices providing different media
types, or even single devices providing multiple media types. Also, some
devices may provide no media types. dshow is an example encompassing all
of these cases. Users should be provided with this information, so
AVDeviceInfo is extended to provide it.

Bump avdevice version

Signed-off-by: Diederick Niehorster <dcnieho@gmail.com>
Reviewed-by: Roger Pack <rogerdpack2@gmail.com>
2021-12-24 14:06:45 +05:30
Diederick Niehorster
54fdbfc366 avdevice/dshow: list_devices: show media type(s) per device
the list_devices option of dshow didn't indicate whether a specific
device provides audio or video output. This patch iterates through all
media formats of all pins exposed by the device to see what types it
provides for capture, and prints this to the console for each device.
Importantly, this now allows to find devices that provide both audio and
video, and devices that provide neither.

Signed-off-by: Diederick Niehorster <dcnieho@gmail.com>
Reviewed-by: Roger Pack <rogerdpack2@gmail.com>
2021-12-24 14:06:40 +05:30
Diederick Niehorster
ec579b4e36 avdevice/dshow: implement get_device_list
Needed to enable programmatic discovery of DirectShow devices

Signed-off-by: Diederick Niehorster <dcnieho@gmail.com>
Reviewed-by: Roger Pack <rogerdpack2@gmail.com>
2021-12-24 14:06:33 +05:30
Diederick Niehorster
937de260eb avdevice/dshow: set no-seek flags
avdevice/dshow is a realtime device and as such does not support
seeking. Therefore, its demuxer format should define the
AVFMT_NOBINSEARCH, AVFMT_NOGENSEARCH and AVFMT_NO_BYTE_SEEK flags.
With these flags set, attempting to seek (with, e.g.,
avformat_seek_file()) correctly yields -1 (operation not permitted)
instead of -22 (invalid argument).

This actually seems to apply to many other devices, at least the
gdigrab, v4l2, vfwcap, x11grab, fbdev, kmsgrab and android_camera
devices, from reading the source.

Signed-off-by: Diederick Niehorster <dcnieho@gmail.com>
Reviewed-by: Roger Pack <rogerdpack2@gmail.com>
2021-12-24 14:06:27 +05:30
Diederick Niehorster
271e55987f avdevice/dshow: handle unknown sample time
GetTime may return an error indication that the sample has not
timestamps, or may return a NULL start time. In those cases, fall back
to graph time. Emit log when that happens.
Improve logging in the frame receive function: now logged against
correct avclass instead of NULL.
Better debug message in case sample dropped: could now be audio or
video frame.

Signed-off-by: Diederick Niehorster <dcnieho@gmail.com>
Reviewed-by: Roger Pack <rogerdpack2@gmail.com>
2021-12-24 14:06:21 +05:30
Diederick Niehorster
584b0fbe4b avdevice/dshow: query graph and sample time only once
No need to query twice, use value we've already unconditionally got.
Improve variable names

Signed-off-by: Diederick Niehorster <dcnieho@gmail.com>
Reviewed-by: Roger Pack <rogerdpack2@gmail.com>
2021-12-24 14:06:14 +05:30
Diederick Niehorster
7dc33aad45 avdevice/dshow: implement option to use device video timestamps
The dshow avdevice ignores timestamps for video frames provided by the
DirectShow device, instead using wallclock time, apparently because the
implementer of this code had a device that provided unreliable
timestamps. Me (and others) would like to use the device's timestamps.
The new use_video_device_timestamps option for dshow device enables them
to do so. Since the majority of video devices out there probably provide
fine timestamps, this patch sets the default to using the device
timestamps, which means best fidelity timestamps are used by default.
Using the new option, the user can switch this off and revert to the old
behavior, so a fall back remains available in case the device provides
broken timestamps.

add use_video_device_timestamps to docs.

Closes: #8620

Signed-off-by: Diederick Niehorster <dcnieho@gmail.com>
Reviewed-by: Roger Pack <rogerdpack2@gmail.com>
2021-12-24 14:06:06 +05:30
Diederick Niehorster
7b21841ce4 avdevice/dshow: prevent NULL access
list_options true would crash when both a video and an audio device were
specified as input. Crash would occur on line 784 because
ctx->device_unique_name[otherDevType] would be NULL

Signed-off-by: Diederick Niehorster <dcnieho@gmail.com>
Reviewed-by: Roger Pack <rogerdpack2@gmail.com>
2021-12-24 14:04:14 +05:30
Brad Smith
bb813ccb45 configure: use pkg-config for sndio 2021-12-23 20:19:18 +01:00