summaryrefslogtreecommitdiff
path: root/libavfilter
Commit message (Collapse)AuthorAge
...
* avfilter/ccfifo: Inline trivial functionsAndreas Rheinhardt2024-02-07
| | | | | | | | | Besides being extremly simple this also avoids including ff_ccfifo_ccdetected() unnecessarily (it is only used by decklink). This is possible because this is not avpriv, but duplicated into lavd if necessary. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/vsrc_testsrc: switch to YUV colorspace negotiation APINiklas Haas2024-02-06
| | | | | | Instead of overriding the frame properties in fill_picture(), advertise the supported YUV colorspace and range at format negotiation time. (The correct metadata will now be set automatically by ff_get_video_buffer)
* avfilter: pass link YUV colorspace to ff_draw_init2Niklas Haas2024-02-06
| | | | | | | | | | | | | This makes all ff_draw_* based filters aware of YUV colorspaces and ranges. Needed for YUVJ removal. Also fixes a bug where e.g. vf_pad would generate a limited range background even after conversion to full-scale grayscale. The FATE changes were a consequence of the aforementioned bugfix - the gray scale files are output as full range (due to conversion by libswscale, which hard-codes gray = full), and appropriately tagged as such, but before this change the padded version incorrectly used a limited range (16) black background for these formats.
* avfilter/vf_tiltandshift: check outlink->color_rangeNiklas Haas2024-02-05
| | | | In addition to YUVJ pixfmts.
* avfilter/yadif_common: fix timestamps with very small timebasesMarton Balint2024-02-04
| | | | | | | | | | | | | | | | Yadif filter assumed that the output timebase is always half of the input timebase. This is not true if halving the input time base is not representable as an AVRational causing the output timestamps to be invalidly scaled in such a case. So let's use av_reduce instead of av_mul_q when calculating the output time base and if the conversion is inexact then let's fall back to the original timebase which probably makes more parctical sense than using x/INT_MAX. Fixes invalidly scaled pts_time values in this command line: ffmpeg -f lavfi -i testsrc -vf settb=tb=1/2000000000,yadif,showinfo -f null none Signed-off-by: Marton Balint <cus@passwd.hu>
* avfilter/yadif_common: factorize some part of the config_output and the ↵Marton Balint2024-02-04
| | | | | | | | uninit functions This unifies slightly diverged code and ensures that cc_fifo is always initialized. Signed-off-by: Marton Balint <cus@passwd.hu>
* avfilter/buffersrc: limit link variance logs below debug loglevelGyan Doshi2024-02-01
| | | | | | | | | The video param change check will print loglines below debug level for each frame which is different from the inlink parameters. This can spam the console. It is now printed at warning level once for each param change else it is kept at debug level. Partially addresses #10823
* lavfi/vsrc_testsrc_vulkan: fix -Wint-conversionLynne2024-01-31
| | | | | | | While VK_NULL_HANDLE is equivalent to NULL on 64-bit platforms, the same is not true across all platforms. Fixes building with gcc-14.
* lavfi/vsrc_ddagrab: add an option to avoid duplicating framesAnton Khirnov2024-01-30
| | | | Tested-by: Jiří Eliášek, Misha Aizatulin
* libavfilter/vf_dnn_detect: Use class confidence to filt boxesWenbin Chen2024-01-28
| | | | | | | | | Use class confidence instead of box_score to filt boxes, which is more accurate. Class confidence is obtained by multiplying class probability distribution and box_score. Signed-off-by: Wenbin Chen <wenbin.chen@intel.com> Reviewed-by: Guo Yejun <yejun.guo@intel.com>
* libavfilter/dnn_interface: use dims to represent shapesWenbin Chen2024-01-28
| | | | | | | | | For detect and classify output, width and height make no sence, so change width, height to dims to represent the shape of tensor. Use layout and dims to get width, height and channel. Signed-off-by: Wenbin Chen <wenbin.chen@intel.com> Reviewed-by: Guo Yejun <yejun.guo@intel.com>
* libavfilter/dnn_bakcend_openvino: Add automatic input/output detectionWenbin Chen2024-01-28
| | | | | | | | | | | | | | | | | Now when using openvino backend, user doesn't need to set input/output names in command line. Model ports will be automatically detected. For example: ffmpeg -i input.png -vf \ dnn_detect=dnn_backend=openvino:model=model.xml:input=image:\ output=detection_out -y output.png can be simplified to: ffmpeg -i input.png -vf dnn_detect=dnn_backend=openvino:model=model.xml\ -y output.png Signed-off-by: Wenbin Chen <wenbin.chen@intel.com> Reviewed-by: Guo Yejun <yejun.guo@intel.com>
* Revert "all: Don't set AVClass.item_name to its default value"Anton Khirnov2024-01-20
| | | | | | | Some callers assume that item_name is always set, so this may be considered an API break. This reverts commit 0c6203c97a99f69dbaa6e4011d48c331e1111f5e.
* avfilter/vsrc_testsrc: fix colorchart black stripeVladimir Petrov2024-01-12
| | | | | | | | Fixed blackstripe on bottom or segmentation fault in case when patch width and height differ. Signed-off-by: Vladimir Petrov <vppetrovmms@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/vf_zscale: fix query_formatsNiklas Haas2024-01-12
| | | | Wrong field assignment as a result of copy/paste error.
* all: use av_channel_layout_describe_bprint instead of ↵Marton Balint2024-01-07
| | | | | | | | av_channel_layout_describe in a few places Where an AVBPrint buffer is used later anyway. Signed-off-by: Marton Balint <cus@passwd.hu>
* avfilter/fsync: Fix memory leakThilo Borgmann2024-01-07
| | | | | | Fixes a leak if s->last_frame is still set at the end of filtering. Found-by: James Almer
* avfilter: Add fsync filterThilo Borgmann2024-01-05
|
* avfilter: Temporary hack to fix format negotiation for hw formatsMark Thompson2024-01-04
| | | | | | | hw_frames_ctx on the input link is only set when the input link is configured, which hasn't happened yet. This temporarily hacks around the problem (in a way no worse than before the format negotiation changes) until a proper fix can be applied.
* avfilter/vf_codecview: fix heap buffer overflowZhao Zhili2024-01-05
| | | | | | And improve the performance by a little bit. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* lavfi/drawtext: fix missed rename of is_newlineStefano Sabatini2024-01-03
| | | | | Fix fallout introduced in 732fb122e66, fix compilation with --enable-libfribidi.
* lavfi/setpts: use macro to access variables arrayStefano Sabatini2024-01-01
|
* lavfi: add quirc filterStefano Sabatini2024-01-01
|
* lavfi: add qrencode source and filterStefano Sabatini2024-01-01
|
* lavfi: introduce textutilsStefano Sabatini2024-01-01
| | | | | | Generalize drawtext utilities to make them usable in other filters. This will be needed to introduce the QR code source and filter without duplicating functionality.
* lavfi/overlay: factorize definition of planar and packed blending functionsStefano Sabatini2024-01-01
|
* avfilter/vf_format: allow empty pix_fmts listNiklas Haas2023-12-31
| | | | | | Which will impose no restriction. This makes sense when using e.g. `color_ranges=pc` to limit the color range, without also limiting the pixel format.
* avfilter/vf_format: add color_ranges/spacesNiklas Haas2023-12-31
| | | | | Needed for fftools/ffmpeg_filter to be able to force specific output formats via the filter chain.
* avfilter/vf_format: re-use AVFilterFormats for pix_fmt parsingNiklas Haas2023-12-31
| | | | | | | | | | Rewrite the format parsing code to make it more easily generalizable. In particular, `invert_formats` does not depend on the type of format list passed to it, which allows me to re-use this helper in an upcoming commit. Slightly shortens the code, at the sole cost of doing several malloc (ff_add_format) instead of a single malloc.
* avfilter/buffersink: add color space/range accessorsNiklas Haas2023-12-31
| | | | Needed for fftools.
* avfilter/vf_libplacebo: switch to colorspace negotiation APINiklas Haas2023-12-31
|
* avfilter/vf_libplacebo: don't force dovi frames to bt.2020-nclNiklas Haas2023-12-31
| | | | | | | | This is at odds with the YUV matrix negotiation API, in which such dynamic changes in YUV encoding are no longer easily possible. There is also no really strong motivating reason to do this, since the choice of YUV matrix is essentially arbitrary and not actually related to the Dolby Vision decoding process.
* avfilter/vf_zscale: switch to colorspace negotiation APINiklas Haas2023-12-31
| | | | Following the same design as vf_scale.
* avfilter/vf_zscale: remove unused variablesNiklas Haas2023-12-31
| | | | Only assigned, never read.
* vf_scale: use colorspace negotiation APINiklas Haas2023-12-31
| | | | | | | | | | | | | This filter will always accept any input format, even if the user sets a specific in_range/in_color_matrix. This is to preserve status quo with current behavior, where passing a specific in_color_matrix merely overrides the incoming frames' attributes. (Use `vf_format` to force a specific input range) Because changing colorspace and color_range now requires reconfiguring the link, we can lift sws_setColorspaceDetails out of scale_frame and into config_props. (This will also get re-called if the input frame properties change)
* avfilter/buffersrc: add color_space/range parametersNiklas Haas2023-12-31
| | | | | | | To allow adding proper negotiation, in particular, to fftools. These values will simply be negotiated downstream for YUV formats, and ignored otherwise.
* avfilter: add negotiation API for color space/rangeNiklas Haas2023-12-31
| | | | | | | | | | | | | | | | | | | Motivated by YUVJ removal. This change will allow full negotiation between color ranges and matrices as needed. By default, all ranges and matrices are marked as supported. Because grayscale formats are currently handled very inconsistently (and in particular, assumed as forced full-range by swscale), we exclude them from negotiation altogether for the time being, to get this API merged. After filter negotiation is available, we can relax the grayscale-is-forced-jpeg restriction again, when it will be more feasible to do so without breaking a million test cases. Note that this commit updates one FATE test as a consequence of the sanity fallback for non-YUV formats. In particular, the test case now writes rgb24(pc, gbr/unspecified/unspecified) to the matroska file, instead of rgb24(unspecified/unspecified/unspecified) as before.
* avfilter/formats: set audio fmt lists for vaf filtersNiklas Haas2023-12-31
| | | | | | | | | | | | | | Currently, the logic inside the FF_FILTER_FORMATS_QUERY_FUNC branch prevents this code from running in the event that we have a filter with a single video input and a single audio output, as the resulting audio output link will not have its channel counts / samplerates correctly initialized to their default values, possibly triggering a segfault downstream. An example of such a filter is vaf_spectrumsynth. Although this particular filter already sets up the channel counts and samplerates as part of the query function and therefore avoids triggering this bug, the bug still exists in principle. (And importantly, sets a wrong precedent)
* avfilter: always call ff_default_query_formatsNiklas Haas2023-12-31
| | | | | | | | | | | | | | | Even if a query func is set. This is safe to do, because ff_default_query_formats is documented not to touch any filter lists that were already set by the query func. The reason to do this is because it allows us to extend AVFilterFormatsConfig without having to touch every filter in existence. An alternative implementation of this commit would be to explicitly add a `ff_default_query_formats` call at the end of every query_formats function, but that would end up functionally equivalent to this change while touching a whole lot more code paths for no reason. As a bonus, eliminates some code/logic duplication from this function.
* avfilter/formats: document ff_default_query_formatsNiklas Haas2023-12-31
| | | | | | In particular, make it clear that this function will not touch format lists which were already set by the caller before calling into this function.
* avfilter/vf_minterpolate: Check pts before divisionMichael Niedermayer2023-12-30
| | | | | | | | | Fixes: FPE Fixes: tickets/10758/poc20ffmpeg Discovered by Zeng Yunxiang Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/avf_showwaves: Check history_nb_samplesMichael Niedermayer2023-12-30
| | | | | | | | Fixes: out of array access Fixes: tickets/10756/poc18ffmpeg Discovered by Zeng Yunxiang Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavfilter/vf_dnn_detect: Add two outputs ssd supportWenbin Chen2023-12-30
| | | | | | | | | | | For this kind of model, we can directly use its output as final result just like ssd model. The difference is that it splits output into two tensors. [x_min, y_min, x_max, y_max, confidence] and [lable_id]. Model example refer to: https://github.com/openvinotoolkit/open_model_zoo/tree/master/models/intel/person-detection-0106 Signed-off-by: Wenbin Chen <wenbin.chen@intel.com> Reviewed-by: Guo Yejun <yejun.guo@intel.com>
* libavfilter/dnn_backend_openvino: Add dynamic output supportWenbin Chen2023-12-30
| | | | | | | | | Add dynamic outputs support. Some models don't have fixed output size. Its size changes according to result. Now openvino can run these kinds of models. Signed-off-by: Wenbin Chen <wenbin.chen@intel.com> Reviewed-by: Guo Yejun <yejun.guo@intel.com>
* avfilter/vf_vidstabdetect: Avoid double AVERRORSMichael Niedermayer2023-12-29
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/vf_swaprect: round coordinates downMichael Niedermayer2023-12-29
| | | | | | | | Fixes: out of array access: Fixes: tickets/10745/poc12ffmpeg Found-by: Li Zeyuan and Zeng Yunxiang. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/vf_swaprect: Use height for vertical variablesMichael Niedermayer2023-12-29
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/vf_swaprect: assert that rectangles are within memoryMichael Niedermayer2023-12-29
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/af_alimiter: Check nextpos before useMichael Niedermayer2023-12-29
| | | | | | | | Fixes: out of array read Fixes: tickets/10744/poc11ffmpeg Found-by: Li Zeyuan and Zeng Yunxiang. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/f_reverse: Apply PTS compensation only when pts is availableMichael Niedermayer2023-12-29
| | | | | | | | | Fixes: out of array access Fixes: tickets/10753/poc16ffmpeg Regression since: 45dc668aea0edac34969b5a1ff76cf9ad3a09be1 Found-by: Zeng Yunxiang Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>