[FFmpeg-devel] avfilter_graph Question

Grady Player grady.player at verizondigitalmedia.com
Wed Oct 14 17:36:07 CEST 2015


Currently using:

commit af5917698bd44f136fd0ff00a9e5f8b5f92f2d58
Author: Michael Niedermayer <michaelni at gmx.at>
Date:   Sun May 17 01:34:35 2015 +0200

I am trying to set up a small filter graph in order to use the YADIF implementation in libavfilter...

I have set up an avfilter_graph with 3 filters…

    avfilter_register_all();
    avfGraph = avfilter_graph_alloc();
    
    AVFilter * bufferFilter, * yadifFilter, * bufferSink;
    
    bufferFilter = avfilter_get_by_name("buffer");
    yadifFilter = avfilter_get_by_name("yadif");
    bufferSink = avfilter_get_by_name("buffersink”);

  /* dynamic configuration here */
   
    avfilter_graph_create_filter(/*done for each filter */);
    
    if (err >= 0) err = avfilter_link(buffer_ctx, 0, yadif_ctx, 0);
    if (err >= 0) err = avfilter_link(yadif_ctx, 0, sink_ctx, 0);
    
    if (err>=0) err = avfilter_graph_config(avfGraph, NULL);


Then I feed frames into the graph with:

    err = av_buffersrc_add_frame(buffer_ctx, avf);

and pull frames out of the graph with:

  AVFrame * oframe = av_frame_alloc();
  err = av_buffersink_get_frame(sink_ctx, oframe);


 this all seems to work pretty well, except it is holding on to a lot of memory that is released in avfilter_graph_free()

I suspect it is something dumb, but is there something I need to be doing to release internal references to some resource?

 


More information about the ffmpeg-devel mailing list