I'm trying deinterlacing video with ffmpeg in my C++ program.
First of all, i used avpicture_deinterlace
but is deprecated.
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\"");
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.
Any help could be welcome.