Hello, I'm a newcomer,

what I'm trying to do is decoding plus deinterlacing a interlaced
video. It seems the old technique was avpicture_deinterlace() but
seems deprecated [1] plus I need 1 frame per field. The solutions
seems to use yadif filter in libavfilter with options "1:-1". The
problem is that no simple example exists for libavfilter usage and it
seems that there's no open source software user of it in the entire
internet (interesting enough: libavfilter is just used in closed
source software by its original developers?). So what I'm asking here
is a little example of libavfilter usage. Please, don't point me
"ffplay.c": it's too much abstract (it creates a filters graph) to be
really used as an example. It folllows my discoveries so far. Q1 and
Q2 are the questions.

   /* Suppose I have a AVCodecContext pointer somewhere and I'm
      able to get the next decoded frame anytime */

    // Register all built-in filters
    avfilter_register_all();

    // Find the yadif filter
    AVFilter *yadif_filter = avfilter_get_by_name("yadif");

    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
    avfilter_init_filter(filter_ctx, "1:-1", NULL);

    /* Q1: Here I probably need to teach the filter context how to get the
       next frame from the AVCodecContext using AVFilter input/output
       pads (unclear). But how exactly? */

    for (;;)
    {
        /* Q2: Here I need to: 1) tell the filter context to get the
next frame from its
           source/input/output pads (unclear) and apply its logic; 2) Read the
           filtered frames (should be 2 per frame read, because I need
a deinterlace
           with 1 frame per filed). How I do 1) and 2) exactly? */
    }

Any hint is really appreciated.

Greetings,
Francesco

[1] http://web.archiveorange.com/archive/v/yR2T440EiUs3Cnped60b
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to