[Libav-user] How to use libavfilter?

Stefano Sabatini stefasab at gmail.com
Mon Nov 18 13:49:17 CET 2013

On date Saturday 2013-11-16 13:59:32 +0000, Stepan Bujnak nutted:
> Hi ffmpeg,
> I am trying to use FPS filter in my code but I wasn't able to find any
> manual or tutorial that would describe using libavfilter. Could anyone
> explain what steps need to be undertaken in order to successfully employ
> the FPS filter in my code? I looked at the doc/examples/video_filtering.c
> but it is unclear on whether I need to use buffer and buffersink, and
> whether the filter is being employed automatically or I need to call the
> filtering myself. Thank you.

If you need to push frames to the filtergraph: use the buffer source.
If you need to pull frames from the filtergraph: use the buffer sink.

Note that if you only need to pull frames, you could probably make use
of the movie source.

About the other question, keep in mind that you can manually "build" a
filtergraph without relying on the parsing facilities, so all you may
need to do would be to concatenate an fps filter to the movie, and
then the sink to the fps, and extract frames from the sink.

Another possibility would be to read from the lavfi device, but it is
not probably the most efficient solution, so it depends on what you
want to do.

More information about the Libav-user mailing list