Skip to content
jeanlf edited this page Dec 5, 2019 · 1 revision

HOME » Filters » FFMPEG AVFilter


Register name used to load filter: ffavf

This filter provides libavfilter raw audio and video tools. See FFMPEG documentation ( 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 buffer and 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 out

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 a
  • the logo source is identified as b
  • the filter declaration maps a to its first input (in this case, main video) and b to 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 out0 and out1
  • the inspecter only process stream with ffid out0
  • the video output only displays stream with ffid out1

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 com_name with value value to all filters
  • name#com_name=value: sends command com_name with value value to filter named name


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:*

HOME » Filters

GPAC Configuration

Configuration File
Global Options

Filters Overview

General Filters Concepts
gpac General Usage
Built-in Properties

Filters Help

Inspect packets (inspect)
Probe source (probe)
Compositor (compositor)
ISOBMFF/QT demuxer (mp4dmx)
MPEG-4 BIFS decoder (bifsdec)
MPEG-4 OD decoder (odfdec)
File input (fin)
BT/XMT/X3D loader (btplay)
HTTP input (httpin)
SVG loader (svgplay)
JPG/J2K/PNG/BMP reframer (rfimg)
PNG/JPG decoder (imgdec)
ADTS reframer (rfadts)
LATM reframer (rflatm)
MP3 reframer (rfmp3)
FAAD decoder (faad)
MAD decoder (maddec)
XVid decoder (xviddec)
OpenJPEG2000 decoder (j2kdec)
AC3 reframer (rfac3)
A52 decoder (a52dec)
AMR/EVRC reframer (rfamr)
OGG demuxer (oggdmx)
Vorbis decoder (vorbisdec)
Theora decoder (theoradec)
MPEG-2 TS demuxer (m2tsdmx)
UDP/TCP input (sockin)
OpenSVC decoder (osvcdec)
VideoToolBox decoder (vtbdec)
MPEG-4 LASeR decoder (lsrdec)
SAF demuxer (safdmx)
MPEG-DASH and HLS client (dashin)
CENC decryptor (cdcrypt)
CENC encryptor (cecrypt)
ISOBMFF/QT muxer (mp4mx)
QCP reframer (rfqcp)
H263 reframer (rfh263)
M1V/M2V/M4V reframer (rfmpgvid)
NHNT reader (nhntr)
NHML parser (nhmlr)
AVC/HEVC reframer (rfnalu)
MPEG PS demuxer (m2psdmx)
AVI demuxer (avidmx)
Subtitle loader (txtin)
TTXT/TX3G decoder (ttxtdec)
WebVTT decoder (vttdec)
RTP/RTSP/SDP input (rtpin)
File output (fout)
Raw AAC to LATM writer (uflatm)
ADTS writer (ufadts)
Media Reframer (reframer)
Stream to file (writegen)
AVC/HEVC to AnnexB writer (ufnalu)
QCP writer (writeqcp)
WebVTT writer (writevtt)
NHNT writer (nhntw)
NHML writer (nhmlw)
VobSub demuxer (vobsubdmx)
AVI muxer (avimx)
Audio output (aout)
M4V writer (ufm4v)
Audio resampler (resample)
Video output (vout)
Video crop (vcrop)
Video flip (vflip)
RAW video reframer (rfrawvid)
PCM reframer (rfpcm)
JPG encoder (jpgenc)
PNG encoder (pngenc)
Audio/Video rewinder (rewind)
Sources concatenator (flist)
MPEG-2 TS muxer (m2tsmx)
DASH and HLS segmenter (dasher)
HEVC tile aggregator (tileagg)
pipe input (pin)
pipe output (pout)
GSF Muxer (gsfmx)
GSF Demuxer (gsfdmx)
UDP/TCP output (sockout)
AV1/IVF/VP9 reframer (rfav1)
IVF/OBU/annexB writer (ufobu)
ATSC input (atscin)
RTP Streamer (rtpout)
RTSP Server (rtspout)
HTTP Server (httpout)
HEVC tile spliter (hevcsplit)
HEVC Tile merger (hevcmerge)
FLAC reframer (rfflac)
ProRes reframer (rfprores)
MPEG Transport Stream splitter (tssplit)
FFMPEG demuxer (ffdmx)
FFMPEG decoder (ffdec)
FFMPEG AV Capture (ffavin)
FFMPEG video rescaler (ffsws)
FFMPEG encoder (ffenc)
FFMPEG muxer (ffmx)
FFMPEG AVFilter (ffavf)
JavaScript filter (jsf)
OpenHEVC decoder (ohevcdec)

Clone this wiki locally
You can’t perform that action at this time.