gaspard7/wiki_gpac huggingface dataset:
Device identification

Typical classes are `dshow` on windows, `avfoundation` on OSX, `video4linux2` or `x11grab` on linux  
  
Typical device name can be the webcam name:  

- `FaceTime HD Camera` on OSX, device name on windows, `/dev/video0` on linux  
- `screen-capture-recorder`, see http://screencapturer.sf.net/ on windows  
- `Capture screen 0` on OSX (0=first screen), or `screenN` for short  
- X display name (e.g. `:0.0`) on linux  

  
The general mapping from ffmpeg command line is:  

- ffmpeg `-f` maps to [fmt](#fmt) option  
- ffmpeg `-i` maps to [dev](#dev) option  

  
Example
```
ffmpeg -f libndi_newtek -i MY_NDI_TEST ...  
gpac -i av://:fmt=libndi_newtek:dev=MY_NDI_TEST ...
```
  
  
You may need to escape the [dev](#dev) option if the format uses ':' as separator, as is the case for AVFoundation:  
Example
```
gpac -i av://::dev=0:1 ...
```
Options  {.no-collapse}

<div markdown class="option">  
<a id="src" data-level="basic">__src__</a> (str): url of device, `video://`, `audio://` or `av://`  
</div>  
<div markdown class="option">  
<a id="fmt" data-level="basic">__fmt__</a> (str): name of device class. If not set, defaults to first device class  
</div>  
<div markdown class="option">  
<a id="dev" data-level="basic">__dev__</a> (str, default: _0_): name of device or index of device  
</div>  
<div markdown class="option">  
<a id="copy">__copy__</a> (enum, default: _A_): set copy mode of raw frames  

- N: frames are only forwarded (shared memory, no copy)  
- A: audio frames are copied, video frames are forwarded  
- V: video frames are copied, audio frames are forwarded  
- AV: all frames are copied  
</div>  
  
<div markdown class="option">  
<a id="sclock">__sclock__</a> (bool, default: _false_): use system clock (us) instead of device timestamp (for buggy devices)  
</div>  
<div markdown class="option">  
<a id="probes">__probes__</a> (uint, default: _10_, minmax: 0-100): probe a given number of video frames before emitting (this usually helps with bad timing of the first frames)  
</div>  
<div markdown class="option">  
<a id="*" data-level="basic">__*__</a> (str): any possible options defined for AVInputFormat and AVFormatContext (see `gpac -hx ffavin` and `gpac -hx ffavin:*`)  
</div>
Options  {.no-collapse}

<div markdown class="option">  
<a id="fps" data-level="basic">__fps__</a> (frac, default: _0/1000_): import frame rate (0 default to FPS from bitstream or 25 Hz)  
</div>  
<div markdown class="option">  
<a id="findex" data-level="basic">__findex__</a> (bool, default: _true_): index frames. If true, filter will be able to work in rewind mode  
</div>  
<div markdown class="option">  
<a id="cid">__cid__</a> (str): set QT 4CC for the imported media. If not set, default is 'ap4h' for YUV444 and 'apch' for YUV422  
</div>  
<div markdown class="option">  
<a id="notime">__notime__</a> (bool, default: _false_): ignore input timestamps, rebuild from 0  
</div>
NVidia decoder

Register name used to load filter: __nvdec__  
This filter may be automatically loaded during graph resolution.  
  
This filter decodes MPEG-2, MPEG-4 Part 2, AVC|H264 and HEVC streams through NVidia decoder. It allows GPU frame dispatch or direct frame copy.  
If the SDK is not available, the configuration key `nvdec@disabled` will be written in configuration file to avoid future load attempts.  
  
The absolute path to cuda lib can be set using the `cuda_lib` option in `core` or `temp` section of the config file, e.g. `-cfg=temp:cuda_lib=PATH_TO_CUDA`  
The absolute path to cuvid lib can be set using the `cuvid_lib` option in `core` or `temp` section of the config file, e.g. `-cfg=temp:cuvid_lib=PATH_TO_CUDA`
Options  {.no-collapse}

<div markdown class="option">  
<a id="num_surfaces">__num_surfaces__</a> (uint, default: _20_): number of hardware surfaces to allocate  
</div>  
<div markdown class="option">  
<a id="unload">__unload__</a> (enum, default: _no_): decoder unload mode  

- no: keep inactive decoder alive  
- destroy: destroy inactive decoder  
- reuse: detach decoder from inactive PIDs and reattach to active ones  
</div>  
  
<div markdown class="option">  
<a id="vmode">__vmode__</a> (enum, default: _cuvid_): video decoder backend  

- cuvid: use dedicated video engines directly  
- cuda: use a CUDA-based decoder if faster than dedicated engines  
- dxva: go through DXVA internally if possible (requires D3D9)  
</div>  
  
<div markdown class="option">  
<a id="fmode" data-level="basic">__fmode__</a> (enum, default: _gl_): frame output mode  

- copy: each frame is copied and dispatched  
- single: frame data is only retrieved when used, single memory space for all frames (not safe if multiple consumers)  
- gl: frame data is mapped to an OpenGL texture  
</div>
FFmpeg demultiplexer

Register name used to load filter: __ffdmx__  
This filter may be automatically loaded during graph resolution.  
  
This filter demultiplexes an input file or open a source protocol using FFmpeg.  
See FFmpeg documentation (https://ffmpeg.org/documentation.html) for more details.  
To list all supported demultiplexers for your GPAC build, use `gpac -h ffdmx:*`.  
This will list both supported input formats and protocols.  
Input protocols are listed with `Description: Input protocol`, and the subclass name identifies the protocol scheme.  
For example, if `ffdmx:rtmp` is listed as input protocol, this means `rtmp://` source URLs are supported.
Options  {.no-collapse}

<div markdown class="option">  
<a id="src" data-level="basic">__src__</a> (cstr): URL of source content  
</div>  
<div markdown class="option">  
<a id="reparse" data-level="basic">__reparse__</a> (bool, default: _false_): force reparsing of stream content (AVC,HEVC,VVC,AV1 only for now)  
</div>  
<div markdown class="option">  
<a id="block_size">__block_size__</a> (uint, default: _4096_): block size used to read file when using GFIO context  
</div>  
<div markdown class="option">  
<a id="strbuf_min">__strbuf_min__</a> (uint, default: _1MB_): internal buffer size when demuxing from GPAC's input stream  
</div>  
<div markdown class="option">  
<a id="*" data-level="basic">__*__</a> (str): any possible options defined for AVFormatContext and sub-classes. See `gpac -hx ffdmx` and `gpac -hx ffdmx:*`  
</div>
Uncompressed Video File Format Generator Utility

Register name used to load filter: __uncvg__  
This is a JavaScript filter. It is not checked during graph resolution and needs explicit loading.  
Author: GPAC team - (c) Telecom ParisTech 2023 - license LGPL v2  
  
This filter provides generation of test images for ISO/IEC 23001-17  
Generated pixels can be:  

- a pattern of colors in columns, or in rectangles if [sq](#sq) is set, using the specified palette.  
- an image source if [img](#img) is used.  

  
Colors specified in the palette can be default GPAC colors (see gpac -h colors), 0xRRGGBB or 0xAARRGGBB  
  
When generating video, the pixels are shifted to the left at every frame  
  
Components are described as N[bpc][+k] with  

- N: component type, one of M(mono), Y, U, V, R, G, B, A, d(depth), disp, p(palette), f(filterArray), x (pad)  
- bpc: bits per component value, default is 8. Non-integer values must be one of  

    - sft: floating-point value on 16 bits  
    - flt: floating-point value on 32 bits  
    - dbl: floating-point value on 64 bits  
    - dblx: floating-point value on 128 bits  
    - cps: complex value as two floats on 16 bits each  
    - cpf: complex value as two floats on 32 bits each  
    - cpd: complex value as two floats on 64 bits each  
    - cpx: complex value as two floats on 128 bits each  

- k: force component alignment on k bytes, default is 0 (no alignment)
Packet timestamp rewriter

Register name used to load filter: __restamp__  
This filter is not checked during graph resolution and needs explicit loading.  
Filters of this class can connect to each-other.  
  
This filter rewrites timing (offsets and rate) of packets.  
  
The delays (global or per stream class) can be either positive (stream presented later) or negative (stream presented sooner).  
  
The specified [fps](#fps) can be either 0, positive or negative.  

- if 0 or if the stream is audio, stream rate is not modified.  
- otherwise if negative, stream rate is multiplied by `-fps.num/fps.den`.  
- otherwise if positive and the stream is not video, stream rate is not modified.  
- otherwise (video PID), constant frame rate is assumed and:  

    - if [rawv=no](#rawv=no), video frame rate is changed to the specified rate (speed-up or slow-down).  
    - if [rawv=force](#rawv=force), input video stream is decoded and video frames are dropped/copied to match the new rate.  
    - if [rawv=dyn](#rawv=dyn), input video stream is decoded if not all-intra and video frames are dropped/copied to match the new rate.  

  
_Note: frames are simply copied or dropped with no motion compensation._  
  
When [align](#align) is not 0, if the difference between two consecutive timestamps is greater than the specified threshold, the new timestamp   
is set to the last computed timestamp plus the minimum packet duration for the stream.
Options  {.no-collapse}

<div markdown class="option">  
<a id="fps" data-level="basic">__fps__</a> (frac, default: _0/1_): target fps  
</div>  
<div markdown class="option">  
<a id="delay" data-level="basic">__delay__</a> (frac, default: _0/1_, updatable): delay to add to all streams  
</div>  
<div markdown class="option">  
<a id="delay_v" data-level="basic">__delay_v__</a> (frac, default: _0/1_, updatable): delay to add to video streams  
</div>  
<div markdown class="option">  
<a id="delay_a" data-level="basic">__delay_a__</a> (frac, default: _0/1_, updatable): delay to add to audio streams  
</div>  
<div markdown class="option">  
<a id="delay_t" data-level="basic">__delay_t__</a> (frac, default: _0/1_, updatable): delay to add to text streams  
</div>  
<div markdown class="option">  
<a id="delay_o" data-level="basic">__delay_o__</a> (frac, default: _0/1_, updatable): delay to add to other streams  
</div>  
<div markdown class="option">  
<a id="rawv" data-level="basic">__rawv__</a> (enum, default: _no_): copy video frames  

- no: no raw frame copy/drop  
- force: force decoding all video streams  
- dyn: decoding video streams if not all intra  
</div>  
  
<div markdown class="option">  
<a id="tsinit" data-level="basic">__tsinit__</a> (lfrac, default: _-1/1_): initial timestamp to resync to, negative values disables resync  
</div>  
<div markdown class="option">  
<a id="align" data-level="basic">__align__</a> (uint, default: _0_): timestamp alignment threshold (0 disables alignment) - see filter help  
</div>  
<div markdown class="option">  
<a id="reorder" data-level="basic">__reorder__</a> (bool, default: _false_): reorder input packets by CTS (resulting PID may fail decoding)  
</div>
Using Aliases

The gpac command line can become quite complex when many sources or filters are used. In order to simplify this, an alias system is provided.  
  
To assign an alias, use the syntax `gpac -alias="NAME VALUE"`.  

- `NAME`: shall be a single string, with no space.  
- `VALUE`: the list of argument this alias replaces. If not set, the alias is destroyed  

  
When parsing arguments, the alias will be replace by its value.  
Example
```
gpac -alias="output aout vout"
```
  
This allows later audio and video playback using `gpac -i src.mp4 output`  
  
Aliases can use arguments from the command line. The allowed syntaxes are:  

- `@{a}`: replaced by the value of the argument with index `a` after the alias  
- `@{a,b}`: replaced by the value of the arguments with index `a` and `b`  
- `@{a:b}`: replaced by the value of the arguments between index `a` and `b`  
- `@{-a,b}`: replaced by the value of the arguments with index `a` and `b`, inserting a list separator (comma by default) between them  
- `@{-a:b}`: replaced by the value of the arguments between index `a` and `b`, inserting a list separator (comma by default) between them  
- `@{+a,b}`: clones the parent word in the alias for `a` and `b`, replacing this pattern in each clone by the corresponding argument  
- `@{+a:b}`: clones the parent word in the alias for each argument between index `a` and `b`, replacing this pattern in each clone by the corresponding argument  

  
The specified index can be:  

- forward index: a strictly positive integer, 1 being the first argument after the alias  
- backward index: the value 'n' (or 'N') to indicate the last argument on the command line. This can be followed by `-x` to rewind arguments (e.g. `@{n-1}` is the before last argument)  

  
Before solving aliases, all option arguments are moved at the beginning of the command line. This implies that alias arguments cannot be options.  
Arguments not used by any aliases are kept on the command line, other ones are removed  
  
Example
```
-alias="foo src=@{N} dst=test.mp4"
```
  
The command `gpac foo f1 f2` expands to `gpac src=f2 dst=test.mp4 f1`  
Example
```
-alias="list: inspect src=@{+:N}"
```
  
The command `gpac list f1 f2 f3` expands to `gpac inspect src=f1 src=f2 src=f3`  
Example
```
-alias="list inspect src=@{+2:N}"
```
  
The command `gpac list f1 f2 f3` expands to `gpac inspect src=f2 src=f3 f1`  
Example
```
-alias="plist aout vout flist:srcs=@{-,N}"
```
  
The command `gpac plist f1 f2 f3` expands to `gpac aout vout flist:srcs="f1,f2,f3"`    
  
Alias documentation can be set using `gpac -aliasdoc="NAME VALUE"`, with `NAME` the alias name and `VALUE` the documentation.  
Alias documentation will then appear in gpac help.
User Credentials

Some servers in GPAC can use user-based and group-based authentication.  
The information is stored by default in the file `users.cfg` located in the GPAC profile directory.  
The file can be overwritten using the [-users](core_options/#users) option.  
  
By default, this file does not exist until at least one user has been configured.  
  
The [creds](#creds) option allows inspecting or modifying the users and groups information. The syntax for the option value is:  

- `show` or no value: prints the `users.cfg` file  
- `reset`: deletes the `users.cfg` file (i.e. deletes all users and groups)  
- `NAME`: show information of user `NAME`  
- `+NAME`: adds user `NAME`  
- `+NAME:I1=V1[,I2=V2]`: sets info `I1` with value `V1` to user `NAME`. The info name `password` resets password without prompt.  
- `-NAME`: removes user `NAME`  
- `_NAME`: force password change of user `NAME`  
- `@NAME`: show information of group `NAME`  
- `@+NAME[:u1[,u2]]`: adds group `NAME` if not existing and adds specified users to group  
- `@-NAME:u1[,u2]`: removes specified users from group `NAME`  
- `@-NAME`: removes group `NAME`  

  
By default all added users are members of the group `users`.  
Passwords are not stored, only a SHA256 hash is stored.  
  
Servers using authentication rules can use a configuration file instead of a directory name.  
This configuration file is organized in sections, each section name describing a directory.  
Example
```
[somedir]  
ru=foo  
rg=bar
```
  
  
The following keys are defined per directory, but may be ignored by the server depending on its operation mode:  

- ru: comma-separated list of user names with read access to the directory  
- rg: comma-separated list of group names with read access to the directory  
- wu: comma-separated list of user names with write access to the directory  
- wg: comma-separated list of group names with write access to the directory  
- mcast: comma-separated list of user names with multicast creation rights (RTSP server only)  
- filters: comma-separated list of filter names for which the directory is valid. If not found or `all`, applies to all filters  

  
Rights can be configured on sub-directories by adding sections for the desired directories.  
Example
```
[d1]  
rg=bar  
[d1/d2]  
ru=foo
```
  
With this configuration:  

- the directory `d1` will be readable by all members of group `bar`  
- the directory `d1/d2` will be readable by user `foo` only  

  
Servers in GPAC currently only support the `Basic` HTTP authentication scheme, and should preferably be run over TLS.
UDP/TCP output

Register name used to load filter: __sockout__  
This filter may be automatically loaded during graph resolution.  
  
This filter handles generic output sockets (mono-directional) in blocking mode only.  
The filter can work in server mode, waiting for source connections, or in client mode, directly connecting to a server.  
In server mode, the filter can be instructed to keep running at the end of the stream.  
In server mode, the default behavior is to keep input packets when no more clients are connected; this can be adjusted though the [kp](#kp) option, however there is no realtime regulation of how fast packets are dropped.  
If your sources are not real time, consider adding a real-time scheduler in the chain (cf reframer filter), or set the send [rate](#rate) option.  
  

- UDP sockets are used for destinations URLs formatted as `udp://NAME`  
- TCP sockets are used for destinations URLs formatted as `tcp://NAME`  
- UDP unix domain sockets are used for destinations URLs formatted as `udpu://NAME`  
- TCP unix domain sockets are used for destinations 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` escape, e.g. `udp://localhost:1234[:gpac:opts]`  

  
The socket output can be configured to drop or revert packet order for test purposes.  
A window size in packets is specified as the drop/revert fraction denominator, and the index of the packet to drop/revert is given as the numerator/  
If the numerator is 0, a packet is randomly chosen in that window.  
Example
```
:pckd=4/10
```
  
This drops every 4th packet of each 10 packet window.  
Example
```
:pckr=0/100
```
  
This reverts the send order of one random packet in each 100 packet window.
Options  {.no-collapse}

<div markdown class="option">  
<a id="dst" data-level="basic">__dst__</a> (cstr): URL of destination  
</div>  
<div markdown class="option">  
<a id="sockbuf">__sockbuf__</a> (uint, default: _65536_): block size used to read file  
</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="ext" data-level="basic">__ext__</a> (str): file extension of pipe data  
</div>  
<div markdown class="option">  
<a id="mime" data-level="basic">__mime__</a> (str): mime type of pipe data  
</div>  
<div markdown class="option">  
<a id="listen">__listen__</a> (bool, default: _false_): indicate the output socket works in server mode  
</div>  
<div markdown class="option">  
<a id="maxc">__maxc__</a> (uint, default: _+I_): max number of concurrent connections  
</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="kp">__kp__</a> (bool, default: _true_): keep packets in queue if no more clients  
</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="rate">__rate__</a> (uint, default: _0_): set send rate in bps, disabled by default (as fast as possible)  
</div>  
<div markdown class="option">  
<a id="pckr">__pckr__</a> (frac, default: _0/0_): reverse packet every N  
</div>  
<div markdown class="option">  
<a id="pckd">__pckd__</a> (frac, default: _0/0_): drop packet every N  
</div>  
<div markdown class="option">  
<a id="ttl">__ttl__</a> (uint, default: _0_, minmax: 0-127): multicast TTL  
</div>
Options  {.no-collapse}

<div markdown class="option">  
<a id="fps" data-level="basic">__fps__</a> (frac, default: _0/1000_): import frame rate (0 default to FPS from bitstream or 25 Hz)  
</div>  
<div markdown class="option">  
<a id="index" data-level="basic">__index__</a> (dbl, default: _-1.0_): indexing window length. If 0, bitstream is not probed for duration. A negative value skips the indexing if the source file is larger than 20M (slows down importers) unless a play with start range > 0 is issued  
</div>  
<div markdown class="option">  
<a id="importer">__importer__</a> (bool, default: _false_): compatibility with old importer  
</div>  
<div markdown class="option">  
<a id="deps">__deps__</a> (bool, default: _false_): import sample dependency information  
</div>  
<div markdown class="option">  
<a id="notime">__notime__</a> (bool, default: _false_): ignore input timestamps, rebuild from 0  
</div>  
<div markdown class="option">  
<a id="temporal_delim">__temporal_delim__</a> (bool, default: _false_): keep temporal delimiters in reconstructed frames  
</div>  
<div markdown class="option">  
<a id="bsdbg">__bsdbg__</a> (enum, default: _off_): debug OBU parsing in `media@debug logs`  

- off: not enabled  
- on: enabled  
- full: enable with number of bits dumped  
</div>
WebVTT decoder

Register name used to load filter: __vttdec__  
This filter may be automatically loaded during graph resolution.  
  
This filter decodes WebVTT streams into a SVG scene graph of the compositor filter.  
The scene graph creation is done through JavaScript.  
The filter options are used to override the JS global variables of the WebVTT renderer.  
In stand-alone rendering (no associated video), the filter will use:  

- `Width` and `Height` properties of input pid if any  
- otherwise, `osize` option of compositor if set  
- otherwise, [txtw](#txtw) and [txth](#txth)
Options  {.no-collapse}

<div markdown class="option">  
<a id="script">__script__</a> (str, default: _$GSHARE/scripts/webvtt-renderer.js_): location of WebVTT SVG JS renderer  
</div>  
<div markdown class="option">  
<a id="font">__font__</a> (str, default: _SANS_, updatable): font  
</div>  
<div markdown class="option">  
<a id="fontSize">__fontSize__</a> (flt, default: _20_, updatable): font size  
</div>  
<div markdown class="option">  
<a id="color">__color__</a> (str, default: _white_, updatable): text color  
</div>  
<div markdown class="option">  
<a id="lineSpacing">__lineSpacing__</a> (flt, default: _1.0_, updatable): line spacing as scaling factor to font size  
</div>  
<div markdown class="option">  
<a id="txtw">__txtw__</a> (uint, default: _400_): default width in standalone rendering  
</div>  
<div markdown class="option">  
<a id="txth">__txth__</a> (uint, default: _200_): default height in standalone rendering  
</div>
Options  {.no-collapse}

<div markdown class="option">  
<a id="och" data-level="basic">__och__</a> (uint, default: _0_): desired number of output audio channels (0 for auto)  
</div>  
<div markdown class="option">  
<a id="osr" data-level="basic">__osr__</a> (uint, default: _0_): desired sample rate of output audio (0 for auto)  
</div>  
<div markdown class="option">  
<a id="osfmt" data-level="basic">__osfmt__</a> (afmt, default: _none_): desired sample format of output audio (`none` for auto)  
</div>  
<div markdown class="option">  
<a id="olayout" data-level="basic">__olayout__</a> (alay, Enum: mono|stereo|3/0.0|3/1.0|3/2.0|3/2.1|5/2.1|1+1|2/1.0|2/2.0|3/3.1|3/4.1|11/11.2|5/2.1|5/5.2|5/4.1|6/5.1|6/7.1|5/6.1|7/6.1): desired CICP layout of output audio (null for auto)  
</div>
IVF/OBU/annexB writer

Register name used to load filter: __ufobu__  
This filter may be automatically loaded during graph resolution.  
  
This filter rewrites VPx or AV1 bitstreams into a IVF, annexB or OBU sequence.  
The temporal delimiter OBU is re-inserted in annexB (`.av1` and `.av1b`files, with obu_size set) and OBU sequences (`.obu`files, without obu_size)  
_Note: VP8/9 codecs will only use IVF output (equivalent to file extension `.ivf` or `:ext=ivf` set on output)._