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

<div markdown class="option">  
<a id="pl" data-level="basic">__pl__</a> (str, default: _avmix.json_): local playlist file to load  
</div>  
<div markdown class="option">  
<a id="live" data-level="basic">__live__</a> (bool, default: _true_): live mode  
</div>  
<div markdown class="option">  
<a id="gpu">__gpu__</a> (enum, default: _off_): enable GPU usage  

- off: no GPU  
- mix: only render textured path to GPU, use software rasterizer for the outlines, solid fills and gradients  
- all: try to use GPU for everything  
</div>  
  
<div markdown class="option">  
<a id="thread">__thread__</a> (sint, default: _-1_): use threads for software rasterizer (-1 for all available cores)  
</div>  
<div markdown class="option">  
<a id="lwait">__lwait__</a> (uint, default: _1000_): timeout in ms before considering no signal is present  
</div>  
<div markdown class="option">  
<a id="ltimeout">__ltimeout__</a> (uint, default: _4000_): timeout in ms before restarting child processes  
</div>  
<div markdown class="option">  
<a id="maxdur">__maxdur__</a> (dbl, default: _0_): run for given seconds and exit, will not abort if 0 (used for live mode tests)  
</div>  
<div markdown class="option">  
<a id="updates">__updates__</a> (str): local JSON files for playlist updates  
</div>  
<div markdown class="option">  
<a id="maxdepth">__maxdepth__</a> (uint, default: _100_): maximum depth of a branch in the scene graph  
</div>  
<div markdown class="option">  
<a id="vsize" data-level="basic">__vsize__</a> (v2d, default: _1920x1080_): output video size, 0 disable video output  
</div>  
<div markdown class="option">  
<a id="fps" data-level="basic">__fps__</a> (frac, default: _25_): output video frame rate  
</div>  
<div markdown class="option">  
<a id="pfmt" data-level="basic">__pfmt__</a> (pfmt, default: _yuv_): output pixel format. Use `rgba` in GPU mode to force alpha channel  
</div>  
<div markdown class="option">  
<a id="dynpfmt">__dynpfmt__</a> (enum, default: _init_): allow dynamic change of output pixel format in software mode  

- off: pixel format is forced to desired value  
- init: pixel format is forced to format of fullscreen input in first generated frame  
- all: pixel format changes each time a full-screen input PID at same resolution is used  
</div>  
  
<div markdown class="option">  
<a id="sr" data-level="basic">__sr__</a> (uint, default: _44100_): output audio sample rate, 0 disable audio output  
</div>  
<div markdown class="option">  
<a id="ch" data-level="basic">__ch__</a> (uint, default: _2_): number of output audio channels, 0 disable audio output  
</div>  
<div markdown class="option">  
<a id="afmt" data-level="basic">__afmt__</a> (afmt, default: _s16_): output audio format (only s16, s32, flt and dbl are supported)  
</div>  
<div markdown class="option">  
<a id="alen">__alen__</a> (uint, default: _1024_): default number of samples per frame  
</div>
FLAC reframer

Register name used to load filter: __rfflac__  
This filter may be automatically loaded during graph resolution.  
  
This filter parses FLAC files/data and outputs corresponding audio PID and frames.  
  
By default the reframer will only check CRC footer of frames if a change in sample rate or channel mapping is detected.  
This should accommodate for most configurations, but CRC check can be enforced using [docrc](#docrc).
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="docrc" data-level="basic">__docrc__</a> (bool, default: _false_): perform CRC check after each frame  
</div>
RTSP Server

Register name used to load filter: __rtspout__  
This filter may be automatically loaded during graph resolution.  
  
The RTSP server partially implements RTSP 1.0, with support for OPTIONS, DESCRIBE, SETUP, PLAY, PAUSE and TEARDOWN.  
Multiple PLAY ranges are not supported, PLAY range end is not supported, PAUSE range is not supported.  
Only aggregated control is supported for PLAY and PAUSE, PAUSE/PLAY on single stream is not supported.  
The server only runs on TCP, and handles request in sequence: it will not probe for commands until previous response is sent.  
The server supports both RTP over UDP delivery and RTP interleaved over RTSP delivery.  
  
The scheduling algorithm and RTP options are the same as the RTP output filter, see [gpac -h rtpout](rtpout)  
The server will disconnect UDP streaming sessions if no RTCP traffic has been received for [timeout](#timeout) seconds.  
  
The server can run over TLS by specifying [cert](#cert) and [pkey](#pkey), in which case the default [port](#port) is 322.
Server mode

The filter can work as a regular RTSP server by specifying the [mounts](#mounts) option to indicate paths of media file to be served:  
Example
```
gpac rtspout:mounts=mydir1,mydir2
```
  
In this case, content `RES` from any of the specified directory is exposed as `rtsp://SERVER/RES`  
  
The [mounts](#mounts) option can also specify access rule file(s), see `gpac -h creds`. When rules are used:  

- if a directory has a `name` rule, it will be used in the URL  
- otherwise, the directory is directly available under server root `/`  
- only read access and multicast rights are checked  

Example
```
[foodir]  
name=bar
```
  
Content `RES` of this directory is exposed as `rtsp://SERVER/bar/RES`.  
    
  
In this mode, it is possible to load any source supported by gpac by setting the option [dynurl](#dynurl).  
The expected syntax of the dynamic RTSP URLs is `rtsp://servername/?URL1[&URLN]` or `rtsp://servername/@URL1[@URLN]`   
Each URL can be absolute or local, in which case it is resolved against the mount point(s).  
Example
```
gpac -i rtsp://localhost/?pipe://mynamepipe&myfile.mp4 [dst filters]
```
  
The server will resolve this URL in a new session containing streams from `myfile.mp4` and streams from pipe `mynamepipe`.  
When setting [runfor](#runfor) in server mode, the server will exit at the end of the last session being closed.  
  
The parameter `name=VAL` is reserved to assign a session name in case multicast mirroring is used.  
Example
```
gpac -i rtsp://localhost/?name=live?pipe://mynamepipe&myfile.mp4 [dst filters]
```
  
  
Usage of dynamic URLs can also be configured using the specific directory `$dynurl` in an access rule file.  
EX[$dynurl]  
ru=foo  
This will allow dynamic URLs only for `foo` user.  
  
_Note: If the [dynurl](#dynurl) is set, it is enabled for all users, without authentication._
Multicasting

In both modes, clients can setup multicast if the [mcast](#mcast) option is `on` or `mirror`.  
When [mcast](#mcast) is set to `mirror` mode, any DESCRIBE command on a resource already delivered through a multicast session will use that multicast.  
Consequently, only DESCRIBE methods are processed for such sessions, other methods will return Unauthorized.  
  
In server mode, multicast can be enabled per read directory using the `mcast` access rule of the directory configuration - see `gpac -h creds`.
UDP/TCP input

Register name used to load filter: __sockin__  
This filter may be automatically loaded during graph resolution.  
  
This filter handles generic TCP and UDP input sockets. It can also probe for MPEG-2 TS over RTP input. Probing of MPEG-2 TS over UDP/RTP is enabled by default but can be turned off.  
  
Data format can be specified by setting either [ext](#ext) or [mime](#mime) options. If not set, the format will be guessed by probing the first data packet  
  

- UDP sockets are used for source URLs formatted as `udp://NAME`  
- TCP sockets are used for source URLs formatted as `tcp://NAME`  
- UDP unix domain sockets are used for source URLs formatted as `udpu://NAME`  
- TCP unix domain sockets are used for source URLs formatted as `tcpu://NAME`  

  
When ports are specified in the URL and the default option separators are used (see `gpac -h doc`), the URL must either:  

- have a trailing '/', e.g. `udp://localhost:1234/[:opts]`  
- use `gpac` separator, e.g. `udp://localhost:1234[:gpac:opts]`  

  
When the socket is listening in keep-alive [ka](#ka) mode:  

- a single connection is allowed and a single output PID will be produced  
- each connection close event will triger a pipeline flush
Options  {.no-collapse}

<div markdown class="option">  
<a id="src" data-level="basic">__src__</a> (cstr): address of source content  
</div>  
<div markdown class="option">  
<a id="block_size">__block_size__</a> (uint, default: _0x60000_): block size used to read socket  
</div>  
<div markdown class="option">  
<a id="port" data-level="basic">__port__</a> (uint, default: _1234_): default port if not specified  
</div>  
<div markdown class="option">  
<a id="ifce">__ifce__</a> (cstr): default multicast interface  
</div>  
<div markdown class="option">  
<a id="listen" data-level="basic">__listen__</a> (bool, default: _false_): indicate the input socket works in server mode  
</div>  
<div markdown class="option">  
<a id="ka">__ka__</a> (bool, default: _false_): keep socket alive if no more connections  
</div>  
<div markdown class="option">  
<a id="maxc" data-level="basic">__maxc__</a> (uint, default: _+I_): max number of concurrent connections  
</div>  
<div markdown class="option">  
<a id="tsprobe">__tsprobe__</a> (bool, default: _true_): probe for MPEG-2 TS data, either RTP or raw UDP. Disabled if mime or ext are given and do not match MPEG-2 TS mimes/extensions  
</div>  
<div markdown class="option">  
<a id="ext" data-level="basic">__ext__</a> (str): indicate file extension of udp data  
</div>  
<div markdown class="option">  
<a id="mime" data-level="basic">__mime__</a> (str): indicate mime type of udp data  
</div>  
<div markdown class="option">  
<a id="block">__block__</a> (bool, default: _false_): set blocking mode for socket(s)  
</div>  
<div markdown class="option">  
<a id="timeout">__timeout__</a> (uint, default: _10000_): set timeout in ms for UDP socket(s), 0 to disable timeout  
</div>  
<div markdown class="option">  
<a id="reorder_pck">__reorder_pck__</a> (uint, default: _100_): number of packets delay for RTP reordering (M2TS over RTP)   
</div>  
<div markdown class="option">  
<a id="reorder_delay">__reorder_delay__</a> (uint, default: _10_): number of ms delay for RTP reordering (M2TS over RTP)  
</div>  
<div markdown class="option">  
<a id="ssm">__ssm__</a> (strl): list of IP to include for source-specific multicast  
</div>  
<div markdown class="option">  
<a id="ssmx">__ssmx__</a> (strl): list of IP to exclude for source-specific multicast  
</div>
Options  {.no-collapse}

<div markdown class="option">  
<a id="temi_url">__temi_url__</a> (cstr): force TEMI URL  
</div>  
<div markdown class="option">  
<a id="dsmcc">__dsmcc__</a> (bool, default: _no_): enable DSMCC receiver  
</div>  
<div markdown class="option">  
<a id="seeksrc">__seeksrc__</a> (bool, default: _true_): seek local source file back to origin once all programs are setup  
</div>  
<div markdown class="option">  
<a id="sigfrag">__sigfrag__</a> (bool, default: _false_): signal segment boundaries on output packets for DASH or HLS sources  
</div>  
<div markdown class="option">  
<a id="dvbtxt">__dvbtxt__</a> (bool, default: _false_): export DVB teletext streams  
</div>
libgpac logs options:

<div markdown class="option">
<a id="noprog">__-noprog__</a>: disable progress messages  
</div>
<div markdown class="option">
<a id="quiet">__-quiet__</a>:  disable all messages, including errors  
</div>
<div markdown class="option">
<a id="log-file" data-level="basic">__-log-file__</a>,__-lf__ (string): set output log file  
</div>
<div markdown class="option">
<a id="log-clock" data-level="basic">__-log-clock__</a>,__-lc__: log time in micro sec since start time of GPAC before each log line except for `app` tool  
</div>
<div markdown class="option">
<a id="log-utc" data-level="basic">__-log-utc__</a>,__-lu__: log UTC time in ms before each log line except for `app` tool  
</div>
<div markdown class="option">
<a id="logs" data-level="basic">__-logs__</a> (string): set log tools and levels.    
    
You can independently log different tools involved in a session.    
log_args is formatted as a colon (':') separated list of `toolX[:toolZ]@levelX`    
`levelX` can be one of:  

- quiet: skip logs  
- error: logs only error messages  
- warning: logs error+warning messages  
- info: logs error+warning+info messages  
- debug: logs all messages  

  
`toolX` can be one of:  

- core: libgpac core  
- mutex: log all mutex calls  
- mem: GPAC memory tracker  
- module: GPAC modules (av out, font engine, 2D rasterizer)  
- filter: filter session debugging  
- sched: filter session scheduler debugging  
- codec: codec messages (used by encoder and decoder filters)  
- coding: bitstream formats (audio, video, scene)  
- container: container formats (ISO File, MPEG-2 TS, AVI, ...) and multiplexer/demultiplexer filters  
- network: TCP/UDP sockets and TLS  
- http: HTTP traffic  
- cache: HTTP cache subsystem  
- rtp: RTP traffic  
- dash: HTTP streaming logs  
- route: ROUTE (ATSC3) debugging  
- media: messages from generic filters and reframer/rewriter filters  
- parser: textual parsers (svg, xmt, bt, ...)  
- mmio: I/O management (AV devices, file, pipes, OpenGL)  
- audio: audio renderer/mixer/output  
- script: script engine except console log  
- console: script console log  
- scene: scene graph and scene manager  
- compose: composition engine (2D, 3D, etc)  
- ctime: media and SMIL timing info from composition engine  
- interact: interaction messages (UI events and triggered DOM events and VRML route)  
- rti: run-time stats of compositor  
- all: all tools logged - other tools can be specified afterwards.    

The special keyword `ncl` can be set to disable color logs.    
The special keyword `strict` can be set to exit at first error.    
  
Example
```
-logs=all@info:dash@debug:ncl
```
  
This moves all log to info level, dash to debug level and disable color logs  
</div>
  
<div markdown class="option">
<a id="proglf">__-proglf__</a>: use new line at each progress messages  
</div>
<div markdown class="option">
<a id="log-dual" data-level="basic">__-log-dual__</a>,__-ld__: output to both file and stderr  
</div>
File input

Register name used to load filter: __fin__  
This filter may be automatically loaded during graph resolution.  
  
This filter dispatch raw blocks from input file into a filter chain.  
Block size can be adjusted using [block_size](#block_size).  
Content format can be forced through [mime](#mime) and file extension can be changed through [ext](#ext).  
_Note: Unless disabled at session level (see [-no-probe](core_options/#no-probe) ), file extensions are usually ignored and format probing is done on the first data block._  
The special file name `null` is used for creating a file with no data, needed by some filters such as [dasher](dasher).  
The special file name `rand` is used to generate random data.  
The special file name `randsc` is used to generate random data with `0x000001` start-code prefix.  
  
The filter handles both files and GF_FileIO objects as input URL.
Packet Injecting

The filter can be used to inject a single packet instead of a file using (-pck)[] option.  
No specific properties are attached, except a timescale if (-ptime)[] is set.  
Example
```
gpac fin:pck=str@"My Sample Text":ptime=2500/100:#CodecID=stxt:#StreamType=text
```
  
This will declare the PID as WebVTT and send a single packet with payload `My Sample Text` and a timestamp value of 25 second.
Options  {.no-collapse}

<div markdown class="option">  
<a id="src" data-level="basic">__src__</a> (cstr): location of source file  
</div>  
<div markdown class="option">  
<a id="block_size">__block_size__</a> (uint, default: _0_): block size used to read file. 0 means 5000 if file less than 500m, 1M otherwise  
</div>  
<div markdown class="option">  
<a id="range" data-level="basic">__range__</a> (lfrac, default: _0-0_): byte range  
</div>  
<div markdown class="option">  
<a id="ext" data-level="basic">__ext__</a> (cstr): override file extension  
</div>  
<div markdown class="option">  
<a id="mime" data-level="basic">__mime__</a> (cstr): set file mime type  
</div>  
<div markdown class="option">  
<a id="pck" data-level="basic">__pck__</a> (mem): data to use instead of file  
</div>  
<div markdown class="option">  
<a id="ptime" data-level="basic">__ptime__</a> (frac, default: _0/0_): timing for data packet, ignored if den is 0  
</div>
File output

Register name used to load filter: __fout__  
This filter may be automatically loaded during graph resolution.  
  
This filter is used to write data to disk, and does not produce any output PID.  
In regular mode, the filter only accept PID of type file. It will dump to file incoming packets (stream type file), starting a new file for each packet having a _frame_start_ flag set, unless operating in [cat](#cat) mode.  
If the output file name is `std` or `stdout`, writes to stdout.  
The output file name can use gpac templating mechanism, see `gpac -h doc`.The filter watches the property `FileNumber` on incoming packets to create new files.
HTTP streaming recording

When recording a DASH or HLS session, the number of segments to keep per quality can be set using [max_cache_segs](#max_cache_segs).  

- value `0`  keeps everything (default behaviour)  
- a negative value `N` will keep `-N` files regardless of the time-shift buffer value  
- a positive value `N` will keep `MAX(N, time-shift buffer)` files  

  
Example
```
gpac -i LIVE_MPD dashin:forward=file -o rec/$File$:max_cache_segs=3
```
  
This will force keeping a maximum of 3 media segments while recording the DASH session.
Options  {.no-collapse}

<div markdown class="option">  
<a id="dst" data-level="basic">__dst__</a> (cstr): location of destination file  
</div>  
<div markdown class="option">  
<a id="append">__append__</a> (bool, default: _false_): open in append mode  
</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 when vsync is on. If negative and start is 0, start is set to -1  
</div>  
<div markdown class="option">  
<a id="ext">__ext__</a> (cstr): set extension for graph resolution, regardless of file extension  
</div>  
<div markdown class="option">  
<a id="mime">__mime__</a> (cstr): set mime type for graph resolution  
</div>  
<div markdown class="option">  
<a id="cat">__cat__</a> (enum, default: _none_): cat each file of input PID rather than creating one file per filename  

- none: never cat files  
- auto: only cat if files have same names  
- all: always cat regardless of file names  
</div>  
  
<div markdown class="option">  
<a id="ow" data-level="basic">__ow__</a> (enum, default: _yes_): overwrite output mode when concatenation is not used  

- yes: override file if existing  
- no: throw error if file existing  
- ask: interactive prompt  
</div>  
  
<div markdown class="option">  
<a id="mvbk" data-level="basic">__mvbk__</a> (uint, default: _8192_): block size used when moving parts of the file around in patch mode  
</div>  
<div markdown class="option">  
<a id="redund" data-level="basic">__redund__</a> (bool, default: _false_): keep redundant packet in output file  
</div>  
<div markdown class="option">  
<a id="max_cache_segs">__max_cache_segs__</a> (sint, default: _0_): maximum number of segments cached per HAS quality when recording live sessions (0 means no limit)  
</div>  
<div markdown class="option">  
<a id="force_null">__force_null__</a> (bool, default: _false_): force no output regardless of file name  
</div>
Overview {:data-level="all"}

For version 0.9.0, GPAC has undergone a major re-architecture of its core, the first one in 15 years!
The re-architecture was done with the following goals:

- keep [MP4Client](#mp4client-deprecated-as-of-gpac-22) and [MP4Box](MP4Box-Introduction) unchanged: old command lines will behave the same.
- keep MP4Box outputs unchanged: old command line will provide the same binary output (provided that `-old-arch` option is set).
- get rid of all duplicated functionalities in MP4Box and MP4Client (code duplication of most MP4Box importers / MP4Client input plugin).
- be generic enough so that new applications can be build directly from command line rather than developing new applications using libgpac.
- better handling of the documentation, which was not unified between MP4Client and MP4Box.

Our long history of interacting with MP4Box users has shown us that they always find unexpected ways to use MP4Box, and sometimes cannot achieve their goal only because of some hardcoded code path in GPAC.

From this observation, we decided to move to a filter-based architecture and give users the possibility to build filter chains using _any of the filters_ in GPAC: we no longer want to provide you with out-of-the box applications for a given set of tasks, but rather give you all the tools to assemble your own application.

This was a long process (almost 2 years) resulting in:

- addition of a filter-based architecture, used by MP4Client and MP4Box.
- moving all decoders and demultiplexer plugins of MP4Client and most of MP4Box import/export code as filters for this new architecture, 
- moving DASH/HLS segmenter to a filter
- moving MP4Client compositor and most of the GF_Terminal internals to a filter
- addition of a new application [gpac](gpac_general), whose only purpose is to create and run filter chains
- additions of a bunch of filters, including:
    -  __encoders__ through [FFmpeg](https://ffmpeg.org/)
    - generic pipe and socket input and output
    - raw audio and video reframers
    - HEVC tile splitting and merging filters
    
- removal of MP42TS and DashCast applications since these functionalities are provided by [gpac](gpac_general)
- deprecation of some features (widget management, MSE draft implementation for SVG media, UPnP). Some of these features might find their way back in one day. 
- profile system allowing to override through a static file default options of all filters and libgpac core
- an ad-hoc stream format called [GSF](gsfmx) to allow serialization to file, pipe or socket of a session. This allows building distributed filter chains.
- unified documentation system for MP4Client, MP4Box and gpac allowing generation from source.

The following lists the core principles of the re-architecture. Read the [general filter documentation](filters_general) for a deeper understanding of how all of this connects together. You can also have a look at the [doxygen for filters](https://doxygen.gpac.io/group__filters__grp.html#details).