c++ - ffmpeg yadif 去隔行

标签 c++ ffmpeg

我正在尝试在我的 C++ 程序中使用 ffmpeg 去隔行扫描视频。 首先,我使用了 avpicture_deinterlace 但已弃用。

寻找更多信息,我在 avfilter_register_all() 之后尝试了 avfilter_get_by_name("yadif") 但总是返回 NULL 。我也尝试了下一个代码,但仍然无法正常工作。我在 avfilter_init_str 函数中尝试了不同的参数,但是 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 过滤器

欢迎任何帮助。

最佳答案

在较旧的 FFmpeg 版本中,yadif 仅在使用 --enable-gpl 配置选项时才被编译。您可能需要更新到更高版本或使用 --enable-gpl 重新编译旧版本。

关于c++ - ffmpeg yadif 去隔行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30614302/

相关文章:

c++ - 指向引用参数的指针

c++ - constexpr 结构是否被零初始化?

android - 为什么 FFMPEG 命令在棉花糖和 Lollipop 中不起作用?

python - 您可以直接从数据库中使用 ffmpeg 拆分文件吗?

c++ - 如何在 E_NOTIMPL 和 E_NOINTERFACE 之间进行选择?

c++ - 使用 g++ 编译多线程代码(-Wl,--no-as-needed 不工作)

Javadoc 文档就地呈现。可以在 IDE 中看到 pretty-print 文档吗?

ffmpeg - 如何重命名 m3u8 播放列表中的 ts 文件

windows - FFMPEG 的输入参数

ffmpeg - 为什么 ffmpeg 错误/警告 : Past duration 0. 933205 太大?将桌面录制为视频文件时会得到很多