summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
...
* avformat/mov: add option max_stts_deltaGyan Doshi2021-12-31
| | | | | | | | | | | | | | | | 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>
* avformat/imf: TestsPierre-Anthony Lemieux2021-12-31
| | | | | Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com> Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avformat/imf: DemuxerPierre-Anthony Lemieux2021-12-31
| | | | | Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com> Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avformat: add bitpacked demuxerLimin Wang2021-12-31
| | | | | | | | 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>
* avcodec/apedec: fix integer overflow in 8bit samplesMichael Niedermayer2021-12-30
| | | | | | | | 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>
* avformat/flvdec: timestamps cannot use the full int64 rangeMichael Niedermayer2021-12-30
| | | | | | | | | 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>
* avcodec/targa: Check input size for uncompressed TGA before allocationMichael Niedermayer2021-12-30
| | | | | | | | 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>
* avcodec/tiff: Remove messing with jpeg contextMichael Niedermayer2021-12-30
| | | | | | | | | | | | | | | | 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>
* lavf/tls_mbedtls: fix handling of tls_verify=0sfan52021-12-30
| | | | | If ca_file was set, setting tls_verify=0 would not actually disable verification.
* lavc/mediacodecdec: set codec profile and level from extradata for H264+HEVCsfan52021-12-30
| | | | | | 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).
* doc/demuxers: add entry for aacGyan Doshi2021-12-30
|
* avcodec/v4l2_m2m_dec: dequeue frame if input isn't readyCameron Gutman2021-12-28
| | | | | | | | | | | 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>
* avcodec/libx26[45]: reindent after last commitLimin Wang2021-12-28
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec/libx26[45]: add udu_sei option to import user data unregistered SEIsLimin Wang2021-12-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* avcodec/qsvenc_h264: use AV_OPT_TYPE_BOOL for aud, a53cc, cavlc, look_ahead, ↵Limin Wang2021-12-27
| | | | | | | pic_timing_sei options Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
* avcodec/qsvenc_hevc: use AV_OPT_TYPE_BOOL for aud optionLimin Wang2021-12-27
| | | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
* avcodec/vaapi_encode_vp9: fix > 4k encode fail issueZhang yuankun2021-12-27
| | | | | | | | | | | | 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>
* avformat/mxfenc: fix DNxHD GC element_typeNicolas Gaullier2021-12-27
| | | | | | | | | | | | | | | | 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>
* avformat/mxfenc: fix DNxHD GC container_ulNicolas Gaullier2021-12-27
| | | | | | | 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>
* avcodec/nvenc: add udu_sei option to import user data unregistered SEIsLimin Wang2021-12-25
| | | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avformat/mvdec: Check bytes_per_sampleMichael Niedermayer2021-12-25
| | | | | | | | | | 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>
* avcodec/cdgraphics: avoid signed overflow in alphaMichael Niedermayer2021-12-25
| | | | | | | | | 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>
* avfilter: add anlmf filterPaul B Mahol2021-12-25
|
* avdevice/dshow: don't mix declarations and codeJames Almer2021-12-24
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avdevice/dshow: remove unused variablesJames Almer2021-12-24
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avdevice/dshow: select format with extended color infoDiederick Niehorster2021-12-24
| | | | | | | | | | | | | | | | | | | | | | 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>
* avdevice/dshow: discover source color range/space/etcDiederick Niehorster2021-12-24
| | | | | | | | | | 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>
* fftools: provide media type info for devicesDiederick Niehorster2021-12-24
| | | | | | | | 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>
* avdevice/dshow: add media type info to get_device_listDiederick Niehorster2021-12-24
| | | | | | | | 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>
* avdevice: add info about media types(s) to AVDeviceInfoDiederick Niehorster2021-12-24
| | | | | | | | | | | | | | 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>
* avdevice/dshow: list_devices: show media type(s) per deviceDiederick Niehorster2021-12-24
| | | | | | | | | | | | 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>
* avdevice/dshow: implement get_device_listDiederick Niehorster2021-12-24
| | | | | | | Needed to enable programmatic discovery of DirectShow devices Signed-off-by: Diederick Niehorster <dcnieho@gmail.com> Reviewed-by: Roger Pack <rogerdpack2@gmail.com>
* avdevice/dshow: set no-seek flagsDiederick Niehorster2021-12-24
| | | | | | | | | | | | | | | | 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>
* avdevice/dshow: handle unknown sample timeDiederick Niehorster2021-12-24
| | | | | | | | | | | | | 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>
* avdevice/dshow: query graph and sample time only onceDiederick Niehorster2021-12-24
| | | | | | | | 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>
* avdevice/dshow: implement option to use device video timestampsDiederick Niehorster2021-12-24
| | | | | | | | | | | | | | | | | | | | | 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>
* avdevice/dshow: prevent NULL accessDiederick Niehorster2021-12-24
| | | | | | | | | 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>
* configure: use pkg-config for sndioBrad Smith2021-12-23
|
* avcodec/h2645: Fix SEI->display matrix transformationAndreas Rheinhardt2021-12-23
| | | | | | | | | | | The earlier code did not account for the fact that av_display_rotation_set() wants the angle in the anticlockwise direction (despite what its documentation stated for a long time); furthermore, the H.2645 spec wants the flips applied first, whereas our code did it the other way around. This can be fixed by negating the angle once for every flip. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/ffmpeg_filter: Avoid inserting hflip filterAndreas Rheinhardt2021-12-23
| | | | | | | The transpose filter has modes equivalent to "rotation by 90°/270°" followed by horizontal flips. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/ffmpeg_filter: Fix autorotationAndreas Rheinhardt2021-12-23
| | | | | | | | | | | | | | | | | | | | | | | | | | In case of an orthogonal transformation av_display_rotation_get() returns the (anticlockwise) degree that the unit vector in x-direction gets rotated by; get_rotation in cmdutils.c makes a clockwise degree out of this. So if one inserts a transpose filter corresponding to this degree, then the x-vector gets mapped correctly and there are two possibilities for image of the y-vector, namely the two unit vectors orthogonal to the image of the x-vector. E.g. if the x-vector gets rotated by 90° clockwise, then the two possibilities for the y-vector are the unit vector in x direction or its opposite. The latter case is a simple 90° rotation for both vectors* whereas the former is a simple 90° clockwise rotation followed by a horizontal flip. These two cases can be distinguished by looking at the x-coordinate of the image of the y-vector, i.e. by looking at displaymatrix[3]. Similarly for the case of a 270° clockwise rotation. These two cases were previously wrong (they were made to match wrongly parsed exif rotation tag values). *: For display matrices, the y-axis points downward. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mjpegdec: Fix exif rotation->displaymatrix conversionAndreas Rheinhardt2021-12-23
| | | | | | | The cases in which there was flipping together with a rotation that is not a multiple of the identity were wrong. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/tiff: Use ff_set_dimensions() for setting up mjpeg context dimensionsMichael Niedermayer2021-12-23
| | | | | | | | | | | sets coded_width / coded_height too to keep them consistent with width / height Fixes: OOM Fixes: 42263/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5653333619113984 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/tiff: Pass max_pixels to mjpeg contextMichael Niedermayer2021-12-23
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/vqavideo: reset accounting on errorMichael Niedermayer2021-12-23
| | | | | | | | Fixes: Timeout (same growing chunk is decoded to failure repeatedly) Fixes: 42582/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VQA_fuzzer-6531195591065600 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec: [loongarch] Optimize vc1dsp with LASX.Hao Chen2021-12-23
| | | | | | | | | ./ffmpeg -i 11_wmv3_720p_24fps_7Mbps.wmv -f rawvideo -y /dev/null -an before:131fps after :229fps Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec: [loongarch] Optimize vp9_lpf/idct with LSX.Jin Bo2021-12-23
| | | | | | | | | ffmpeg -i ../10_vp9_1080p_30fps_3Mbps.webm -f rawvideo -y /dev/null -an before:294fps after :567fps Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec: [loongarch] Optimize vp9_mc/intra with LSX.Hao Chen2021-12-23
| | | | | | | | | ffmpeg -i ../10_vp9_1080p_30fps_3Mbps.webm -f rawvideo -y /dev/null -an before:170fps after :294fps Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec: [loongarch] Optimize vp8_lpf/mc with LSX.yuanhecai2021-12-23
| | | | | | | | | ./ffmpeg -i ../9_vp8_1080p_30fps_2Mbps.webm -f rawvideo -y /dev/null -an before: 210fps after : 585fps Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavutil/hwcontext_qsv: clean padding when upload qsv framesWenbin Chen2021-12-23
| | | | | | | | | | | | | | | | | | | | | | | | | | Fix #7830 When we upload a frame that is not padded as MSDK requires, we create a new AVFrame to copy data. The frame's padding data is uninitialized so it brings run to run problem. For example, If we run the following command serveral times we will get different outputs. ffmpeg -init_hw_device qsv=qsv:hw -qsv_device /dev/dri/renderD128 \ -filter_hw_device qsv -f rawvideo -s 192x200 -pix_fmt p010 \ -i 192x200_P010.yuv -vf "format=nv12,hwupload=extra_hw_frames=16" \ -c:v hevc_qsv output.265 According to https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk-man.md#encoding-procedures "Note: It is the application's responsibility to fill pixels outside of crop window when it is smaller than frame to be encoded. Especially in cases when crops are not aligned to minimum coding block size (16 for AVC, 8 for HEVC and VP9)" I add a function to fill padding area with border pixel to fix this run2run problem, and also move the new AVFrame to global structure to reduce redundant allocation operation to increase preformance. Signed-off-by: Wenbin Chen <wenbin.chen@intel.com> Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>