ffmpeg yadif去隔行 [英] c++ - ffmpeg yadif deinterlacing
问题描述
我正在尝试在我的C ++程序中使用ffmpeg对视频进行隔行扫描.首先,我使用了 avpicture_deinterlace
,但已弃用.
I'm trying deinterlacing video with ffmpeg in my C++ program.
First of all, i used avpicture_deinterlace
but is deprecated.
寻找更多信息,我在 avfilter_register_all()
之后尝试了 avfilter_get_by_name("yadif")
,但始终返回 NULL
.我也尝试了下一个代码,但仍然无法正常工作.我在 avfilter_init_str
函数中尝试了不同的参数,但是 err
始终小于0,这意味着有错误.
Looking for more information, I've tried avfilter_get_by_name("yadif")
after avfilter_register_all()
but always return NULL
. I've tried the next code too, but still not working. I've tried different parameters in avfilter_init_str
function buterr
is always less than 0, that means there is an error.
int err;
// Register all built-in filters
avfilter_register_all();
// Find the yadif filter
AVFilter *yadif_filter = avfilter_get_by_name("buffer");
AVFilterContext *filter_ctx;
// Create the filter context with yadif filter
avfilter_open(&filter_ctx, yadif_filter, NULL);
// Init the yadif context with "1:-1" option
err = avfilter_init_str(filter_ctx, "\"yadif=1:-1\"");
我知道 filtering_video.c
文件是了解如何构建过滤器的一个很好的起点,但是我不想构建一个过滤器,我只需要使用 yadif 去隔行滤波器.我有 AVFrame
,但是我不知道如何对它应用de yadif过滤器.
I know filtering_video.c
file is a good start point to understand how to build a filter but I don't want to build one, I only need to use the yadif deinterlacing filter. I have the AVFrame
but I don't know how to apply de yadif filter to it.
任何帮助都可以.
推荐答案
在较早的FFmpeg版本中,仅在使用--enable-gpl configure选项时才编译yadif.您可能需要更新至更高版本,或使用--enable-gpl重新编译旧版本.
In older FFmpeg releases, yadif was only compiled if --enable-gpl configure option was used. You probably need to update to a later release or re-compile the old release with --enable-gpl.
这篇关于ffmpeg yadif去隔行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!