【发布时间】:2015-06-04 00:01:02
【问题描述】:
我正在尝试在我的 C++ 程序中使用 ffmpeg 对视频进行去隔行扫描。
首先,我使用了avpicture_deinterlace,但已弃用。
寻找更多信息,我在avfilter_register_all()之后尝试了avfilter_get_by_name("yadif"),但总是返回NULL。我也尝试了下一个代码,但仍然无法正常工作。我在avfilter_init_strfunction中尝试了不同的参数,但是err总是小于0,这意味着有错误。
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 过滤器。
欢迎任何帮助。
【问题讨论】: