1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

10769 Commits

Author SHA1 Message Date
Stefano Sabatini
9d140ecaf8 lavfi/unsharp: clarify invalid filter param constraints
Clarify failure in case of x/y building a too big matrix.

Example:
$ ffmpeg -hide_banner -f lavfi -i color=c=white:size=640x360,unsharp=lx=5:ly=23 -f null -t 1 -
[Parsed_unsharp_1 @ 0x5650e1c30240] luma matrix size (lx/2+ly/2)*2=26 greater than maximum value 25
color=c=white:size=640x360,unsharp=lx=5:ly=23: Invalid argument

Fix trac issue:
http://trac.ffmpeg.org/ticket/6033
2023-04-02 17:07:51 +02:00
Haihao Xiang
412d43b09a lavfi/vf_vpp_qsv: only add the given output sw format to output pad
Otherwise the output format is not changed when output is in system
memory. For example, the output format is still p010le in the following
case:

$ ffmpeg -qsv_device /dev/dri/renderD128 -f lavfi -i testsrc -vf
"format=p010le,vpp_qsv=extra_hw_frames=8:format=nv12" -f null -
...
Output #0, null, to 'pipe:':
  Metadata:
    encoder         : Lavf60.4.100
  Stream #0:0: Video: wrapped_avframe, p010le(tv, progressive), 320x240
[SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 25 fps, 25 tbn

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2023-03-31 10:27:58 +08:00
Paul B Mahol
b75159682a avfilter/af_rubberband: use correct array for multichannels 2023-03-30 14:08:52 +02:00
Stefano Sabatini
7d58df7bb2 lavfi/aspect: apply style fixes 2023-03-29 00:15:19 +02:00
U. Artie Eoff
9bf1848acf lavfi: add hwdevice flag to hwupload/hwmap
This fixes a regression introduced by:

  commit 3f63685c35
   and
  commit 632c349931

...where command-lines like:

ffmpeg -v verbose -hwaccel qsv \
  -init_hw_device qsv=qsv,child_device=/dev/dri/renderD128 \
  -hwaccel_output_format qsv -f rawvideo -pix_fmt yuv420p \
  -s:v 352x288 -r:v 25 -i input.yuv \
  -vf 'format=nv12,hwupload=extra_hw_frames=120' \
  -an -c:v h264_qsv -y output.h264

ffmpeg -v verbose -hwaccel qsv \
  -init_hw_device qsv=qsv,child_device=/dev/dri/renderD128 \
  -hwaccel_output_format qsv -f rawvideo -pix_fmt nv12 \
  -s:v 352x288 -r:v 25 -i input.yuv \
  -vf 'format=nv12|qsv,hwupload=extra_hw_frames=16,vpp_qsv=procamp=1:saturation=1.0,hwdownload,format=nv12' \
  -pix_fmt nv12 -f rawvideo -fps_mode passthrough -an -y output.yuv

...produced errors like:

[hwupload @ 0x55b6171d0dc0] A hardware device reference is required to upload frames to.
[Parsed_hwupload_1 @ 0x55b6172053c0] Query format failed for 'Parsed_hwupload_1': Invalid argument
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2023-03-27 17:14:31 +02:00
Ting Fu
bc589c91f7 lavfi/dnn: add error info for TF backend filling task failure
Signed-off-by: Ting Fu <ting.fu@intel.com>
2023-03-26 09:19:42 +08:00
Ting Fu
af052f9066 lavfi/dnn: fix mem leak in TF backend error handle
Signed-off-by: Ting Fu <ting.fu@intel.com>
2023-03-26 09:19:42 +08:00
Ting Fu
5c216d081d lavfi/dnn: fix corruption when TF backend infer failed
Signed-off-by: Ting Fu <ting.fu@intel.com>
2023-03-26 09:19:42 +08:00
Michael Niedermayer
06b451d276
avfilter/vf_mcdeint: update to new API
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-03-26 01:46:49 +01:00
Michael Niedermayer
5310c975cf
avfilter/vf_uspp: add AV_CODEC_FLAG_RECON_FRAME support
about 50% faster (based on command line fps)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-03-26 01:46:49 +01:00
James Almer
aca8ceb870 x86/vf_bwdif_init: limit AVX2 functions using 256bit vectors to cpus known to be fast with it
Signed-off-by: James Almer <jamrial@gmail.com>
2023-03-25 13:27:20 -03:00
Jun Zhao
9a23d8d894 lavfi/Makefile: fix make checkheaders fail
Add stack_internal.h to the list of skipped headers to fix
make checkheaders fail, it's introduced by commit 742dfa281

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2023-03-25 22:13:56 +08:00
James Darnley
073ec3b9da avfilter/bwdif: add avx2 filter_line function
8-bit:
2.24x faster (1925±1.3 vs. 859±2.2 decicycles) compared with ssse3
10-bit:
2.00x faster (1703±1.7 vs. 853±2.0 decicycles) compared with ssse3
2023-03-25 02:38:17 +01:00
James Darnley
b503b5a0cf avfilter/bwdif: move filter_line init to a dedicated function 2023-03-25 02:38:17 +01:00
Anton Khirnov
632c349931 lavfi: add a flag for filters able to work with hw_device_ctx
This way the caller can set it just on the filters that can make use of
it.
2023-03-24 10:16:51 +01:00
Anton Khirnov
27f8c9b27b lavu/frame: deprecate AVFrame.pkt_{pos,size}
These fields are supposed to store information about the packet the
frame was decoded from, specifically the byte offset it was stored at
and its size.

However,
- the fields are highly ad-hoc - there is no strong reason why
  specifically those (and not any other) packet properties should have a
  dedicated field in AVFrame; unlike e.g. the timestamps, there is no
  fundamental link between coded packet offset/size and decoded frames
- they only make sense for frames produced by decoding demuxed packets,
  and even then it is not always the case that the encoded data was
  stored in the file as a contiguous sequence of bytes (in order for pos
  to be well-defined)
- pkt_pos was added without much explanation, apparently to allow
  passthrough of this information through lavfi in order to handle byte
  seeking in ffplay. That is now implemented using arbitrary user data
  passthrough in AVFrame.opaque_ref.
- several filters use pkt_pos as a variable available to user-supplied
  expressions, but there seems to be no established motivation for using them.
- pkt_size was added for use in ffprobe, but that too is now handled
  without using this field. Additonally, the values of this field
  produced by libavcodec are flawed, as described in the previous
  ffprobe conversion commit.

In summary - these fields are ill-defined and insufficiently motivated,
so deprecate them.
2023-03-20 10:42:09 +01:00
Haihao Xiang
57afccc0ef lavfi/vf_vpp_qsv: set the right timestamp for AVERROR_EOF
Rescale the timestamp for AVERROR_EOF. This can fix tickets 10261 and
10262.

Tested-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2023-03-20 09:58:41 +08:00
Michael Niedermayer
3ead1fe413
avfilter/vf_uspp: about 10x the speed with threads
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-03-18 22:36:51 +01:00
Michael Niedermayer
cee4b99d41
avfilter/vf_uspp: Support any codec
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-03-18 18:20:14 +01:00
Michael Niedermayer
771c27119d
avfilter/vf_uspp: update to new APIs
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-03-18 18:20:02 +01:00
Zhao Zhili
4ec2861559 avfilter/vf_showinfo: fix HDR vivid info
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-03-17 18:52:12 +08:00
James Almer
dc61d5cf19 avfilter/vf_untile: swap the chroma shift values used for plane offsets
Fixes ticket #10265

Signed-off-by: James Almer <jamrial@gmail.com>
2023-03-16 16:07:40 -03: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
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
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
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
Anton Khirnov
fefcba1c1b lavfi/graphparser: use correct logging context 2023-03-10 13:04:25 +01:00
James Almer
2fd86d9afa avfilter/graphparser: fix filter instance name when an id is provided
Restores the behavior of naming the instance filter@id, which was accidentally changed
to simpy id in commit f17051eaae.

Fixes ticket #10226.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-03-06 08:42:18 -03:00
Stefano Sabatini
ad17e29224 lavfi/buffersrc: issue more specific error in case of invalid parameters 2023-03-05 12:21:45 +01:00
James Almer
4561232b1a avfilter/af_pan: use the new swr used channel layout option
Fixes ticket #10180

Signed-off-by: James Almer <jamrial@gmail.com>
2023-02-19 18:28:52 -03:00
Michael Niedermayer
47ac3e6065
version.h: Bump minor post 6.0 branch
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-02-19 18:37:36 +01:00
Michael Niedermayer
62efa096af
version.h: Bump minor for 6.0 branch
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-02-19 18:32:07 +01:00
Niklas Haas
eabc304d12 avfilter/vf_libplacebo: add SMPTE ST2094 tone-mappers
libplacebo gained these exciting new functions upstream.
2023-02-17 18:35:39 +01:00
Wenbin Chen
b7a335c5e9 libavfilter/qsvvpp: check the return value
Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
2023-02-16 11:15:50 +08:00
Haihao Xiang
0f407cdea2 avfilter: add QSV variants of the stack filters
Include hstack_qsv, vstack_qsv and xstack_qsv. They may accept input
streams with different sizes.

Examples:
$ ffmpeg -hwaccel qsv -hwaccel_output_format qsv -i input.mp4 \
-filter_complex "[0:v][0:v]hstack_qsv" -f null -

$ ffmpeg \
-hwaccel qsv -hwaccel_output_format qsv -i input.mp4 \
-hwaccel qsv -hwaccel_output_format qsv -i input.mp4 \
-hwaccel qsv -hwaccel_output_format qsv -i input.mp4 \
-hwaccel qsv -hwaccel_output_format qsv -i input.mp4 \
-filter_complex "[0:v][1:v][2:v][3:v]xstack_qsv=inputs=4:fill=0x000000:layout=0_0_1920x1080|w0_0_1920x1080|0_h0_1920x1080|w0_h0_1920x1080" \
-f null -

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2023-02-16 11:15:50 +08:00
Haihao Xiang
742dfa2815 lavfi/vf_stack_vaapi: factor out the common code for stack setting
The common code will be used in QSV based stack filters.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2023-02-16 11:15:41 +08:00
Kieran Kunhya
264cf75214 vf_yadif: Remove unused emms_c 2023-02-14 19:09:19 +00:00
Paul B Mahol
e506ea3ce1 avfilter: use ff_inlink_make_frame_writable() 2023-02-12 13:32:00 +01:00
Anton Khirnov
f17051eaae lavfi/graphparser: reimplement avfilter_graph_parse* using new API 2023-02-12 10:33:52 +01:00
Anton Khirnov
d1b9a3ddb4 lavfi: add a new filtergraph parsing API
Callers currently have two ways of adding filters to a graph - they can
either
- create, initialize, and link them manually
- use one of the avfilter_graph_parse*() functions, which take a
  (typically end-user-written) string, split it into individual filter
  definitions+options, then create filters, apply options, initialize
  filters, and finally link them - all based on information from this
  string.

A major problem with the second approach is that it performs many
actions as a single atomic unit, leaving the caller no space to
intervene in between. Such intervention would be useful e.g. to
- modify filter options;
- supply hardware device contexts;
both of which typically must be done before the filter is initialized.

Callers who need such intervention are then forced to invent their own
filtergraph parsing, which is clearly suboptimal.

This commit aims to address this problem by adding a new modular
filtergraph parsing API. It adds a new  avfilter_graph_segment_parse()
function to parse a string filtergraph description into an intermediate
tree-like representation (AVFilterGraphSegment and its children).

This intermediate form may then be applied step by step using further
new avfilter_graph_segment*() functions, with user intervention possible
between each step.
2023-02-12 10:28:06 +01:00
Anton Khirnov
4310b66b98 lavfi/avfilter: track whether a filter has been initialized
Refuse to link uninitialized filters or initialize a filter twice.
2023-02-12 10:17:26 +01:00
Anton Khirnov
80cf509e73 lavfi/avfilter: export process_options()
Also, replace an AVFilterContext argument with a logging context+private
class, as those are the only things needed in this function.

Will be useful in future commits.
2023-02-12 10:16:41 +01:00
Stefano Sabatini
abfe8456a2 lavfi/astats: sort measures keys by name 2023-02-11 17:30:20 +01:00
Paul B Mahol
725328672a avfilter/vf_vibrance: reduce copy operations 2023-02-11 10:36:56 +01:00
Paul B Mahol
acd87d41f2 avfilter/vf_exposure: reduce copy operations 2023-02-11 10:36:56 +01:00
James Almer
5bad485603 Bump major versions of all libraries
Signed-off-by: James Almer <jamrial@gmail.com>
2023-02-09 15:35:14 +01:00
James Almer
8bc0d31320 avfilter: remove FF_API_PAD_COUNT
Signed-off-by: James Almer <jamrial@gmail.com>
2023-02-09 15:35:14 +01:00
James Almer
863822bfaf avfilter: remove FF_API_BUFFERSINK_ALLOC
Signed-off-by: James Almer <jamrial@gmail.com>
2023-02-09 15:35:14 +01:00