[FFmpeg-devel] avfilter_graph Question

Grady Player grady.player at verizondigitalmedia.com
Wed Oct 14 22:13:42 CEST 2015


Figured it out, sharing (if anyone were to care)…

I was using 
     av_buffersrc_add_frame
rather than: 
     av_buffersrc_write_frame

which informs the buffer to retain an internal reference to the original picture/frame..

-Grady


On Oct 14, 2015, at 11:50 AM, Grady Player <grady.player at verizondigitalmedia.com> wrote:

> Yes, sorry this was omitted  - after I am done I call:
>  
> av_frame_free(&oframe);
> 
> it seems to be something that is internally referenced by the graph...
> 
> 
> On Oct 14, 2015, at 10:50 AM, Paul B Mahol <onemda at gmail.com> wrote:
> 
>> Dana 14. 10. 2015. 17:36 osoba "Grady Player" <
>> grady.player at verizondigitalmedia.com> napisala je:
>>> 
>>> 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?
>>> 
>>> 
>>> 
>> 
>> Do you free frame you no longer need?
>> _______________________________________________
>>> ffmpeg-devel mailing list
>>> ffmpeg-devel at ffmpeg.org
>>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>> _______________________________________________
>> ffmpeg-devel mailing list
>> ffmpeg-devel at ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 



More information about the ffmpeg-devel mailing list