gaspard7/wiki_gpac huggingface dataset:
Options  {.no-collapse}

<div markdown class="option">  
<a id="grid" data-level="basic">__grid__</a> (v2di, default: _6x0_): number of images per lines and columns  
</div>  
<div markdown class="option">  
<a id="scale" data-level="basic">__scale__</a> (dbl, default: _-1_): scale factor for input size  
</div>  
<div markdown class="option">  
<a id="mae">__mae__</a> (uint, default: _0_, minmax: 0,100): scene diff threshold using Mean Absolute Error  
</div>  
<div markdown class="option">  
<a id="mse">__mse__</a> (uint, default: _0_, minmax: 0,100): scene diff threshold using Mean Square Error  
</div>  
<div markdown class="option">  
<a id="lw">__lw__</a> (dbl, default: _0.0_): line width between images in pixels  
</div>  
<div markdown class="option">  
<a id="lc">__lc__</a> (str, default: _white_): line color  
</div>  
<div markdown class="option">  
<a id="clear">__clear__</a> (str, default: _white_): clear color  
</div>  
<div markdown class="option">  
<a id="snap" data-level="basic">__snap__</a> (dbl, default: _-1_): duration between images, 0 for all images  
</div>  
<div markdown class="option">  
<a id="maxsnap" data-level="basic">__maxsnap__</a> (dbl, default: _-1_): maximum duration between two thumbnails when scene change detection is enabled  
</div>  
<div markdown class="option">  
<a id="pfmt">__pfmt__</a> (pfmt, default: _rgb_): output pixel format  
</div>  
<div markdown class="option">  
<a id="txt">__txt__</a> (str, default: __): text to insert per thumbnail  
</div>  
<div markdown class="option">  
<a id="tc">__tc__</a> (str, default: _white_): text color  
</div>  
<div markdown class="option">  
<a id="tb">__tb__</a> (str, default: _black_): text shadow  
</div>  
<div markdown class="option">  
<a id="font">__font__</a> (str, default: _SANS_): font to use  
</div>  
<div markdown class="option">  
<a id="fs">__fs__</a> (dbl, default: _10_): font size to use in percent of scaled height  
</div>  
<div markdown class="option">  
<a id="tv">__tv__</a> (dbl, default: _0_): text vertical position in percent of scaled height  
</div>  
<div markdown class="option">  
<a id="thread">__thread__</a> (sint, default: _-1_): number of threads for software rasterizer, -1 for all available cores  
</div>  
<div markdown class="option">  
<a id="blt">__blt__</a> (bool, default: _true_): use blit instead of software rasterizer  
</div>  
<div markdown class="option">  
<a id="scref">__scref__</a> (bool, default: _false_): use last inserted image as reference for scene change detection  
</div>  
<div markdown class="option">  
<a id="dropfirst">__dropfirst__</a> (bool, default: _false_): drop first image  
</div>  
<div markdown class="option">  
<a id="list">__list__</a> (str, default: _null_): export json list of frame times and positions to given file  
</div>  
<div markdown class="option">  
<a id="lxy">__lxy__</a> (bool, default: _false_): add explicit x and y in json export  
</div>
FFmpeg encoder

Register name used to load filter: __ffenc__  
This filter may be automatically loaded during graph resolution.  
  
This filter encodes audio and video streams using FFmpeg.  
See FFmpeg documentation [FFmpeg Documentation](https://ffmpeg.org/documentation.html)for more details.  
To list all supported encoders for your GPAC build, use `gpac -h ffenc:*`.  
  
The filter will try to resolve the codec name in [c](#c) against a libavcodec codec name (e.g. `libx264`) and use it if found.  
If not found, it will consider the name to be a GPAC codec name and find a codec for it. In that case, if no pixel format is given, codecs will be enumerated to find a matching pixel format.  
  
Options can be passed from prompt using `--OPT=VAL` (global options) or appending `::OPT=VAL` to the desired encoder filter.  
  
The filter will look for property `TargetRate` on input PID to set the desired bitrate per PID.  
  
The filter will force a closed gop boundary:  

- at each packet with a `FileNumber` property set or a `CueStart` property set to true.  
- if [fintra](#fintra) and [rc](#rc) is set.  

  
When forcing a closed GOP boundary, the filter will flush, destroy and recreate the encoder to make sure a clean context is used, as currently many encoders in libavcodec do not support clean reset when forcing picture types.  
If [fintra](#fintra) is not set and the output of the encoder is a DASH session in live profile without segment timeline, [fintra](#fintra) will be set to the target segment duration and [rc](#rc) will be set.  
  
The filter will look for property `logpass` on input PID to set 2-pass log filename, otherwise defaults to `ffenc2pass-PID.log`.  
  
Arguments may be updated at runtime. If [rld](#rld) is set, the encoder will be flushed then reloaded with new options.  
If codec is video and [fintra](#fintra) is set, reload will happen at next forced intra; otherwise, reload happens at next encode.  
The [rld](#rld) option is usually needed for dynamic updates of rate control parameters, since most encoders in ffmpeg do not support it.
Options  {.no-collapse}

<div markdown class="option">  
<a id="c" data-level="basic">__c__</a> (str): codec identifier. Can be any supported GPAC codec name or ffmpeg codec name - updated to ffmpeg codec name after initialization  
</div>  
<div markdown class="option">  
<a id="pfmt" data-level="basic">__pfmt__</a> (pfmt, default: _none_): pixel format for input video. When not set, input format is used  
</div>  
<div markdown class="option">  
<a id="fintra" data-level="basic">__fintra__</a> (frac, default: _-1/1_): force intra / IDR frames at the given period in sec, e.g. `fintra=2` will force an intra every 2 seconds and `fintra=1001/1000` will force an intra every 30 frames on 30000/1001=29.97 fps video; ignored for audio  
</div>  
<div markdown class="option">  
<a id="all_intra">__all_intra__</a> (bool, default: _false_, updatable): only produce intra frames  
</div>  
<div markdown class="option">  
<a id="ls">__ls__</a> (bool, default: _false_): log stats  
</div>  
<div markdown class="option">  
<a id="rc">__rc__</a> (bool, default: _false_): reset encoder when forcing intra frame (some encoders might not support intra frame forcing)  
</div>  
<div markdown class="option">  
<a id="rld">__rld__</a> (bool, default: _false_, updatable): force reloading of encoder when arguments are updated  
</div>  
<div markdown class="option">  
<a id="*" data-level="basic">__*__</a> (str): any possible options defined for AVCodecContext and sub-classes. see `gpac -hx ffenc` and `gpac -hx ffenc:*`  
</div>
GSF demultiplexer

Register name used to load filter: __gsfdmx__  
This filter may be automatically loaded during graph resolution.  
  
This filter provides GSF (_GPAC Serialized Format_) demultiplexing.  
It de-serializes the stream states (config/reconfig/info update/remove/eos) and packets in the GSF bytestream.  
This allows either reading a session saved to file, or receiving the state/data of streams from another instance of GPAC using either pipes or sockets  
  
The stream format can be encrypted in AES 128 CBC mode, in which case the demultiplexing filter must be given a 128 bit key.
Options  {.no-collapse}

<div markdown class="option">  
<a id="key">__key__</a> (mem): key for decrypting packets  
</div>  
<div markdown class="option">  
<a id="magic">__magic__</a> (str): magic string to check in setup packet  
</div>  
<div markdown class="option">  
<a id="mq">__mq__</a> (uint, default: _4_): set max packet queue length for loss detection. 0 will flush incomplete packet when a new one starts  
</div>  
<div markdown class="option">  
<a id="pad">__pad__</a> (uint, default: _0_, minmax: 0-255): byte value used to pad lost packets  
</div>
pipe output

Register name used to load filter: __pout__  
This filter may be automatically loaded during graph resolution.  
  
This filter handles generic output pipes (mono-directional) in blocking mode only.  

__Warning: Output pipes do not currently support non blocking mode.__  
  
The associated protocol scheme is `pipe://` when loaded as a generic output (e.g. -o `pipe://URL` where URL is a relative or absolute pipe name).  
Data format of the pipe __shall__ be specified using extension (either in filename or through [ext](#ext) option) or MIME type through [mime](#mime)  
The pipe name indicated in [dst](#dst) can use template mechanisms from gpac, e.g. `dst=pipe_$ServiceID$`  
  
On Windows hosts, the default pipe prefix is `\\.\pipe\gpac\` if no prefix is set   
`dst=mypipe` resolves in `\\.\pipe\gpac\mypipe`  
`dst=\\.\pipe\myapp\mypipe` resolves in `\\.\pipe\myapp\mypipe`  
Any destination name starting with `\\` is used as is, with `\` translated in `/`  
  
The pipe input can create the pipe if not found using [mkp](#mkp). On windows hosts, this will create a pipe server.  
On non windows hosts, the created pipe will delete the pipe file upon filter destruction.  
The pipe can be kept alive after a broken pipe is detected using [ka](#ka). This is typically used when clients crash/exits and resumes.  
When a keep-alive pipe is broken, input data is discarded and the filter will keep trashing data as fast as possible.  
It is therefore recommended to use this mode with real-time inputs (use a [reframer](reframer) if needed).  
If [marker](#marker) is set, the string `GPACPIF` (8 bytes including 0-terminator) will be written to the pipe at each detected pipeline flush.  
Pipeline flushing is currently triggered by DASH segment end or ISOBMF fragment end.
Options  {.no-collapse}

<div markdown class="option">  
<a id="dst" data-level="basic">__dst__</a> (cstr): name of destination pipe  
</div>  
<div markdown class="option">  
<a id="ext" data-level="basic">__ext__</a> (str): indicate file extension of pipe data  
</div>  
<div markdown class="option">  
<a id="mime" data-level="basic">__mime__</a> (str): indicate mime type of pipe data  
</div>  
<div markdown class="option">  
<a id="dynext">__dynext__</a> (bool, default: _false_): indicate the file extension is set by filter chain, not dst  
</div>  
<div markdown class="option">  
<a id="start" data-level="basic">__start__</a> (dbl, default: _0.0_): set playback start offset. A negative value means percent of media duration with -1 equal to duration  
</div>  
<div markdown class="option">  
<a id="speed" data-level="basic">__speed__</a> (dbl, default: _1.0_): set playback speed. If negative and start is 0, start is set to -1  
</div>  
<div markdown class="option">  
<a id="mkp" data-level="basic">__mkp__</a> (bool, default: _false_): create pipe if not found  
</div>  
<div markdown class="option">  
<a id="block_size">__block_size__</a> (uint, default: _5000_): buffer size used to write to pipe, Windows only  
</div>  
<div markdown class="option">  
<a id="ka">__ka__</a> (bool, default: _false_): keep pipe alive when broken pipe is detected  
</div>  
<div markdown class="option">  
<a id="marker">__marker__</a> (bool, default: _false_): inject marker upon pipeline flush events  
</div>
Options  {.no-collapse}

<div markdown class="option">  
<a id="index" data-level="basic">__index__</a> (dbl, default: _1.0_): indexing window length  
</div>  
<div markdown class="option">  
<a id="expart" data-level="basic">__expart__</a> (bool, default: _false_): expose pictures as a dedicated video PID  
</div>  
<div markdown class="option">  
<a id="forcemp3">__forcemp3__</a> (bool, default: _true_): force mp3 signaling for MPEG-2 Audio layer 3  
</div>
Options  {.no-collapse}

<div markdown class="option">  
<a id="frame_size">__frame_size__</a> (uint, default: _1024_): size of AAC frame in audio samples  
</div>  
<div markdown class="option">  
<a id="index" data-level="basic">__index__</a> (dbl, default: _1.0_): indexing window length  
</div>
Regular mode

This is the default mode, in which the filter produces media PIDs and frames from sources indicated in the manifest.  
The default behavior is to perform adaptation according to [algo](#algo), but the filter can:  

- run with no adaptation, to grab maximum quality.  

Example
```
gpac -i MANIFEST_URL:algo=none:start_with=max_bw -o dest.mp4
```
  

- run with no adaptation, fetching all qualities.  

Example
```
gpac -i MANIFEST_URL:split_as -o dst=$File$.mp4
```
File mode

When [forward](#forward) is set to `file`, the client forwards media files without demultiplexing them.  
This is mostly used to expose the DASH session to a file server such as ROUTE or HTTP.  
In this mode, the manifest is forwarded as an output PID.  

__Warning: This mode cannot be set through inheritance as it changes the link capabilities of the filter. The filter MUST be explicitly declared.__  
  
To expose a live DASH session to route:  
Example
```
gpac -i MANIFEST_URL dashin:forward=file -o route://225.0.0.1:8000/
```
  
  
If the source has dependent media streams (scalability) and all qualities and initialization segments need to be forwarded, add [split_as](#split_as).
Segment bound modes

When [forward](#forward) is set to `segb` or `mani`, the client forwards media frames (after demultiplexing) together with segment and fragment boundaries of source files.  
  
This mode can be used to process media data and regenerate the same manifest/segmentation.  
  
Example
```
gpac -i MANIFEST_URL:forward=mani cecrypt:cfile=DRM.xml -o encrypted/live.mpd:pssh=mv
```
  
This will encrypt an existing DASH session, inject PSSH in manifest and segments.  
  
Example
```
gpac -i MANIFEST_URL:forward=segb cecrypt:cfile=DRM.xml -o encrypted/live.m3u8
```
  
This will encrypt an existing DASH session and republish it as HLS, using same segment names and boundaries.  
  
This mode will force [noseek](#noseek)=`true` to ensure the first segment fetched is complete, and [split_as](#split_as)=`true` to fetch all qualities.  
  
Each first packet of a segment will have the following properties attached:  

- `CueStart`: indicate this is a segment start  
- `FileNumber`: current segment number  
- `FileName`: current segment file name without manifest (MPD or master HLS) base url  
- `DFPStart`: set with value `0` if this is the first packet in the period, absent otherwise  

  
If [forward](#forward) is set to `mani`, the first packet of a segment dispatched after a manifest update will also carry the manifest payload as a property:  

- `DFManifest`: contains main manifest (MPD, M3U8 master)  
- `DFVariant`: contains list of HLS child playlists as strings for the given quality  
- `DFVariantName`: contains list of associated HLS child playlists name, in same order as manifests in `DFVariant`  

  
Each output PID will have the following properties assigned:  

- `DFMode`: set to 1 for `segb` or 2 for `mani`  
- `DCue`: set to `inband`  
- `DFPStart`: set to current period start value  
- `FileName`: set to associated init segment if any  
- `Representation`: set to the associated representation ID in the manifest  
- `DashDur`: set to the average segment duration as indicated in the manifest  
- `source_template`: set to true to indicate the source template is known  
- `stl_timescale`: timescale used by SegmentTimeline, or 0 if no SegmentTimeline  
- `init_url`: unresolved intialization URL (as it appears in the MPD or in the variant playlist)  
- `manifest_url`: manifest URL  
- `hls_variant_name`: HLS variant playlist name (as it appears in the HLS master playlist)  

  
When the [dasher](dasher) is used together with this mode, this will force all generated segments to have the same name, duration and fragmentation properties as the input ones. It is therefore not recommended for sessions stored/generated on local storage to generate the output in the same directory.
Sources concatenator

Register name used to load filter: __flist__  
This filter may be automatically loaded during graph resolution.  
This filter requires the graph resolver to be activated.  
  
This filter can be used to play playlist files or a list of sources.  
  
The filter loads any source supported by GPAC: remote or local files or streaming sessions (TS, RTP, DASH or other).  
The filter demultiplexes inputs and recomputes input timestamps into a continuous timeline.  
At each new source, the filter tries to remap input PIDs to already declared output PIDs of the same type, if any, or declares new output PIDs otherwise. If no input PID matches the type of an output, no packets are send for that PID.
Source list mode

The source list mode is activated by using `flist:srcs=f1[,f2]`, where f1 can be a file or a directory to enumerate.  
The syntax for directory enumeration is:  

- dir, dir/ or dir/*: enumerates everything in directory `dir`  
- foo/*.png: enumerates all files with extension png in directory `foo`  
- foo/*.png;*.jpg: enumerates all files with extension png or jpg in directory `foo`  

  
The resulting file list can be sorted using [fsort](#fsort).  
If the sort mode is `datex` and source files are images or single frame files, the following applies:  

- options [floop](#floop), [revert](#revert) and [fdur](#fdur) are ignored  
- the files are sorted by modification time  
- the first frame is assigned a timestamp of 0  
- each frame (coming from each file) is assigned a duration equal to the difference of modification time between the file and the next file  
- the last frame is assigned the same duration as the previous one  

  
When sorting by names:  

- shorter filenames are inserted before longer filenames  
- alphabetical sorting is used if same filename length
Playlist mode

The playlist mode is activated when opening a playlist file (m3u format, utf-8 encoding, no BOM, default extensions `m3u`, `txt` or `pl`).  
In this mode, directives can be given in a comment line, i.e. a line starting with `#` before the line with the file name.  
Lines stating with `##` are ignored.  
  
The playlist file is refreshed whenever the next source has to be reloaded in order to allow for dynamic pushing of sources in the playlist.  
If the last URL played cannot be found in the playlist, the first URL in the playlist file will be loaded.  
  
When [ka](#ka) is used to keep refreshing the playlist on regular basis, the playlist must end with a new line.  
Playlist refreshing will abort:  

- if the input playlist has a line not ending with a LF `(\n)` character, in order to avoid asynchronous issues when reading the playlist.  
- if the input playlist has not been modified for the [timeout](#timeout) option value (infinite by default).
Playlist directives

A playlist directive line can contain zero or more directives, separated with space. The following directives are supported:  

- repeat=N: repeats `N` times the content (hence played N+1).  
- start=T: tries to play the file from start time `T` seconds (double format only). This may not work with some files/formats not supporting seeking.  
- stop=T: stops source playback after `T` seconds (double format only). This works on any source (implemented independently from seek support).  
- cat: specifies that the following entry should be concatenated to the previous source rather than opening a new source. This can optionally specify a byte range if desired, otherwise the full file is concatenated.  

_Note: When sources are ISOBMFF files or segments on local storage or GF_FileIO objects, the concatenation will be automatically detected._  

- srange=T: when cat is set, indicates the start `T` (64 bit decimal, default 0) of the byte range from the next entry to concatenate.  
- send=T: when cat is set, indicates the end `T` (64 bit decimal, default 0) of the byte range from the next entry to concatenate.  
- props=STR: assigns properties described in `STR` to all PIDs coming from the listed sources on next line. `STR` is formatted according to `gpac -h doc` using the default parameter set.  
- del: specifies that the source file(s) must be deleted once processed, true by default if [fdel](#fdel) is set.  
- out=V: specifies splicing start time (cf below).  
- in=V: specifies splicing end time (cf below).  
- nosync: prevents timestamp adjustments when joining sources (implied if `cat` is set).  
- keep: keeps spliced period in output (cf below).  
- mark: only inject marker for the splice period and do not load any replacement content (cf below).  
- sprops=STR: assigns properties described in `STR` to all PIDs of the main content during a splice (cf below). `STR` is formatted according to `gpac -h doc` using the default parameter set.  
- chap=NAME: assigns chapter name at the start of next URL (filter always removes source chapter names).  

  
The following global options (applying to the filter, not the sources) may also be set in the playlist:  

- ka=N: force [ka](#ka) option to `N` millisecond refresh.  
- floop=N: set [floop](#floop) option from within playlist.  
- raw: set [raw](#raw) option from within playlist.  

  
The default behavior when joining sources is to realign the timeline origin of the new source to the maximum time in all PIDs of the previous sources.  
This may create gaps in the timeline in case previous source PIDs are not of equal duration (quite common with most audio codecs).  
Using `nosync` directive will disable this realignment and provide a continuous timeline but may introduce synchronization errors depending in the source encoding (use with caution).
Source syntax

The source lines follow the usual source syntax, see `gpac -h`.  
Additional PID properties can be added per source (see `gpac -h doc`), but are valid only for the current source, and reset at next source.  
The loaded sources do not inherit arguments from the parent playlist filter.  
  
The URL given can either be a single URL, or a list of URLs separated by " && " to load several sources for the active entry.  

__Warning: There shall not be any other space/tab characters between sources.__  
  
Example
```
audio.mp4 && video.mp4
```
Source with filter chains

Each URL can be followed by a chain of one or more filters, using the `@` link directive as used in gpac (see `gpac -h doc`).  
A negative link index (e.g. `@-1`) can be used to setup a new filter chain starting from the last specified source in the line.  

__Warning: There shall be a single character, with value space (' '), before and after each link directive.__  
  
Example
```
src.mp4 @ reframer:rt=on
```
  
This will inject a reframer with real-time regulation between source and `flist` filter.  
Example
```
src.mp4 @ reframer:saps=1 @1 reframer:saps=0,2,3  
src.mp4 @ reframer:saps=1 @-1 reframer:saps=0,2,3
```
  
This will inject a reframer filtering only SAP1 frames and a reframer filtering only non-SAP1 frames between source and `flist` filter  
  
Link options can be specified (see `gpac -h doc`).  
Example
```
src.mp4 @#video reframer:rt=on
```
  
This will inject a reframer with real-time regulation between video PID of source and `flist` filter.  
  
When using filter chains, the `flist` filter will only accept PIDs from the last declared filter in the chain.  
In order to accept other PIDs from the source, you must specify a final link directive with no following filter.  
Example
```
src.mp4 @#video reframer:rt=on @-1#audio
```
  
This will inject a reframer with real-time regulation between video PID of source and `flist` filter, and will also allow audio PIDs from source to connect to `flist` filter.  
  
The empty link directive can also be used on the last declared filter  
Example
```
src.mp4 @ reframer:rt=on @#audio
```
  
This will inject a reframer with real-time regulation between source and `flist` filter and only connect audio PIDs to `flist` filter.