[Libav-user] Libavfilter - Dynamic filtergraph reconfiguration

Nicolas George george at nsup.org
Mon Feb 1 21:07:42 EET 2021


ilkercan Kaya (12021-02-01):
> I am making a mobile music app where the user can add multiple different
> FXS at runtime to current playing music through a two dimensional pad with
> an effects header. I am using FFmpeg, libavfilter in C++ to add multiple FX
> to the audio.
> 
> My problem is, the user can disable any of the FX's I am using at any time
> as they wish, the effects I use are agate, lowpass, highpass. The graph is:
> 
> abuffer -> lowpass -> highpass -> agate -> aformat -> abuffersink.
> 
> >From time to time, I want to disable some of the following  lowpass,
> highpass, agate. So I thought I could just reconfigure the graph and
> basically get rid of links to fulfil my wish. I am not sure this is the
> right way to do it tho. I tried to dig online but all I could find was a
> thread from 2012 with no conclusion. Libavfilter documentation doesn't say
> anything about reconfigure or reset existing filtergraph (of that I could
> find).
> 
> What would be the best way to do this?

libavfilter does not support reconfiguration of a graph. You would need
to reinit the whole graph from scratch.

A simpler solution, if you only need to implement enabling and disabling
some of the filters, you can expect the "timeline" support does the
trick:

https://ffmpeg.org/doxygen/3.4/group__lavfi.html#ga00c4b8da7d5d89fa4ddc5dcdf72bffca

https://ffmpeg.org/ffmpeg-filters.html#Changing-options-at-runtime-with-a-command

https://ffmpeg.org/ffmpeg-filters.html#Timeline-editing

Regards,

-- 
  Nicolas George


More information about the Libav-user mailing list