3

I'm trying deinterlacing video with ffmpeg in my C++ program. First of all, i used avpicture_deinterlacebut 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_strfunction buterris 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 AVFramebut I don't know how to apply de yadif filter to it.

Any help could be welcome.

f3r83
  • 83
  • 2
  • 10

1 Answers1

1

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.

Ronald S. Bultje
  • 10,828
  • 26
  • 47
  • Thanks for the tip, but i'm using the latest FFmpeg release pack, the FFmpeg 2.6.3 "Grothendieck" – f3r83 Jun 08 '15 at 07:53
  • In that case, avfilter_get_by_name("yadif") should work, see e.g. https://lists.libav.org/pipermail/libav-user/2011-March/006188.html - for init you would use err = avfilter_init_str(filter_ctx, "yadif=1:-1");. I don't know why that wouldn't work (with the latest release). – Ronald S. Bultje Jun 08 '15 at 11:19
  • Ok, It's my fault. I've inherited the compiled libs. I've just reviewed the script to compile FFmpeg in Windows and the flag `--disable-filters` was there. Thanks for all! – f3r83 Jun 08 '15 at 14:11