[Libav-user] creating a new filter...

Richard Schilling coderroadie at gmail.com
Tue Mar 26 21:07:20 CET 2013


Greetings.

This is my first post.  I looked in the listserv archives but didn't find anyone talking about this, so here it goes.

I need to implement a new audio (audio only) filter.  I see the example code in filtering_audio.c that uses a buffer sink.  But, I'm having a hard time finding particulars on what everything means.  So, I'm hoping someone on this list can help.

My goal: I have an application that uses the FFMPG library.  I need to create a new custom audio  filter, say my_filter.c.

filtering_audio.c looks like the place to start. Is that correct?

In filtering_audio.c:

* Can I get a basic walk-through of the code in the function init_filters?  it looks like there is a source (AVFilter *abuffersrc) and sink buffer (AVFilter *abuffersing).   This looks like two filters.  How do I install just one filter?  I'm looking for a basic checklist here so I know that my calls to avfilter_graph_create_filter, av_filtergraph_parse, etc … are correct … .basically a walk-through of the example code.

* In avfilter_asink_abuffer (buffersink.c) I see .inputs and .outputs defined.  .inputs defines an AVFilterPad called "default".  .outputs defines no (NULL) filter pads.  How does this relate to this code in filtering_audio.c? 

    /* Endpoints for the filter graph. */
    outputs->name       = av_strdup("in");
    outputs->filter_ctx = buffersrc_ctx;
    outputs->pad_idx    = 0;
    outputs->next       = NULL;

    inputs->name       = av_strdup("out");
    inputs->filter_ctx = buffersink_ctx;
    inputs->pad_idx    = 0;
    inputs->next       = NULL;


Thank you in advance.

Cheers,
Richard Schilling
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20130326/f50d9c6c/attachment.html>


More information about the Libav-user mailing list