[FFmpeg-devel] Getting info out of filters? (particularly af_silencedetect)

Stefano Sabatini stefasab at gmail.com
Sat Aug 18 17:36:38 CEST 2012

On date Saturday 2012-08-18 08:41:22 -0600, Michael Bradshaw encoded:
> Hi,
> I'd like to run the silencedetect audio filter in my program and do
> some silence removal, but first I need to know when that silence is.
> Looking at the silencedetect filter, it just prints out silent
> segments to the console. Is there an already existing way in the API
> for filters to report information back to the user (without logging)?
> If so, can someone help point it out to me so I can work up a patch?
> If not, can we discuss ways of adding information reporting to the
> filter API?
> Thanks,

There was some discussions and different potential solutions, in this
case I suppose commands API or metadata injection will do.

With commands: you broadcast a command with the information when a
silence interval is detected, a custom filter reads the event and acts
accordingly (e.g. changing its internal state).

With metadata injection: you add metadata to the samples frame,
telling if it is considered silence or not, then read/process the
metadata in a custom filter.

Metadata in lavfi is partially implemented in this repository:
FFmpeg = Faithful & Fundamentalist Maxi Puritan Erroneous Gymnast

More information about the ffmpeg-devel mailing list