Register name used to load filter: ffavf
This filter provides libavfilter raw audio and video tools. See FFMPEG documentation (https://ffmpeg.org/documentation.html) for more details
Declaring a filter
The filter loads a filter or a filter chain description from the f option.
Unlike other FFMPEG bindings in GPAC, this filter does not parse other libavfilter options, you must specify them directly in the filter chain, and the f option will have to be escaped.
ffavf::f=showspectrum=size=320x320 or ffavf::f=showspectrum=size=320x320::pfmt=rgb
The filter will automatically create
buffersink AV filters for data exchange between GPAC and libavfilter.
The builtin options ( pfmt, afmt ...) can be used to configure the
buffersink filter to set the output format of the filter.
Naming of PIDs
For simple filter graphs with only one input and one output, the input PID is assigned the avfilter name
in and the output PID is assigned the avfilter name
When a graph has several inputs, input PID names shall be assigned by the user using the
ffid property, and mapping must be done in the filter.
src=video:#ffid=a src=logo:#ffid=b ffavf::f=[a][b]overlay=main_w-overlay_w-10:main_h-overlay_h-10
In this example:
- the video source is identified as
- the logo source is identified as
- the filter declaration maps
ato its first input (in this case, main video) and
bto its second input (in this case the overlay)
When a graph has several outputs, output PIDs will be identified using the
ffid property set to the output avfilter name.
src=source ffavf::f=split inspect:SID=#ffid=out0 vout#SID=out1
In this example:
- the spliter produces 2 video streams
- the inspecter only process stream with ffid
- the video output only displays stream with ffid
The name(s) of the final output of the avfilter graph cannot be configured in GPAC. You can however name intermediate output(s) in a complex filter chain as usual.
Filter graph commands
The filter handles option updates as commands passed to the AV filter graph. The syntax expected in the option name is:
- com_name=value: sends command
valueto all filters
- name#com_name=value: sends command
valueto filter named
f (string): filter or filter chain description - see filter help
pfmt (pixel format, default: none): pixel format of output. If not set, let AVFilter decide
afmt (audio format, default: none): audio format of output. If not set, let AVFilter decide
sr (unsigned int, default: 0): sample rate of output. If not set, let AVFilter decide
ch (unsigned int, default: 0): number of channels of output. If not set, let AVFilter decide
dump (boolean, default: false, updatable): dump graph as log madia@info or stderr if not set
* (string): any possible options defined for AVFilter and sub-classes. See
gpac -hx ffavf and
gpac -hx ffavf:*