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

9184 Commits

Author SHA1 Message Date
Marton Balint
758e2da289 avfilter/f_metadata: do not return the frame early if there is no metadata
The early return caused isses for the "add" mode (got fixed in
c95dfe5cce) and the "select" mode needs a similar
fix. It is probably better to fully remove the check, since all modes work
correctly with NULL metadata.

Signed-off-by: Marton Balint <cus@passwd.hu>
2021-07-06 21:58:19 +02:00
Gyan Doshi
b7ba472f43 avfilter/fps: remove unconventional acronyms
In dd770883e9, support for expressions was added. Among the constants
added were labels of qnstc, qpal, sntsc & spal.

These were added in ba2a8cb40b to represent parameter permutations where
only the resolution is different. They don't have any usage currency and
don't represent any industry standards or convention in terms of framerate.
2021-07-06 11:43:31 +05:30
Limin Wang
493f9a5432 avfilter/dnn_filter_common: Use const where appropriate
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-07-06 10:47:57 +08:00
Shubhanshu Saxena
f73943d514 lavfi/dnn_backend_openvino.c: Fix Memory Leak in execute_model_ov
In cases where the execution inside the function execute_model_ov fails,
push the RequestItem back to the request_queue before returning the error.
In case pushing back fails, release the allocated memory.

Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
2021-07-04 18:56:17 +08:00
Paul B Mahol
e11fd47f8d avfilter/vf_v360: add cylindrical equal area format 2021-06-30 00:12:41 +02:00
Xuewei Meng
9ca88b3bef avfilter/vf_guided: support single input
Support single input for guided filter by adding guidance mode.
If the guidance mode is off, single input is required. And
edge-preserving smoothing is conducted. If the mode is on, two
inputs are needed. The second input serves as the guidance. For
this mode, more tasks are supported, such as detail enhancement,
dehazing and so on.

Signed-off-by: Xuewei Meng <xwmeng96@gmail.com>
Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
2021-06-29 16:05:31 +08:00
Timo Rothenpieler
62dc5df941 avfilter/scale_cuda: add support for pixel format conversion 2021-06-25 01:44:30 +02:00
Timo Rothenpieler
b0e2e938c3 avfilter/scale_cuda: combine separate CUDA sources 2021-06-24 20:58:47 +02:00
Timo Rothenpieler
91a41a3439 avfilter/cuda: fix ptx inflation with large payloads 2021-06-24 20:58:47 +02:00
Martin Storsjö
947122f111 libavfilter: Fix fate-source after 072788c46e
Signed-off-by: Martin Storsjö <martin@martin.st>
2021-06-23 09:21:07 +03:00
Timo Rothenpieler
072788c46e avfilter: compress CUDA PTX code if possible 2021-06-22 14:05:44 +02:00
Haihao Xiang
efc22e63e5 lavfi/vf_vpp_qsv: fix the time_base for outlink
Since commit 89ffcd1, the status pts of the output link is set to a
value in the input link time base, not in the output link time base when
EOF is reached. Usually this pst value is larger than the required one
because the output link time base is more greater than the input link
time base. When "-vf vpp_qsv,fps" is used, user has to wait a long time
for the ending of the pipeline because fps filter output a huge number
of frames until the wrong status pts is hit.

The issue can be triggered with the command below (use a clip with 1000
frames in this case):

$> time ffmpeg -hwaccel qsv -c:v hevc_qsv -i input.h265 -vf
"vpp_qsv=w=1920:h=1080,fps=fps=30" -f null -
...
[out_0_0 @ 0x564ccd27e020] 10000000 buffers queued in out_0_0, something
may be wrong.
frame=40119596 fps=88080 q=-0.0 Lsize=N/A time=371:28:39.96 bitrate=N/A
speed=2.94e+03x
video:17238889kB audio:0kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: unknown

real    9m7.451s
user    2m34.102s
sys     0m39.734s

In order to avoid the above issue, the same time base for input and
ouput links is used in this patch.

Fixes ticket #9286

Signed-off-by: Zhong Li <zhongli_dev@126.com>
2021-06-20 23:05:03 +08:00
Guo Yejun
2cf95f2dd9 lavfi/dnn_backend_openvino.c: fix crash when target is not specified 2021-06-19 19:17:56 +08:00
Shubhanshu Saxena
2df963b5fa lavfi/dnn_backend_openvino.c: Fix Memory Leak for RequestItem
Fix memory leak for RequestItem upon error while pushing to the
request_queue in the completion callback.

Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
2021-06-18 21:26:50 +08:00
James Almer
dd770883e9 avfilter/vf_fps: extend support for expressions
AV_OPT_TYPE_VIDEO_RATE AVOption types are parsed as expressions, but in a
limited way. For example, name constants can only be parsed alone and not as
part of a longer expression.

This change allows usage like

ffmpeg -i IN -vf fps="if(eq(source_fps\,film)\,ntsc_film\,source_fps)" OUT

Suggested-by: ffmpeg@fb.com
Signed-off-by: James Almer <jamrial@gmail.com>
2021-06-13 17:32:45 -03:00
Shubhanshu Saxena
5509235818 lavfi/dnn: Fill Task using Common Function
This commit adds a common function for filling the TaskItems
in all three backends.

Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
2021-06-12 15:18:58 +08:00
Shubhanshu Saxena
6b961f7409 lavfi/dnn: Use uint8_t for async and do_ioproc in TaskItems
These properties have values either 0 or 1, so using uint8_t
is a better option as compared to int.

Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
2021-06-12 15:18:58 +08:00
Shubhanshu Saxena
9675ebbb91 lavfi/dnn: Add nb_output to TaskItem
Add nb_output property to TaskItem for use in TensorFlow backend
and Native backend.

Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
2021-06-12 15:18:58 +08:00
Shubhanshu Saxena
446b4f77c1 lavfi/dnn: Convert output_name to char** in TaskItem
Convert output_name to char **output_names in TaskItem and use it as
a pointer to array of output names in the DNN backend.

Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
2021-06-12 15:18:58 +08:00
Shubhanshu Saxena
f5ab8905fd lavfi/dnn: Extract TaskItem and InferenceItem from OpenVino Backend
Extract TaskItem and InferenceItem from OpenVino backend and convert
ov_model to void in TaskItem.

Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
2021-06-12 15:18:58 +08:00
Steven Liu
58c908cf94 avfilter/overlay_cuda: support expression of x y position
and add per-frame / init mode for it.

Signed-off-by: Steven Liu <liuqi05@kuaishou.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2021-06-10 22:51:43 +02:00
Anton Khirnov
5d920255aa lavfi/lavfutils: include required headers explicitly 2021-06-10 16:51:44 +02:00
Ting Fu
e01bf559df lavfi/vf_drawtext.c: fix CID 1485003
CID 1485003: Memory - illegal accesses (UNINIT)
Using uninitialized value "sd".

Signed-off-by: Ting Fu <ting.fu@intel.com>
2021-06-09 09:18:02 +08:00
Ting Fu
22d99589d8 lavfi/vf_drawbox.c: fix CID 1485004
CID 1485004: Uninitialized variables (UNINIT)
Using uninitialized value "x" when calling "*pixel_belongs_to_region".

Signed-off-by: Ting Fu <ting.fu@intel.com>
2021-06-09 09:18:02 +08:00
Michael Niedermayer
4a3917c02c avfilter/vf_dctdnoiz: Check threads
Fixes: floating point division by 0
Fixes: Ticket 8269

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-06-08 18:00:05 +02:00
Michael Niedermayer
3d500e62f6 avfilter/vf_ciescope: Fix undefined behavior in rgb_to_xy() with black
Fixes: floating point division by 0
Fixes: undefined behavior in handling NaN
Fixes: Ticket 8268

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-06-08 18:00:05 +02:00
Steven Liu
282b9f4cba avfilter/overlay_cuda: add hsub and vsub compute x and y positions
fix problem when set x to odd number in nv12 by cuda

test step:
1. ffmpeg -f lavfi testsrc2=s=176x144 -pix_fmt nv12 -t 1 output_overlay.yuv
2. ffmpeg -f lavfi testsrc2=s=352x288 -pix_fmt nv12 -t 1 output_main.yuv
before this patch:
overlay_cuda=x=0:y=0 will right,
overlay_cuda=x=3:y=0 will wrong,

both will right after patch.

Signed-off-by: Steven Liu <liuqi05@kuaishou.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2021-06-07 17:02:36 +02:00
Valerii Zapodovnikov
ff0d70c8a9 avfilter/vf_hqdn3d: fix left shift of negative numbers
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-06-05 16:59:37 +02:00
Guo Yejun
3ac7d99428 lavfi/dnn/dnn_io_proc.c: fix CID 1484955
CID 1484955:  Memory - corruptions  (ARRAY_VS_SINGLETON)
2021-06-05 17:15:29 +08:00
Philip Langdale
8f8a7e491d avfilter/yadif_cuda: Fix time base for large denominators
This is the same fix applied to regular yadif.

Signed-off-by: Philip Langdale <philipl@overt.org>
2021-05-29 13:21:18 -07:00
Philip Langdale
7885ab3036 avfilter/bwdif: Fix time base for large denominators
This is the same fix applied to regular yadif.

Signed-off-by: Philip Langdale <philipl@overt.org>
2021-05-29 13:21:18 -07:00
Michael Niedermayer
7971f62120 avfilter/vf_yadif: Fix handing of tiny images
Fixes: out of array access
Fixes: Ticket8240
Fixes: CVE-2020-22021

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-05-29 20:14:24 +02:00
Michael Niedermayer
82ad1b7675 avfilter/vf_vmafmotion: Check dimensions
Fixes: out of array access
Fixes: Ticket8241
Fixes: Ticket8246
Fixes: CVE-2020-22019
Fixes: CVE-2020-22033

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-05-29 20:14:24 +02:00
Oneric
3300625c6f avfilter/vf_subtitles: allow using embedded fonts
ASS subtitles can have encoded fonts embedded into the subtitle file
itself. Allow libass to load those, to render subs as intended.
2021-05-29 11:32:23 +05:30
Shubhanshu Saxena
e41255cddb lavfi/dnn_backend_openvino.c: Correct Pointer Type while Freeing
This commit corrects the type of pointer of elements from the
inference queue in ff_dnn_free_model_ov.

Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
2021-05-28 08:40:07 +08:00
Tom Boshoven
8205f32663 avfilter/yadif: Fix time base for large denominators
This fixes an issue where the yadif filter could cause the timebase denominator to overflow.

Signed-off-by: Tom Boshoven <tom@jwplayer.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-05-27 17:43:40 +02:00
Ting Fu
7a879cce37 libavfilter: vf_drawtext filter support draw text with detection bounding boxes in side_data
This feature can be used with dnn detection by setting vf_drawtext's option
text_source=side_data_detection_bboxes, for example:
./ffmpeg -i face.jpeg -vf dnn_detect=dnn_backend=openvino:model=face-detection-adas-0001.xml:\
input=data:output=detection_out:labels=face-detection-adas-0001.label,drawbox=box_source=
side_data_detection_bboxes,drawtext=text_source=side_data_detection_bboxes:fontcolor=green:\
fontsize=40, -y face_detect.jpeg
Please note, the default fontsize of vf_drawtext is 12, which may be too
small to be seen clearly.

Signed-off-by: Ting Fu <ting.fu@intel.com>
2021-05-26 08:58:27 +08:00
Ting Fu
f444be643e libavfilter: vf_drawbox filter support draw box with detection bounding boxes in side_data
This feature can be used with dnn detection by setting vf_drawbox's
option box_source=side_data_detection_bboxes, for example:
./ffmpeg -i face.jpeg -vf dnn_detect=dnn_backend=openvino:model=face-detection-adas-0001.xml:\
input=data:output=detection_out:labels=face-detection-adas-0001.label,\
drawbox=box_source=side_data_detection_bboxes -y face_detect.jpeg

Signed-off-by: Ting Fu <ting.fu@intel.com>
2021-05-26 08:58:27 +08:00
Ting Fu
9921ae8a5d lavfi/drawbox: refine code
Extract common code of filter_frame() and drawgrid_filter_frame() to draw_region().

Signed-off-by: Ting Fu <ting.fu@intel.com>
2021-05-26 08:58:27 +08:00
Guo, Yejun
4c705a2775 lavfi/dnn: refine code to separate processing and detection in backends 2021-05-24 09:09:34 +08:00
Guo, Yejun
cde6d0288f lavfi/dnn_filter_common.h: make filter option 'options' as deprecated
we'd use 'backend_configs' to avoid confusion.
2021-05-24 08:44:58 +08:00
Andreas Rheinhardt
a0ab83bf93 avfilter/vf_guided: Don't needlessly copy properties, fix potential NPD
ref_frame is owned by the framesync structure and should therefore not
be modified; furthermore, these properties that are copied don't seem to
be used at all, so copying is unnecessary. Finally copying when the
destination frame is NULL gives a guaranteed segfault.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-05-23 13:42:16 +02:00
Andreas Rheinhardt
376e80ad74 avfilter/vf_guided: Fix leak of frames
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-05-23 13:42:16 +02:00
Andreas Rheinhardt
618d186b8c avfilter/vf_guided: Don't free frame we don't own
Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-05-23 13:42:04 +02:00
Michael Niedermayer
1642d8188d avfilter/avfiltergraph: Remove NULL checks after dereferences
Fixes: CID1398579 Dereference before null check
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-05-19 16:58:25 +02:00
Guo, Yejun
4718d74c58 lavfi/vf_dnn_processing.c: fix CID 1460603
CID 1460603 (#1 of 1): Improper use of negative value (NEGATIVE_RETURNS)
2021-05-18 09:20:08 +08:00
Guo, Yejun
3fb1d2e71c lavfi/dnn/dnn_io_proc.c: fix Improper use of negative value (NEGATIVE_RETURNS)
fix coverity CID 1473511 and 1473566
2021-05-18 09:20:08 +08:00
Guo, Yejun
bd6ea9ed1d lavfi/dnn/dnn_io_proc.c: Fix Out-of-bounds access (ARRAY_VS_SINGLETON)
fix coverity CID 1473571, 1473577 and 1482089
2021-05-18 09:20:08 +08:00
Shubhanshu Saxena
11b489d592 lavfi/dnn_backend_native_layer_mathunary.h: Documentation
Add documentation for Unary Math Layer

Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
2021-05-17 09:33:40 +08:00
Shubhanshu Saxena
57fe5c1412 lavfi/dnn_backend_native_layer_depth2space.h: Documentation
Add documentation for Depth to Space Layer

Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
2021-05-17 09:33:40 +08:00