gpac(1)
๐ธ gpac(1) ๐ธ
okay bestie, welcome to the GPAC manual page, section 1 of 1 โ the command-line filter session manager herself. GPAC ships this whole thing, and we're gonna walk through every single flag like it's a group chat debrief. ๐
โจ NAME โจ
gpac โ GPAC's command-line filter session manager. She's the one who sets up and runs your filter chains, no cap. ๐
๐ฆ SYNOPSIS ๐ฆ
gpac [options]FILTER[LINK]FILTER[...]
gpac is GPAC's command line tool for setting up and running filter chains. That's the whole vibe.
FILTERโ a single filter declaration, like-i file,-o dump,inspect, whatever you need. Full tea is ingpac -h doc.[LINK]โ a link instruction, e.g.@,@2,@2#StreamType=Visual, ... again,gpac -h dochas the deets.[options]โ one or more option strings, and each one starts with a-character.- an option using a single
-indicates an option ofgpac(peepgpac -hx) or oflibgpac(peepgpac -hx core) - an option using
--indicates a global filter or meta-filter (e.g. FFmpeg) option, like--block_size=1000or--profile=Baseline(seegpac -h doc)
- an option using a single
๐ DESCRIPTION ๐
Filter declaration order may impact the link resolver, which will try linking in declaration order. Most of the time, for simple graphs, this has no impact. However, for complex graphs with no link declarations, this can lead to different results. So like... order matters sometimes, iykyk. ๐
Options do not require any specific order, and may be present anywhere โ including between link statements or filter declarations. Chaotic? Yes. Allowed? Also yes. โจ
Boolean values do not need any value specified.</> Other types shall be formatted as opt=val, except -i, -src, -o, -dst and -h options. Those five are the exceptions, periodt.
๐ The session can be interrupted at any time using ctrl+c, which can also be used to toggle global reporting. Yes, the same key does both. Main character multitasking energy.
The possible options for gpac are:
๐ OPTIONS ๐
-mem-trackโ enable the memory tracker ๐-mem-track-stackโ enable the memory tracker with stack dumping ๐-ltfโ load test-unit filters (used for for unit tests only)-sloop(int) โ loop execution of session, creating a session at each loop. Mainly used for testing, and it breaks at the first error. If no value is given, it loops forever. ๐-eloop(int) โ same assloopbut does not break if there's an error-runfor(int) โ run for the given amount of milliseconds, then exit with a full session flush-runforf(int) โ run for the given amount of milliseconds, then exit with a fast session flush โก-runforx(int) โ run for the given amount of milliseconds and exit with no cleanup ๐ซฅ-runfors(int) โ run for the given amount of milliseconds and exit with segfault (tests) ๐ญ-runforl(int) โ run for the given amount of milliseconds and wait forever at the end (tests) ๐ง-statsโ print stats after execution ๐-graphโ print the graph after execution ๐ธ๏ธ-qeโ enable quick exit (no mem cleanup)-kโ enable keyboard interaction from the command line โจ๏ธ-r(string) โ enable reportingr: runtime reportingr=FA[,FB]: runtime reporting but only print the given filters, e.g.r=mp4mxfor ISOBMFF multiplexer onlyr=: only print the final report
-seps(string, default::=#,!@) โ set the default character sets used to separate various arguments- the first char is used to separate argument names
- the second char, if present, is used to separate names and values
- the third char, if present, is used to separate fragments for PID sources
- the fourth char, if present, is used for list separators (
sourceIDs,gfreg, ...) - the fifth char, if present, is used for boolean negation
- the sixth char, if present, is used for LINK directives (see filters help (
-h doc))
-i,-src(string) โ specify an input file โ see filters help (-h doc) ๐ฅ-o,-dst(string) โ specify an output file โ see filters help (-h doc) ๐ค-ib(string) โ specify an input file to wrap as aGF_FileIOobject (testing ofGF_FileIO)-ibx(string) โ specify an input file to wrap as aGF_FileIOobject without caching (testing ofGF_FileIO)-ob(string) โ specify an output file to wrap as aGF_FileIOobject (testing ofGF_FileIO)-clโ force complete mode when no link directive is set โ see filters help (-h doc)-sidโ force source IDs to be present when attempting to link โ see filters help (-h doc)-stepโ test step mode in a non-blocking session-h,-help,-ha,-hx,-hh(string) โ print help. Use-helpor-hfor basic options,-hafor advanced options,-hxfor expert options and-hhfor all.
๐ Note: the@character can be used in place of the*character.
String parameter can be:
- empty: print command line options help
doc: print the general filter infoalias: print thegpacalias syntaxlog: print the log system helpcore: print the supportedlibgpaccore options. Use-ha/-hx/-hhfor advanced/expert optionscfg: print the GPAC configuration helpnet: print network interfacesprompt: print the GPAC prompt help when running in interactive mode (see-k)modules: print available modulesmodule NAME: print info and options of moduleNAMEcreds: print credential helpfilters: print name of all available filtersfilters:*: print name of all available filters, including meta filterscodecs: print the supported builtin codecs โ use-hxto include unmapped codecs (ffmpeg, ...)formats: print the supported formats (-ha: print filter names,-hx: include meta filters (ffmpeg,...),-hh: print mime types)protocols: print the supported protocol schemes (-ha: print filter names,-hx: include meta filters (ffmpeg,...),-hh: print all)props: print the supported builtin PID and packet propertiesprops PNAME: print the supported builtin PID and packet properties mentioningPNAMEcolors: print the builtin color names and their valueslayouts: print the builtin CICP audio channel layout names and their valueslinks: print possible connections between each supported filters (use-hxto view src->dst cap bundle detail)links FNAME: print sources and sinks for filterFNAME(either builtin or JS filter)defer: print defer mode helpFNAME: print filterFNAMEinfo (multipleFNAMEcan be given)- For meta-filters, use
FNAME:INST, e.g.ffavin:avfoundation - Use
*to print info on all filters (big output!),*:*to print info on all filters including meta filter instances (really big output!) - By default only basic filter options and description are shown. Use
-hato show advanced options capabilities,-hxfor expert options,-hhfor all options and filter capabilities including on filters disabled in this build
- For meta-filters, use
FNAME.OPT: print optionOPTin filterFNAMEOPT: look in filter names and options forOPTand suggest possible matches if none found. Use-hxto look for keyword in all option descriptions
-p(string) โ use the indicated profile for the global GPAC config. If not found, the config file is created. If a file path is indicated, this will load the profile from that file. Otherwise, this will create a directory of the specified name and store the new config there. The following reserved names create a temporary profile (not stored on disk):0: full profilen: null profile disabling shared modules/filters and system paths in config (may break GUI and other filters) ๐ฌ Appending:reloadto the profile name will force recreating a new configuration file.
-alias(string) โ assign a new alias or remove an alias. Can be specified several times. See alias usage (-h alias)-aliasdoc(string) โ assign documentation for a given alias (optional). Can be specified several times-cache-infoโ show cache info. Argument can be:- absent: the entire cache is inspected
B: filter entries created afterB, withBa number of seconds prior to now or a date (0means now)B;C: filter entries created afterBbut beforeC, withBandCeither a number of seconds prior to now or a date- If
Bis0, min time isUTC=0 - If
Cis0, max time is now The argument syntax is the same for all cache options. ๐๏ธ
- If
-cache-unflatโ revert all items in the GPAC cache directory to their original name and server path-cache-listโ list entries in cache-cache-clean(int) โ clean cache ๐งน-js(string) โ specify a javascript file to use as controller of filter session (can be set multiple times for multiple scripts)-wcโ write all core options in the config file unless already set-weโ write all file extensions in the config file unless already set (useful to change some default file extensions)-wfโ write all filter options in the config file unless already set-wfxโ write all filter options and all meta filter arguments in the config file unless already set (large config file !) ๐ณ-xoptโ unrecognized options and filters declaration following this option are ignored โ used to pass arguments to GUI-creds(string) โ setup credentials as used by servers ๐-rvโ return absolute value of GPAC internal error instead of1when error
๐ง libgpac core options ๐ง
The following libgpac core options allow customizing the filter session:
-dbg-edgesโ log edges status in filter graph before dijkstra resolution (for debug). Edges are logged asedge_source(status(disable_depth), weight, src_cap_idx -> dst_cap_idx)-full-linkโ throw error if any PID in the filter graph cannot be linked ๐ฅ-no-dynfโ disable dynamically loaded filters-no-block(Enum, default:no) โ disable blocking mode of filtersno: enable blocking modefanout: disable blocking on fan-out, unblocking the PID as soon as one of its destinations requires a packetall: disable blocking
-no-regโ disable regulation (no sleep) in session ๐ด-no-reassignโ disable source filter reassignment in PID graph resolution
and that's part 1, bestie โ more coming, don't go anywhere ๐ซถ
-sched(Enum, default:free) โ sets the scheduler mode. so many vibes to choose from, pick ur fighter ๐ฅfree: lock-free queues except for task list (this is the default on most platforms)lock: mutexes for queues when several threads (default onarm64/aarch64)freex: lock-free queues including for task lists (experimental ๐ handle with care)flock: mutexes for queues even when no thread (debug mode)direct: no threads and direct dispatch of tasks whenever possible (debug mode)
-max-chain(int, default:6) โ sets the maximum chain length when resolving filter links. the default value covers for[ in -> ] dmx -> reframe -> decode -> encode -> reframe -> mx [ -> out]. filter chains loaded for adaptation (like a pixel format change, bestie) are loaded after the link resolution. Setting this to0disables dynamic link resolution entirely โ meaning you will have to specify the entire chain manually, no shortcuts, no autopilot ๐-max-sleep(int, default:50) โ sets the maximum sleep time slot in milliseconds when regulation is enabled ๐ด-step-linkโ load filters one by one when solving a link instead of loading all filters for the solved path. baby steps, we love a gradual approach ๐ฃ-threads(int) โ set N extra thread for the session.-1means use all available cores. go big or go home, periodt ๐ฅ-no-probeโ disables data probing on sources and relies on extension instead (faster load but more error-prone โ highkey a gamble, lowkey worth it sometimes ๐)-no-argchkโ disables tracking of argument usage (all arguments will be considered as used). nothing gets flagged as unused, everything's invited to the party ๐-blacklist(string) โ blacklist the filters listed in the given string (a comma-separated list). If the first character is-, this flips into a whitelist, i.e. only filters listed in the given string will be allowed. rude girl summer vs. exclusive guest list, ur call ๐-no-graph-cacheโ disables internal caching of filter graph connections. If disabled, the graph will be recomputed at each link resolution (lower memory usage but slower โ the classic tradeoff, no cap โ๏ธ)-no-reservoirโ disables memory recycling for packets and properties. This uses much less memory but stresses the system memory allocator much more. choosing violence against ur allocator fr fr ๐ญ-buffer-gen(int, default:1000) โ default buffer size in microseconds for generic pids-buffer-dec(int, default:1000000) โ default buffer size in microseconds for decoder input pids-buffer-units(int, default:1) โ default buffer size in frames when timing is not available-check-propsโ check known property types upon assignment and PID vs packet types upon fetch. in test mode, it exits with error code5if there's a mismatch. she's checking receipts and she WILL call it out ๐ต๏ธ
โจ Using Aliases โจ
okay so the gpac command line can become quite complex when lots of sources or filters are in play. to simplify all that chaos, an alias system is provided. it's giving quality of life ๐ซถ
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 replaced 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,
1being the first argument after the alias - backward index: the value
n(orN) to indicate the last argument on the command line. This can be followed by-xto 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. cute, documented, iconic ๐
๐ 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 option.
By default, this file does not exist until at least one user has been configured.
The creds option allows inspecting or modifying the users and groups information. The syntax for the option value is:
showor no value: prints theusers.cfgfilereset: deletes theusers.cfgfile (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 namepasswordresets 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
d1will be readable by all members of groupbar - the directory
d1/d2will be readable by userfooonly
Servers in GPAC currently only support the Basic HTTP authentication scheme, and should preferably be run over TLS. protect ur data bestie, wrap it in TLS like it's a lil scarf ๐งฃ
๐งช Defer test mode ๐งช
This mode can be used to test loading filters one by one and asking for link resolution explicitly. It is mostly used to reproduce how sessions are built in more complex applications.
The options rl, pi, pl and pd allow addressing a filter by index F in a list.
- if the option is suffixed with an
x(e.g.rlx=),F=0means the last filter in the list of filters in the session - otherwise,
F=0means the last filter declared before the option
The relink options -rl and -rlx always flush the session (run until no more tasks are scheduled). The last run can be omitted.
Example
gpac -dl -np -i SRC reframer -g -rl -g inspect -g -rl
This will load SRC and reframer, print the graph (no connection), relink SRC, print the graph (connection to reframer), insert inspect, print the graph (no connection), relink reframer and run. No play event is sent here.
Example
gpac -dl -np -i SRC reframer inspect:deep -g -rl=2 -g -rl -se
This will load SRC, reframer and inspect, print the graph (no connection), relink SRC, print the graph (connection to reframer), print the graph (no connection), relink reframer, send play and run.
Linking can be done once filters are loaded, using the syntax @F@SRC or @@F@SRC:
@Findicates the destination filter using a 0-based index F starting from the last loaded filter, e.g.@0indicates the last loaded filter.@@Findicates the target filter using a 0-based index F starting from the first loaded filter, e.g.@@1indicates the second loaded filter.@SRCor@@SRC: same syntax as link directives
Sources MUST be set before relinking outputs using -rl.
Example
gpac -dl -i SRC F1 F2 [...] @1@2 @0@2
This will set SRC as source to F1 and SRC as source to F2 after loading all filters.
The following options are used in defer mode:
-dlโ enable defer linking mode for step-by-step graph building tests-npโ prevent play event from sinks-rl[=F](string) โ relink outputs of filter F (default1)-wl[=F](string) โ same as-rlbut does not flush session-pi=[+|-][F[:i]](string) โ print PID properties (all or of index i) of filter F (default0)- if prefixed with
-: only list PIDs - if prefixed with
+: also print PID info
- if prefixed with
-pl=[+][F[:i]]@NAME(string) โ probe filter chain from filter F (default0) to the given filter NAME:- if prefixed with
+: print all known chains and their priorities
- if prefixed with
-pd=[F[:i]](string) โ print possible PID destinations (all or of index i) of filter F (default0)-fโ flush session until no more tasks-gโ print graph-sโ print stats-seโ send PLAY event from sinks (only done once)-m(string) โ print message
๐ธ Configuration file ๐ธ
Okay bestie, listen up, because GPAC has a whole little config file situation going on. It uses a configuration file to modify the default options of libgpac and its filters, and it's literally called GPAC.cfg. Where does it live? Depends on your platform, and the list is giving โจmulti-platform chaosโจ:
- on Windows platforms, in
C:UsersO0Datar, inC:Program FilesGPAC. - on iOS platforms, in a
.gpacfolder in the app storage directory. - on Android platforms, in
/sdcard/GPAC/if this directory exists, otherwise in/data/data/io.gpac.gpac/GPAC. - on other platforms, in a
$HOME/.gpac/.
Applications in GPAC can also specify a different configuration file through the -p profile option. EX gpac -p=foo []. This will load configuration from $HOME/.gpac/foo/GPAC.cfg, creating it if needed. The reserved name 0 is used to disable configuration file writing. ๐ซ
The configuration file is structured in sections, each made of one or more keys:
- section
foois declared as[foo] - key
barwith valueNis declared asbar=N
The key value N is not interpreted and always handled as ASCII text. Just vibes, no parsing. ๐
By default the configuration file only holds a few system specific options and directories. It is possible to serialize the entire set of options to the configuration file, using -wc and -wf. This should be avoided as the resulting configuration file size will be quite large, hence larger memory usage for the applications.
The options specified in the configuration file may be overridden by the values in restrict.cfg file located in GPAC share system directory (e.g. /usr/share/gpac or C:Program FilesGPAC), if present; this allows enforcing system-wide configuration values. ๐
Note: The methods describe in this section apply to any application in GPAC transferring their arguments to libgpac. This is the case forgpacandMP4Box.
๐ง Core options
The options from libgpac core can also be assigned though the config file from section core using option name without initial dash as key name.
Example
[core]
threads=2
Setting this in the config file is equivalent to using -threads=2. And the options specified at prompt overrides the value of the config file. Prompt wins, always. ๐
๐ Filter options in configuration
It is possible to alter the default value of a filter option by modifying the configuration file. Filter foo options are stored in section [filter@foo], using option name and value as key-value pair. Options specified through the configuration file do not take precedence over options specified at prompt or through alias.
Example
[filter@rtpin]
interleave=yes
This will force the rtp input filter to always request RTP over RTSP by default.
To generate a configuration file with all filters options serialized, use -wf. ๐ฆ
๐ Global filter options
It is possible to specify options global to multiple filters using --OPTNAME=VAL. Global options do not override filter options but take precedence over options loaded from configuration file. This will set option OPTNAME, when present, to VAL in any loaded filter.
Example
--buffer=100 -i file vout aout
This is equivalent to specifying vout:buffer=100 aout:buffer=100.
Example
--buffer=100 -i file vout aout:buffer=10
This is equivalent to specifying vout:buffer=100 aout:buffer=10.
Warning: This syntax only applies to regular filter options. It cannot be used with builtin shortcuts (gfreg,enc, ...).
Meta-filter options can be set in the same way using the syntax --OPT_NAME=VAL.
Example
--profile=Baseline -i file.cmp -o dump.264
This is equivalent to specifying -o dump.264:profile=Baseline.
For both syntaxes, it is possible to specify the filter registry name of the option, using --FNAME:OPTNAME=VAL or --FNAME@OPTNAME=VAL. In this case the option will only be set for filters which are instances of registry FNAME. This is used when several registries use same option names. So no accidental cross-talk, periodt. ๐
Example
--flist@timescale=100 -i plist1 -i plist2 -o live.mpd
This will set the timescale option on the playlists filters but not on the dasher filter.
๐ libgpac core options:
-tmp(string) โ specify directory for temporary file creation instead of OS-default temporary file management-noprogโ disable progress messages-quietโ disable all messages, including errors-proglfโ use new line at each progress messages-strict-error,-seโ exit after the first error is reported-store-dir(string) โ set storage directory-mod-dirs(string list) โ set additional module directories as a semi-colon;separated list-js-dirs(string list) โ set javascript directories-no-js-mods(string list) โ disable javascript module loading-ifce(string) โ set default multicast interface (default is ANY), either an IP address or a device name as listed bygpac -h net. Prefix+will force using IPv6 for dual interface-lang(string) โ set preferred language-cfg,-opt(string) โ get or set configuration file value. The string parameter can be formatted as:section:key=val: set the key to a new valuesection:key=null,section:key: remove the keysection=null: remove the section- no argument: print the entire configuration file
section: print the given sectionsection:key: print the given key in section (section can be set to*)*:key: print the given key in all sections
-no-saveโ discard any changes made to the config file upon exit-mod-reloadโ unload / reload module shared libs when no longer used-for-testโ disable all creation/modification dates and GPAC versions in files-old-archโ enable compatibility with pre-filters versions of GPAC-ntp-shift(int) โ shift NTP clock by given amount in seconds-bs-cache-size(int, default: 512) โ cache size for bitstream read and write from file (0 disable cache, slower IOs)-no-checkโ disable compliance tests for inputs (ISOBMFF for now). This will likely result in random crashes ๐ญ-unhandled-rejectionโ dump unhandled promise rejections-startup-file(string) โ startup file of compositor in GUI mode-docs-dir(string) โ default documents directory (for GUI on iOS and Android)-last-dir(string) โ last working directory (for GUI)-no-pollโ disable poll and use select for socket groups-no-tls-rcfgโ disable automatic TCP to TLS reconfiguration-no-fdโ use buffered IO instead of file descriptor for read/write - this can speed up operations on small files-no-mxโ disable all mutexes, threads and semaphores (do not use if unsure about threading used)-xml-max-csize(int, default: 100k) โ maximum XML content or attribute size-users(string) โ authentication configuration file for users and groups-netcap(string) โ set packet capture and filtering rules formatted as[CFG][RULES]. Each-netcapargument will define a configuration.
[CFG] is an optional comma-separated list of:
id=ID: ID (string) for this configuration. If NULL, configuration will apply to all sockets not specifying a netcap IDsrc=F: read packets from F, as produced by GPAC or a pcap or pcapng filedst=F: output packets to F (GPAC or pcap/pcapng file), cannot be set if src is setloop[=N]: loop capture file N times, or forever if N is not set or negativenrt: disable real-time playback
[RULES] is an optional list of [OPT,OPT2...] with OPT in:
m=K: set rule mode - K can berfor reception only (default),wfor send only orrwfor boths=K: set packet start range to Ke=K: set packet end range to K - only used forrandfrules, 0 or not set means rule apply until endn=K: set number of packets to drop to K - not set, 0 or 1 means single packetr=K: random drop n packet every Kf=K: drop first n packets every Kd=K: reorder n packets after the next K packets, can be used withforrrulesp=K: filter packets on port K only, if not set the rule applies to all packetso=K: patch packet instead of dropping (always true for TCP), replacing byte at offset K (0 is first byte, <0 for random)v=K: set patch byte value to K (hexa) or negative value for random (default)S=K: same assbut adds number of capture file reload/loopE=K: same asebut adds number of capture file reload/loop
Example
-netcap=dst=dump.gpc
This will record packets to dump.gpc
Example
-netcap=src=dump.gpc,id=NC1 -i session1.sdp:NCID=NC1 -i session2.sdp
This will read packets from dump.gpc only for session1.sdp and let session2.sdp use regular sockets
Example
-netcap=[p=1234,s=100,n=20][r=200,s=500,o=10,v=FE]
This will use regular network interface and drop packets 100 to 119 on port 1234 and patch one random packet every 200 starting from packet 500, setting byte 10 to FE
-cache(string) โ cache directory location-proxy(string) โ set HTTP proxy server address and port (if no protocol scheme is set, use same as target)-maxrate(int) โ set max HTTP download rate in bits per sec. 0 means unlimited-no-cacheโ disable HTTP caching-offline-cacheโ enable offline HTTP caching (no re-validation of existing resource in cache)-clean-cacheโ indicate if HTTP cache should be clean upon launch/exit-cache-size(int, default: 100M) โ specify maximum cache size on disk in bytes-cache-check(int, default: 60) โ cache clean interval in seconds, 0 only clean cache at startup-tcp-timeout(int, default: 5000) โ time in milliseconds to wait for HTTP/RTSP connect before error-req-timeout(int, default: 10000) โ time in milliseconds to wait on HTTP/RTSP request before error (0 disables timeout)-no-timeoutโ ignore HTTP 1.1 timeout in keep-alive-broken-certโ enable accepting broken SSL certificates-ca-bundle(string) โ path to a custom CA certificates bundle file-user-agent,-ua(string) โ set user agent name for HTTP/RTSP-user-profileid(string) โ set user profile ID (throughX-UserProfileIDentity header) in HTTP requests-user-profile(string)โ bestie, hand it a filename and it becomes ur user profile. The file's contents get appended as the body of HTTP HEAD/GET requests, and the associated Mime istext/xml. Slay.-query-string(string)โ shove a query string into the URL of requests. Note: without the?, babe, just the string itself.-dm-threadsโ forces threads to be used for async download requests instead of the session scheduler. it's giving "I'll do it myself" ๐-cte-rate-wnd(int, default: 20)โ sets the window analysis length, in milliseconds, for chunk-transfer encoding rate estimation. tiny window, big math energy ๐ฅ-cred(string)โ path to a 128 bits key for credential storage. keep that key safe, queen ๐-no-h2โ disable HTTP2. bye bestie ๐-no-h2cโ disable HTTP2 upgrade (i.e. over non-TLS). no glow-up for you โจ-h2-copyโ enable intermediate copy of data in nghttp2 (default is disabled but may report as broken frames in wireshark). so like, off by default, but wireshark might start accusing u of broken frames ๐-curlโ use CURL instead of the GPAC HTTP stack. different stack, same drama ๐-h3(Enum, default: auto)โ set HTTP/3 mode. the options are:no: disable HTTP/3first: force trying first with HTTP/3auto: connect using HTTP 1 or 2 and use HTTP/3 for next request(s) if announcedonly: only use HTTP/3
-h3-traceโ trace QUIC and HTTP3. so u can watch the packets do their lil dance ๐ฆ-dbg-edgesโ log edges status in the filter graph before dijkstra resolution (for debug). Edges are logged asedge_source(status(disable_depth), weight, src_cap_idx -> dst_cap_idx). debug girlies, this one's for u ๐-full-linkโ throw error if any PID in the filter graph cannot be linked. no ghost PIDs allowed, periodt.-no-dynfโ disable dynamically loaded filters.-no-block(Enum, default: no)โ disable blocking mode of filters:no: enable blocking modefanout: disable blocking on fan-out, unblocking the PID as soon as one of its destinations requires a packetall: disable blocking
-no-regโ disable regulation (no sleep) in session. no naps. ever. ๐ด๐ซ-no-reassignโ disable source filter reassignment in PID graph resolution.-sched(Enum, default: free)โ set scheduler mode:free: lock-free queues except for task list (default on most platforms)lock: mutexes for queues when several threads (default onarm64/aarch64)freex: lock-free queues including for task lists (experimental)flock: mutexes for queues even when no thread (debug mode)direct: no threads and direct dispatch of tasks whenever possible (debug mode)
-max-chain(int, default: 6)โ sets the maximum chain length when resolving filter links. The default value covers for[ in -> ] dmx -> reframe -> decode -> encode -> reframe -> mx [ -> out]. Filter chains loaded for adaptation (e.g. pixel format change) are loaded after the link resolution. Setting the value to0disables dynamic link resolution โ and then u will have to specify the entire chain manually. no shortcuts, bestie ๐ค-max-sleep(int, default: 50)โ set maximum sleep time slot in milliseconds when regulation is enabled.-step-linkโ load filters one by one when solvink a link instead of loading all filters for the solved path. (yes, "solvink" โ the manpage said it, so I said it ๐)-threads(int)โ set N extra thread for the session.-1means use all available cores. go big or go home ๐ฅ-no-probeโ disable data probing on sources and relies on extension (faster load but more error-prone). speedrun mode, but risky ๐โโ๏ธ-no-argchkโ disable tracking of argument usage (all arguments will be considered as used). nothing to see here, everything's fine โจ-blacklist(string)โ blacklist the filters listed in the given string (comma-separated list). If the first character is-, this is a whitelist, i.e. only filters listed in the given string will be allowed. plot twist, the dash flips the whole meaning ๐ญ-no-graph-cacheโ disable internal caching of filter graph connections. If disabled, the graph will be recomputed at each link resolution (lower memory usage but slower). trade-offs, always trade-offs ๐-no-reservoirโ disable memory recycling for packets and properties. This uses much less memory but stresses the system memory allocator much more. your RAM stays light, ur allocator starts spiraling ๐ญ-buffer-gen(int, default: 1000)โ default buffer size in microseconds for generic pids.-buffer-dec(int, default: 1000000)โ default buffer size in microseconds for decoder input pids. that's a whole second, babe ๐-buffer-units(int, default: 1)โ default buffer size in frames when timing is not available.-check-propsโ check known property types upon assignment and PID vs packet types upon fetch (in test mode, exit with error code5if mismatch). the vibe check, but for properties ๐-gl-bits-comp(int, default: 8)โ number of bits per color component in OpenGL.-gl-bits-depth(int, default: 16)โ number of bits for depth buffer in OpenGL.-gl-doublebufโ enable OpenGL double buffering. two buffers, double the drama, double the slay ๐-glfbo-txid(int)โ set output texture ID when usingglfbooutput. The OpenGL context shall be initialized andgf_term_processshall be called with the OpenGL context active. don't skip that step, bestie ๐ซถ-video-output(string)โ indicate the name of the video output module to use (seegpac -h modules). The reserved nameglfbois used in player mode to draw in the OpenGL texture identified by.I glfbo-txid. In this mode, the application is responsible for sending event to the compositor.-audio-output(string)โ indicate the name of the audio output module to use.-font-reader(string)โ indicate name of font reader module.-font-dirs(string)โ indicate comma-separated list of directories to scan for fonts. font shopping spree ๐-rescan-fontsโ indicate the font directory must be rescanned.-wait-fontsโ wait for SVG fonts to be loaded before displaying frames. patience is a virtue, queen ๐ง-webvtt-hoursโ force writing hour when serializing WebVTT. hour girlies rise ๐-charset(string)โ set charset when not recognized from input. Possible values are:utf8: force UTF-8utf16: force UTF-16 little endianutf16be: force UTF-16 big endianother: attempt to parse anyway
-srt-forcedโ enable SRT with forced subtitles extensions.-rmtโ enable remote monitoring webserver.-rmt-port(int, default: 6363)โ set rmt ws port.-rmt-localhostโ make rmt ws only accepts localhost connection. no strangers allowed ๐ โโ๏ธ-rmt-sleep(int, default: 10)โ set rmt ws sleep (ms) between server updates.-rmt-cert(string)โ rmt ws: certificate file in PEM format to use for TLS mode.-rmt-pkey(string)โ rmt ws: private key file in PEM format to use for TLS mode. keep this one SECRET ๐-userws-port(int, default: 6364)โ set user ws port.-userws-localhostโ make userws ws only accepts localhost connection.-userws-sleep(int, default: 10)โ set userws sleep (ms) between server updates.-userws-cert(string)โ userws: certificate file in PEM format to use for TLS mode.-userws-pkey(string)โ userws: private key file in PEM format to use for TLS mode.-diso-nosizeโ skip box size info when dumping ISOBMFF.-m2ts-vvc-oldโ hack for old TS streams using0x32for VVC instead of0x33. legacy mess, but we respect it ๐-piff-force-subsamplesโ hack for PIFF PSEC files generated by0.9.0and1.0MP4Box with wrongsubsample_countinserted for audio. ancient bugs, still haunting us ๐ป-vvdec-annexbโ hack for oldvvdec+libavcodecsupporting onlyannexBformat.-heif-hevc-urnโ use HEVC URN for alpha and depth in HEIF instead of MPEG-B URN (HEIF first edition).-boxdir(string)โ use box definitions in the given directory for XML dump.-no-mabr-patchโ disable GPAC parsing of patched isom boxes from mabr (will behave like most browsers/players). fitting in with the crowd, lowkey ๐ซถ-no-cdrfโ disable cdrf sample dep.
๐ libgpac logs options โจ
-noprogโ disable progress messages. no lil loading bars for u ๐ซ-quietโ disable all messages, including errors. silence. total silence. even the errors get ghosted ๐-log-file,-lf(string)โ set output log file.-log-clock,-lcโ log time in micro sec since start time of GPAC before each log line except for app tool.-log-utc,-luโ log UTC time in ms before each log line except for app tool.-logs(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 logserror: logs only error messageswarning: logs error+warning messagesinfo: logs error+warning+info messagesdebug: logs all messagesstrict: exit if error for this log tool and use default log level if tool
toolX can be one of:
core: libgpac coremutex: log all mutex callsmem: GPAC memory trackermodule: GPAC modules (av out, font engine, 2D rasterizer)filter: filter session debuggingsched: filter session scheduler debuggingcodec: 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 filtersnetwork: TCP/UDP sockets and TLShttp: HTTP trafficcache: HTTP cache subsystemrtp: RTP trafficdash: HTTP streaming logsroute: ROUTE (ATSC3) debuggingmedia: messages from generic filters and reframer/rewriter filtersparser: textual parsers (svg, xmt, bt, ...)mmio: I/O management (AV devices, file, pipes, OpenGL)audio: audio renderer/mixer/outputscript: script engine except console logconsole: script console logscene: scene graph and scene managercompose: composition engine (2D, 3D, etc)ctime: media and SMIL timing info from composition engineinteract: interaction messages (UI events and triggered DOM events and VRML route)rti: run-time stats of compositorall: 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 on any tool.
levelX can accept the suffix +strict to force strict error only for the given log tool(s).
Example
-logs=all@info:dash@debug:ncl
This moves all log to info level, dash to debug level and disable color logs. the glow-up, but for ur terminal ๐
-proglfโ use new line at each progress messages.-log-dual,-ldโ output to both file and stderr. why choose one when u can have both ๐
๐ธ Overview ๐ธ
Okay bestie, listen up, because this is the whole โจvibeโจ of GPAC. Filters are these configurable little processing units that eat data packets and spit data packets back out. And those packets get carried between filters through a data channel called a PID. A PID is the one in charge of allocating and tracking all the data packets, and then handing them off to the destination filter(s). One filter output PID can be connected to zero or more filters โ and this fan-out is handled internally by GPAC. So there is literally no such thing as a tee filter in GPAC, periodt. ๐
โ ๏ธ Note: When a PID cannot be connected to any filter, a warning is thrown and all packets dispatched on this PID will be destroyed. The session may however still run, unless -full-link is set. ๐ญ
Every output PID carries a set of properties describing the data it delivers (think width, height, codec, ...). Properties can be built-in (see gpac -h props), or user-defined. And the way each PID tracks its property changes and triggers filter reconfiguration during packet processing? Iconic. It means the filter chain can be reconfigured at run time, potentially reloading part of the chain (e.g. unload a video decoder when switching from compressed to uncompressed sources). Main character energy fr fr. ๐
Each filter exposes a set of arguments to configure itself, using property types and values described as strings formatted with separators. This help is given with default separator sets :=#,@ to specify filters, properties and options. Wanna change them? Use -seps. ๐
โจ Property and filter option format โจ
- boolean: formatted as
yes,true,1orno,false,0 - enumeration (for filter arguments only): must use the syntax given in the argument description, otherwise value
0(first in enum) is assumed. - 1-dimension (numbers, floats, ints...): formatted as
value[unit], where unit can bek,K(x 1000) orm,M(x 1000000) org,G(x 1000000000) orsec(x 1000) ormin(x 60000).+Imeans max float/int/uint value,-Imin float/int/uint value. - fraction: formatted as
num/denornum-denornum, in which case the denominator is1if num is an integer, or1000000if num is a floating-point value. - unsigned 32 bit integer: formatted as number or hexadecimal using the format
0xAABBCCDD. - N-dimension (vectors): formatted as
DIM1xDIM2[xDIM3[xDIM4]]values, without unit multiplier.- For 2D integer vectors, the following resolution names can be used:
360,480,576,720,1080,hd,2k,2160,4k,4320,8k
- For 2D integer vectors, the following resolution names can be used:
- string: formatted as:
value: copies value to string.file@FILE: load string from local FILE (opened in binary mode).bxml@FILE: binarize XML from local FILE and set property type to data - see https://wiki.gpac.io/xmlformats/NHML-Format.
- data: formatted as:
size@address: constant data block, not internally copied; size gives the size of the block, address the data pointer.0xBYTESTRING: data block specified in hexadecimal, internally copied.file@FILE: load data from local FILE (opened in binary mode).bxml@FILE: binarize XML from local FILE - see https://wiki.gpac.io/xmlformats/NHML-Format.b64@DATA: load data from base-64 encoded DATA.FMT@val: load values from val (comma-separated list) with FMT beingu8,s8,u16,s16,u32,s32,u64,s64,flt,dbl,hexorstr.
- pointer: pointer address as formatted by
%pin C. - string lists: formatted as
val1,val2[,...]. Each value can also usefile@FILEsyntax. - integer lists: formatted as
val1,val2[,...]
โ ๏ธ Note: The special characters in property formats (0x,/,-,+I,-I,x) cannot be configured.
Numbers and fraction can be expressed as THH:MM:SS.ms, TMM:SS.ms, THH:MM:SS or TMM:SS, translated into milliseconds. ๐
๐ Filter declaration [FILTER] ๐
๐ฆ Generic declaration ๐ฆ
Each filter is declared by its name, with optional filter arguments appended as a list of colon-separated name=value pairs. Additional syntax is provided for:
- boolean: value can be omitted, defaulting to
true(e.g.:allt). Using!before the name negates the result (e.g.:!moof_first) - enumerations: name can be omitted, e.g.
:disp=pbois equivalent to:pbo.
When string parameters are used (e.g. URLs), it is recommended to escape the string using the keyword gpac. โจ
Example
filter:ARG=http://foo/bar?yes:gpac:opt=VAL
This will properly extract the URL. Slay.
Example
filter:ARG=http://foo/bar?yes:opt=VAL
This will fail to extract it and keep :opt=VAL as part of the URL. ๐
The escape mechanism is not needed for local source, for which file existence is probed during argument parsing. It is also not needed for builtin protocol handlers (avin://, video://, audio://, pipe://). For schemes not using a server path, e.g. tcp:// and udp://, the escape is not needed if a trailing / is appended after the port number.
Example
-i tcp://127.0.0.1:1234:OPT
This will fail to extract the URL and options. ๐ญ
Example
-i tcp://127.0.0.1:1234/:OPT
This will extract the URL and options. ๐ซถ
โ ๏ธ Note: one trick to avoid the escape sequence is to declare the URLs option at the end, e.g. f1:opt1=foo:url=http://bar, provided you have only one URL parameter to specify on the filter.
It is possible to locally disable option parsing (usefull for string options) by duplicating the separator. ๐
Example
filter::opt1=UDP://IP:PORT/:someopt=VAL::opt2=VAL2
This will pass UDP://IP:PORT/:someopt=VAL to opt1 without inspecting it, and VAL2 to opt2.
๐ Source and Sink filters ๐
Source and sink filters do not need to be addressed by the filter name, specifying src= or dst= instead is enough. You can also use the syntax -src URL or -i URL for sources and -dst URL or -o URL for destination, this allows prompt completion in shells. ๐
Example
"src=file.mp4" or "-src file.mp4" or "-i file.mp4"
This will find a filter (for example fin) able to load file.mp4. The same result can be achieved by using fin:src=file.mp4.
Example
"dst=dump.yuv" or "-dst dump.yuv" or "-o dump.yuv"
This will dump the video content in dump.yuv. The same result can be achieved by using fout:dst=dump.yuv.
Specific source or sink filters may also be specified using filterName:src=URL or filterName:dst=URL.
The src= and dst= syntaxes can also be used in alias for dynamic argument cloning (see gpac -hx alias).
โญ Forcing specific filters โญ
There is a special option called gfreg which allows specifying preferred filters to use when handling URLs. ๐
Example
src=file.mp4:gfreg=ffdmx,ffdec
This will use ffdmx to read file.mp4 and ffdec to decode it. This can be used to test a specific filter when alternate filter chains are possible.
๐ง Specifying encoders and decoders ๐ง
By default filters chain will be resolved without any decoding/encoding if the destination accepts the desired format. Otherwise, decoders/encoders will be dynamically loaded to perform the conversion, unless dynamic resolution is disabled. There is a special shortcut filter name for encoders enc allowing to match a filter providing the desired encoding. The parameters for enc are:
c=NAME: identifies the desired codec. NAME can be the GPAC codec name or the encoder instance for ffmpeg/othersb=UINT,rate=UINT,bitrate=UINT: indicates the bitrate in bits per secondg=UINT,gop=UINT: indicates the GOP size in framespfmt=NAME: indicates the target pixel format name (see properties (-h props) ) of the source, if supported by codecall_intra=BOOL: indicates all frames should be intra frames, if supported by codec
Other options will be passed to the filter if it accepts generic argument parsing (as is the case for ffmpeg). The shortcut syntax c=TYPE (e.g. c=aac:opts) is also supported. โจ
Example
gpac -i dump.yuv:size=320x240:fps=25
enc:c=avc:b=150000:g=50:cgop=true:fast=true -o raw.264
This creates a 25 fps AVC at 175kbps with a gop duration of 2 seconds, using closed gop and fast encoding settings for ffmpeg. Ate. ๐ฅ
The inverse operation (forcing a decode to happen) is possible using the reframer filter.
Example
gpac -i file.mp4 reframer:raw=av -o null
This will force decoding media from file.mp4 and trash (send to null) the result (doing a decoder benchmark for example).
๐ Escaping option separators ๐
When a filter uses an option defined as a string using the same separator character as gpac, you can either modify the set of separators, or escape the separator by duplicating it. The options enclosed by duplicated separator are not parsed. This is mostly used for meta filters, such as ffmpeg, to pass options to sub-filters such as libx264 (cf x264opts parameter). This can also be used to escape a list value containing the comma separator character. ๐ธ
Example
f:a=foo:b=bar
This will set option a to foo and option b to bar on the filter.
Example
f::a=foo:b=bar
This will set option a to foo:b=bar on the filter.
Example
f:a=foo::b=bar:c::d=fun
This will set option a to foo, b to bar:c and the option d to fun on the filter.
Example
f:list=a,b1,,b2,c
This will set list values to a, b1,b2, and c.
๐ Filter linking [LINK] ๐ซ
okay so every filter out here exposes one or more sets of capabilities, and we call those a capability bundle โ they're property type + values that have to be matched or excluded by the PIDs that connect in. no cap, bestie.
wanna see the possible sources and destinations for a filter FNAME? just ask:
gpac -h links FNAME
the filter graph resolver takes that info, pairs it up with the PID properties, and links your filters together. that's the whole vibe check. ๐
so what do link directives do? when you hand them over, they say which source a filter can accept connections from. that's it. they do not say which destination a filter can connect to. read that again, it matters. ๐
โจ Default filter linking โจ
when you don't give any link instructions (see below for those), the default linking strategy is either implicit mode (the default in gpac) or complete mode (if -cl is set).
every PID gets checked for a possible connection to all the defined filters, in their declaration order.
for each filter DST that accepts a connection from the PID โ directly or with intermediate filters โ here's the tea:
- if
DSTfilter has link directives, use them to allow or reject the PID connection. - otherwise, if complete mode is enabled, allow the connection.
- otherwise (implicit mode):
- if
DSTis not a sink and is the first matching filter with no link directive, allow the connection. - otherwise, if
DSTis not a sink and is not the first matching filter with no link directive, reject the connection. - otherwise (DST is a sink) and there are no previous connections to a non-sink filter, allow the connection.
- if
in all linking modes, a filter can stop itself from being linked to a filter with no link directives by setting the RSID option on that filter. this is typically needed when you're dynamically inserting/removing filters in an existing session where some filters have no ID defined and you don't want them in the inserted chain. ๐ซ
heads up: a filter with RSID set is not clonable. no cap.
Example
gpac -i file.mp4 c=avc -o output
with this setup in implicit mode:
- if the file has a video PID, it'll connect to enc but not to output. the output PID of enc will connect to output.
- if the file has other PIDs than video, they'll connect to output, since this enc filter only accepts video.
Example
gpac -cl -i file.mp4 c=avc -o output
with this setup in complete mode:
- if the file has a video PID, it'll connect both to enc and to output, and the output PID of enc will connect to output.
- if the file has other PIDs than video, they'll connect to output.
furthermore, in implicit mode, filter connections are restricted to filters defined between the last source and the sink(s). ๐ซถ
Example
gpac -i video1 reframer:saps=1 -i video2 ffsws:osize=128x72 -o output
this will connect:
- video1 to reframer, then reframer to output, but it will prevent the reframer โ ffsws connection.
- video2 to ffsws, then ffsws to output, but it will prevent the video2 โ reframer connection.
Example
gpac -i video1 -i video2 reframer:saps=1 ffsws:osize=128x72 -o output
this will connect video1 AND video2 to reframer โ ffsws โ output. slay.
the implicit mode lets you specify linear processing chains (no PID fan-out except for the final output(s)) without link directives, which simplifies command lines for the common cases. it's giving convenience. โจ
โ ๏ธ Warning: argument order really matters in implicit mode!
Example
gpac -i file.mp4 c=avc c=aac -o output
- if the file has a video PID, it'll connect to c=avc but not to output. the output PID of c=avc will connect to output.
- if the file has an audio PID, it'll connect to c=aac but not to output. the output PID of c=aac will connect to output.
- if the file has other PIDs than audio or video, they'll connect to output.
Example
gpac -i file.mp4 ffswf=osize:128x72 c=avc resample=osr=48k c=aac -o output
this will force:
- SRC(video) โ ffsws โ enc(video) โ output, and prevent SRC(video) โ output, SRC(video) โ enc(video) and ffsws โ output connections, which would happen in complete mode.
- SRC(audio) โ resample โ enc(audio) โ output, and prevent SRC(audio) โ output, SRC(audio) โ enc(audio) and resample โ output connections, which would happen in complete mode.
๐ Quick links ๐
you can also manually specify links between filters, if that's your thing. the syntax is an @ character, optionally followed by an integer (0 if you omit it).
this means the following filter specified at the prompt should be linked only to a previously listed filter. ๐
the optional integer is a 0-based index to the previous filter declarations โ 0 is the previous filter declaration, 1 is the one before the previous declaration, and so on and so on.
if you use @@ instead of @, the optional integer gives the filter index starting from the first filter (index 0) specified in the command line.
several link directives can be given for one filter. go off. ๐ฅ
Example
fA fB @1 fC
this means fC only accepts inputs from fA.
Example
fA fB fC @1 @0 fD
this means fD only accepts inputs from fB and fC.
Example
fA fB fC ... @@1 fZ
this means fZ only accepts inputs from fB.
๐ Complex links ๐
the @ link directive is just a quick little shortcut that sets the following filter arguments:
FID=name: assigns an identifier to the filter.SID=name1[,name2...]: sets a list of filter identifiers, aka sourceIDs, restricting the list of possible inputs for a filter.
Example
fA fB @1 fC
this is equivalent to fA:FID=1 fB fC:SID=1.
Example
fA:FID=1 fB fC:SID=1
this means fC only accepts input from fA, but fB might accept inputs from fA.
Example
fA:FID=1 fB:FID=2 fC:SID=1 fD:SID=1,2
this means fD only accepts input from fA and fB, and fC only from fA.
๐ Note: a filter with sourceID set cannot get input from filters with no IDs.
a sourceID name can be extended even further using a fragment identifier (# by default):
name#PIDNAME: accepts only PID(s) with name PIDNAME.name#TYPE: accepts only PIDs of matching media type. TYPE can beaudio,video,scene,text,font,meta.name#TYPEN: accepts only the N (1-based index) PID of matching type from the source (e.g.video2to only accept the second video PID).name#TAG=VAL: accepts the PID if its parent filter has no tag or a tag matching VAL.name#ITAG=VAL: accepts the PID if its parent filter has no inherited tag or an inherited tag matching VAL.name#P4CC=VAL: accepts only PIDs with a builtin property of type P4CC and value VAL.name#PName=VAL: same as above, using the builtin name corresponding to the property.name#AnyName=VAL: same as above, using the name of a non built-in property.name#Name=OtherPropName: compares the value with the value of another property of the PID. the matching will fail if the value to compare to is not present or different from the value to check. the property to compare with shall be a built-in property.
if the property isn't defined on the PID, the property is matched. otherwise, its value is checked against the given value. ๐ธ
the following modifiers for comparisons are allowed (for any fragment format using =):
name#P4CC=!VAL: accepts only PIDs with property NOT matching VAL.name#P4CC-VAL: accepts only PIDs with property strictly less than VAL (only for 1-dimension number properties).name#P4CC+VAL: accepts only PIDs with property strictly greater than VAL (only for 1-dimension number properties).
a sourceID name can also use a wildcard, or just be empty, to match a property regardless of the source filter. ๐ฆ
Example
fA fB:SID=*#ServiceID=2
fA fB:SID=#ServiceID=2
this means match the connection between fA and fB only for PIDs with a ServiceID property of 2.
these extensions also work with the LINK @ shortcut. ๐ซ
Example
fA fB @1#video fC
this means fC only accepts inputs from fA, and of type video.
Example
gpac -i img.heif @#ItemID=200 vout
this means connect to vout only PIDs with ItemID property equal to 200.
Example
gpac -i vid.mp4 @#PID=1 vout
this means connect to vout only PIDs with ID property equal to 1.
Example
gpac -i vid.mp4 @#Width=640 vout
this means connect to vout only PIDs with Width property equal to 640.
Example
gpac -i vid.mp4 @#Width-640 vout
this means connect to vout only PIDs with Width property less than 640.
Example
gpac -i vid.mp4 @#ID=ItemID#ItemNumber=1 vout
this will connect to vout only the PID with an ID property equal to the ItemID property (keep items, discard tracks) and an Item number of 1 (first item).
multiple fragments can be specified to check for multiple PID properties. ๐
Example
gpac -i vid.mp4 @#Width=640#Height+380 vout
this means connect to vout only PIDs with Width property equal to 640 and Height greater than 380.
โ ๏ธ Warning: if a PID directly connects to one or more explicitly loaded filters, no further dynamic link resolution will be done to connect it to other filters with no sourceID set. link directives should be carefully set up, fr fr.
Example
fA @ reframer fB
if fB accepts inputs provided by fA but reframer does not, this will link the fA PID to the fB filter since fB has no sourceID. and since the PID is connected, the filter engine will not try to solve a link between fA and reframer.
an exception is made for local files: by default, a local file destination will force a remultiplex of input PIDs from a local file. ๐
Example
gpac -i file.mp4 -o dump.mp4
this will prevent a direct connection of a PID of type file to the dst file.mp4, remultiplexing the file instead.
the special option nomux is used to allow direct connections (it's ignored for non-sink filters). โจ
Example
gpac -i file.mp4 -o dump.mp4:nomux
this will result in a direct file copy.
this only applies to local files destination. for pipes, sockets or other file outputs (HTTP, ROUTE):
- direct copy is enabled by default.
nomux=0can be used to force remultiplex.
๐ Sub-session tagging ๐
filters can be assigned to a sub-session using :FS=N, with N a positive integer.
filters belonging to different sub-sessions may only link to each-other:
- if explicitly allowed through sourceID directives (
@orSID) - or if they have the same sub-session identifier
this is mostly used for implicit mode in gpac: each first source filter specified after a sink filter will trigger a new sub-session. ๐ง
Example
gpac -i in1.mp4 -i in2.mp4 -o out1.mp4 -o out2.mp4
this will result in both inputs multiplexed in both outputs.
Example
gpac -i in1.mp4 -o out1.mp4 -i in2.mp4 -o out2.mp4
this will result in in1 mixed to out1 and in2 mixed to out2, these last two filters belonging to a different sub-session. ๐
Arguments inheriting ๐
Unless you literally turn it off (peep -max-chain), the filter engine is out here doing the most: it resolves implicit and explicit (LINK) connections between your filters and allocates any filter chain needed to connect them. And when it loads those new filters, it hands them arguments inherited from both the source and the destination. Bestie behaviour honestly.
Example ๐
gpac -i file.mp4:OPT -o file.aac -o file.264
This passes the :OPT to every single filter loaded between the source and the two destinations.
Example โจ
gpac -i file.mp4 -o file.aac:OPT -o file.264
This passes the :OPT to all the filters loaded between the source and the file.aac destination.
Note: the destination arguments that get inherited are the arguments placed AFTER the dst= option.
Example ๐ธ
gpac -i file.mp4 fout:OPTFOO:dst=file.aac:OPTBAR
This passes the :OPTBAR to all filters loaded between the file.mp4 source and the file.aac destination โ but not OPTFOO.
You can stop the inheriting at any point using the keyword gfloc: โ anything after that keyword does not get inherited.
Example ๐ฆ
gpac -i file.mp4 -o file.aac:OPTFOO:gfloc:OPTBAR -o file.264
This passes :OPTFOO to all filters loaded between the file.mp4 source and the file.aac destination, but not OPTBAR.
Arguments are tracked by default, so the engine can check whether the filter chain actually used them โ and it'll throw a warning if it didn't. Sometimes you've got arguments that may or may not get consumed depending on how the graph resolves, and for that the keyword gfopt is your girl: arguments after it will not be tracked.
Example ๐
gpac -i file.mp4 -o file.aac:OPTFOO:gfopt:OPTBAR -o file.264
This warns if OPTFOO isn't consumed, but won't track OPTBAR.
A filter can also get itself a name (purely for inspection vibes, it does not inherit) using the :N=name option. That name isn't used in link resolution at all and the filter instance can just change it at runtime. Slay, flexible.
A filter can be given a tag (any string you want) using :TAG=name. Tags don't need to be unique, and you can use them to exclude a filter during link resolution. Tags are not inherited, so dynamically loaded filters never have a tag.
A filter can also be given an inherited tag (any string) using :ITAG=name. These ones do inherit, and they're typically used to track dynamically loaded filters. Iconic.
URL templating ๐
Destination URLs can be built dynamically with templates. The pattern $KEYWORD$ gets replaced with the resolved value, and $KEYWORD%%0Nd$ gets replaced with the resolved integer, padded with up to N zeros if needed.
KEYWORD is case sensitive, and it can show up multiple times in the string. Supported KEYWORDs, bestie:
numโ replaced by file number if defined,0otherwisePIDโ ID of the source PIDURLโ URL of source fileFileโ path on disk for source file; if not found, useURLif set, or PID name otherwiseTypeโ name of stream type of PID (video,audio...)OTypeโ same asTypebut uses original type when stream is encrypted (e.g. move fromcrypttovideo)p4cc=ABCDโ uses PID property with 4CC valueABCDpname=VALโ uses PID property with nameVALcts,dts,dur,sapโ uses properties of first packet in PID at template resolution timeOTHERโ locates property 4CC for the given name, or property name if no 4CC matches.
$$ is your escape for $. And for shells that auto-replace $$ with $, you can use the syntax $;$ to express $$.
Templating is a whole mood when you're encoding several qualities in one pass.
Example ๐
gpac -i dump.yuv:size=640x360 vcrop:wnd=0x0x320x180 c=avc:b=1M @2 c=avc:b=750k -o dump_$CropOrigin$x$Width$x$Height$.264
This creates a cropped version of the source, encoded in AVC at 1M, plus a full version of the content in AVC at 750k. The outputs will be dump_0x0x320x180.264 for the cropped one and dump_0x0x640x360.264 for the non-cropped one. Literally so satisfying.
Cloning filters ๐
When a filter accepts a single connection and already has a connected input, it's no longer available for dynamic resolution. Sometimes that's just not the vibe you want. Take a HEIF file with N items and do:
gpac -i img.heif -o dump_$ItemID$.jpg
In this case, only one item (likely the first declared in the file) will connect to the destination. The other items won't connect at all, because the destination only accepts one input PID.
Example ๐
gpac -i img.heif -o dump_$ItemID$.jpg
In this case, the destination gets cloned for each item, and they all get exported to different JPEGs thanks to URL templating. Chef's kiss.
Example ๐ง
gpac -i vid.mpd c=avc:FID=1 -o transcode.mpd:SID=1
Here the encoder gets cloned for each video PID in the source, and the destination only uses PIDs coming from the encoders.
When implicit linking is on, all filters are clonable by default. That's what lets you duplicate the processing for each PID of the same type.
Example ๐
gpac -i dual_audio resample:osr=48k c=aac -o dst
The resampler filter gets cloned for each audio PID, and the encoder gets cloned for each resampler output.
And you can explicitly deactivate the cloning instructions if you want:
gpac -i dual_audio resample:osr=48k:clone=0 c=aac -o dst
Now the first audio connects to the resample filter, the second one goes to the enc filter, and the resample output connects to a clone of the enc filter. Chaotic but valid.
Templating filter chains ๐ซถ
Sometimes the number of outputs you want depends on the source content โ like dumping a multiplex of N services into N files. When the destination involves multiplexing the input PIDs, the :clone option alone isn't enough, because the multiplexer will always accept the input PIDs. Annoying.
To handle this, you can use a PID property name in the sourceID of a filter with the value * or an empty value. Whenever a new PID shows up with a new value for that property, the filter with such sourceID gets dynamically cloned. Boom.
Warning: this feature should only be called with a single property set to * (or empty) per source ID. Results are undefined otherwise. Do not test fate, bestie.
Example โญ
gpac -i source.ts -o file_$ServiceID$.mp4:SID=*#ServiceID=*
gpac -i source.ts -o file_$ServiceID$.mp4:SID=#ServiceID=
Here, each new ServiceID value found while connecting PIDs to the destination creates a new destination file.
Cloning in implicit linking mode applies to output as well:
gpac -i dual_audio -o dst_$PID$.aac
Each audio track gets dumped to aac (potentially reencoding if needed).
Assigning PID properties ๐
You can define properties on output PIDs that a filter will declare. This is how you tag parts of the graph with different properties than other parts (say, ServiceID). The syntax is the same as a filter option, and it uses the fragment separator to identify properties, e.g. #Name=Value.
This sets the output PIDs property (4cc, built-in name, or literally any name) to the given value. The value can be omitted for a boolean (it defaults to true, e.g. :#Alpha).
Non built-in properties get parsed like this:
file@FOOwill be declared as string with a value set to the content ofFOO.bxml@FOOwill be declared as data with a value set to the binarized content ofFOO.FOOwill be declared as string with a value set toFOO.TYPE@FOOwill be parsed according toTYPE. If the type isn't recognized, the entire value is copied as string. Seegpac -h propsfor the defined types.
User-assigned PID properties on filter fA get inherited by all filters dynamically loaded to solve the fA -> fB connection. But if fB also has user-assigned PID properties, those only apply starting from fB in the chain and are not inherited by the filters between fA and fB. Keep that in mind.
Warning: properties are not filtered and they override the properties of the filter's output PIDs. Be careful not to break the session by overriding core properties such aswidth/height/samplerate/... ! Seriously, don't.
Example ๐ฅ
gpac -i v1.mp4:#ServiceID=4 -i v2.mp4:#ServiceID=2 -o dump.ts
This multiplexes the streams in dump.ts, using ServiceID 4 for PIDs from v1.mp4 and ServiceID 2 for PIDs from v2.mp4.
PID properties can also be assigned conditionally by checking other PID properties. The syntax uses parenthesis (not configurable, sorry) after the property assignment sign:
#Prop=(CP=CV)VAL
This assigns PID property Prop to VAL for PIDs with property CP equal to CV.
#Prop=(CP=CV)VAL,(CP2=CV2)VAL2
This assigns PID property Prop to VAL for PIDs with property CP equal to CV, and to VAL2 for PIDs with property CP2 equal to CV2.
#Prop=(CP=CV)(CP2=CV2)VAL
This assigns PID property Prop to VAL for PIDs with property CP equal to CV and property CP2 equal to CV2.
#Prop=(CP=CV)VAL,()DEFAULT
This assigns PID property Prop to VAL for PIDs with property CP equal to CV, or to DEFAULT for the other PIDs.
The condition syntax is the same as the source ID fragment syntax.
Note: when set, the default value (empty condition) always matches the PID, so it should be placed last in the list of conditions.
Example ๐ธ
gpac -i source.mp4:#MyProp=(audio)"Super Audio",(video)"Super Video"
This assigns property MyProp to Super Audio for audio PIDs and to Super Video for video PIDs.
Example ๐
gpac -i source.mp4:#MyProp=(audio1)"Super Audio"
This assigns property MyProp to Super Audio for the first audio PID declared.
Example ๐ฆ
gpac -i source.mp4:#MyProp=(Width+1280)HD
This assigns property MyProp to HD for PIDs with property Width greater than 1280.
The property value can use templates with these keywords:
$GINC(init[,inc])or@GINC(...)โ replaced by integer for each new output PID of the filter (see the specific filter options for details on syntax)PROP(enclosed between$or@) โ replaced by the serialized value of propertyPROP(name or 4CC) of the PID, or with an empty string if there's no such property
Example โจ
gpac -i source.ts:#ASID=$PID$
This assigns the DASH AdaptationSet ID to the PID ID value.
Example ๐
gpac -i source.ts:#RepresentationID=$ServiceID$
This assigns the DASH Representation ID to the PID ServiceID value.
A property can also be removed by not specifying any value at all. Conditional removal is possible using the syntax above.
Example ๐
gpac -i source.ts:#FOO=
This removes the FOO property on the output PID. Gone, deleted, no notes.
๐ธ Using option files ๐ธ
okay bestie, plot twist: you can put all your filter options in a file instead of typing them inline. Just hand over the target file name as an option with no value, like :myopts.txt. iconic, right?
โ ๏ธ Warning: Only local files are allowed. no network shenanigans, periodt.
An option file is just a plain little text file holding one or more options or PID properties, spread over one or more lines. the rules:
- A line starting with
//is a comment and gets ignored (and nope, it's not configurable). - A line starting with
:means an escaped option โ the entire line gets parsed as a single option.
And yes, options inside an option file can point at other option files, with a maximum redirection level of 5. we're not doing infinite recursion here ๐
An option file declaration (filter:myopts.txt) follows the exact same inheritance rules as regular options.
Example
gpac -i source.mp4:myopts.txt:foo=bar -o dst
Any filter loaded between source.mp4 and dst will inherit both myopts.txt and foo options, and will resolve options and PID properties given in myopts.txt. slay, inheritance ๐
๐ฆ Ignoring filters at run-time ๐ฆ
There's a special option called ccp and it lets you swap filters out for an identity filter at run-time, based on the input codec ID. lowkey a glow-up for your pipeline.
The option is a list of codec IDs to check. For encoder filters, an empty list reuses the encoder codec type.
When the PID codec ID matches one of the specified codecs, the filter gets replaced with a reframer filter with single PID input and the same name and ID. same energy, new body โจ
Example
-i src c=avc:b=1m:ccp -o mux
This will replace the encoder filter with a reframer if the input PID is in AVC|H264 format, or uses the encoder for other visual PIDs.
Example
-i src c=avc:b=1m:ccp=avc,hevc -o mux
This will replace the encoder filter with a reframer if the input PID is in AVC|H264 or HEVC format, or uses the encoder for other visual PIDs.
Example
-i src cecrypt:cfile=drm.xml:ccp=aac -o mux
This will replace the encryptor filter with a reframer if the input PID is in AAC format, or uses the encryptor for other PIDs. no cap ๐ซถ
๐ Specific filter options ๐
Some special keywords get swapped out when filter options are processed. very main character behaviour.
โ ๏ธ Warning: These keywords do not apply to PID properties. And you can't stack multiple keywords on a single option โ one per option, bestie.
The defined keywords, babes:
$GSHAREโ replaced by system path to GPAC shared directory (e.g./usr/share/gpac)$GJSโ replaced by the first path from global share directory and paths set through-js-dirsthat contains the file name following the macro, e.g.$GJS/source.js$GDOCSโ replaced by system path to:- application document directory for iOS
EXTERNAL_STORAGEenvironment variable if present or/sdcardotherwise for Android- user home directory for other platforms
$GCFGโ replaced by system path to folder containing GPAC config$GLANGโ replaced by the global config language option-lang$GUAโ replaced by the global config user agent option-user-agent$GINC(init_val[,inc])โ replaced by init_val, and increments init_val by inc (a positive or negative number,1if not specified) each time a new filter using this string is created.
The $GINC construct is how you dynamically assign numbers in filter chains:
gpac -i source.ts tssplit @#ServiceID= -o dump_$GINC(10,2).ts
This will dump first service in dump_10.ts, second service in dump_12.ts, etc... obsessed with this actually ๐ญ
As seen previously, the following options may be set on any filter, but they are not visible in individual filter help:
FIDโ filter identifierSIDโ filter source(s) (string value)N=NAMEโ filter name (string value)FSโ sub-session identifier (unsigned int value)RSIDโ require sourceID to be present on target filters (no value)TAGโ filter tag (string value)ITAGโ filter inherited tag (string value)FBTโ buffer time in microseconds (unsigned int value)FBUโ buffer units (unsigned int value)FBDโ decode buffer time in microseconds (unsigned int value)cloneโ explicitly enable/disable filter cloning flag (no value)nomuxโ enable/disable direct file copy (no value)gfregโ preferred filter registry names for link solving (string value)gflocโ following options are local to filter declaration, not inherited (no value)gfoptโ following options are not tracked (no value)gpacโ argument separator for URLs (no value)ccpโ filter replacement control (string list value)NCIDโ ID of netcap configuration to use (string)LTโ set additionnal log tools and levels for the filter usin same syntax as-logs, e.g.:LT=filter@debug(string value)DBGโ debug missing input PID property (=pid), missing input packet property (=pck) or both (=all)
The buffer control options are used to change the default buffering of PIDs of a filter:
FBTcontrols the maximum buffer time of output PIDs of a filterFBUcontrols the maximum number of packets in buffer of output PIDs of a filter when timing is not availableFBDcontrols the maximum buffer time of input PIDs of a decoder filter, ignored for other filters
If another filter sends a buffer requirement messages, the maximum value of FBT (resp. FBD) and the user requested buffer time will be used for output buffer time (resp. decoding buffer time).
The options FBT, FBU, FBD and DBG can be set:
- per filter instance:
fA reframer:FBU=2 - per filter class for the run:
--reframer@FBU=2 - in the GPAC config file in a per-filter section:
[filter@reframer]FBU=2
The default values are defined by the session default parameters -buffer-gen, buffer-units and -buffer-dec.
๐ External filters ๐
GPAC comes with a set of built-in filters in libgpac. But bestie, it can also load external filters in dynamic libraries โ located in the default module folder or folders listed in the -mod-dirs option.
The files shall be named gf_* and shall export a single function RegisterFilter returning a filter register โ see libgpac documentation for more details. that's the whole vibe ๐ซ
๐ GPAC Built-in properties ๐
โจ Built-in property types โจ
sintโ signed 32 bit integeruintโ unsigned 32 bit integerlsintโ signed 64 bit integerluintโ unsigned 32 bit integerboolโ booleanfracโ 32/32 bit fractionlfracโ 64/64 bit fractionfltโ 32 bit float numberdblโ 64 bit float numberv2diโ 2D 32-bit integer vectorv2dโ 2D 64-bit float vectorv3diโ 3D 32-bit integer vectorv4diโ 4D 32-bit integer vectorstrโ UTF-8 stringmemโ data buffercstrโ const UTF-8 stringcmemโ const data bufferptrโ 32 or 64 bit pointerstrlโ UTF-8 string listuintlโ unsigned 32 bit integer listsintlโ signed 32 bit integer listv2ilโ 2D 32-bit integer vector list4ccโ Four character code4cclโ four-character codes listpfmtโ raw pixel formatafmtโ raw audio formatcprmโ color primaries, string or int value from ISO/IEC 23091-2ctfcโ color transfer characteristics, string or int value from ISO/IEC 23091-2cmxcโ color matrix coefficients, string or int value from ISO/IEC 23091-2alayโ channel layout configuration, string or int value from ISO/IEC 23091-3
๐ Built-in properties for PIDs and packets ๐
Built-in properties for PIDs and packets listed as Name (4CC type FLAGS): description.
FLAGS can be D (droppable โ see GSF multiplexer filter help), P (packet property).
ID(PIDI,uint, ) โ Stream IDESID(ESID,uint,D) โ MPEG-4 ESID of PIDItemID(ITID,uint, ) โ ID of image item in HEIF, same value asIDItemNumber(ITIX,uint, ) โ Number (1-based) of image item in HEIF, in order of declaration in fileTrackNumber(PIDX,uint, ) โ Number (1-based) of track in order of declaration in fileServiceID(PSID,uint,D) โ ID of parent serviceClockID(CKID,uint,D) โ ID of clock reference PIDDependencyID(DPID,uint, ) โ ID of layer depended onSubLayer(DPSL,bool, ) โ PID is a sublayer of the stream depended on rather than an enhancement layerPlaybackMode(PBKM,uint,D) โ Playback mode supported:0: no time control1: play/pause/seek,speed=12: play/pause/seek,speed>=03: play/pause/seek, reverse playback
Scalable(SCAL,bool, ) โ Scalable streamTileBase(SABT,bool, ) โ Tile base streamTileID(PTID,uint, ) โ ID of the tile for hvt1/hvt2 PIDsLanguage(LANG,cstr, ) โ Language code: ISO639 2/3 character code or RFC 4646ServiceName(SNAM,str,D) โ Name of parent service, signled as PID infoServiceProvider(SPRO,str,D) โ Provider of parent service, signled as PID infoStreamType(PMST,uint, ) โ Media stream typeStreamSubtype(PSST,4cc,D) โ Media subtype 4CC (auxiliary, pic sequence, etc ..), matches ISOM handler typeISOMSubtype(PIST,4cc,D) โ ISOM media subtype 4CC (avc1 avc2...)OrigStreamType(POST,uint, ) โ Original stream type before encryptionCodecID(POTI,uint, ) โ Codec ID (MPEG-4 OTI or ISOBMFF 4CC)InitialObjectDescriptor(PIOD,bool, ) โ PID is declared in the IOD for MPEG-4Unframed(PFRM,bool, ) โ The media data is not framed, i.e. each packet is not a complete AU/frame or is not in internal format (e.g. annexB for avc/hevc, adts for aac)UnframedAU(PFRF,bool, ) โ The unframed media still has correct AU boundaries: one packet is one full AU, but the packet format might not be the internal one (e.g. annexB for avc/hevc, adts for aac)LATM(LATM,bool, ) โ Media is unframed AAC in LATM formatUSRT(USRT,bool, ) โ Media is unframed SRT, header is in payload with 0 start timeDuration(PDUR,lfrac, ) โ Media durationEstimatedDuration(EDUR,bool, ) โ Media duration is an estimated duration based on rateNumFrames(NFRM,uint,D) โ Number of frames in the streamFrameOffset(FRMO,uint,D) โ Index of first frame in the stream (used for reporting)ConstantFrameSize(CFRS,uint, ) โ Size of the frames for constant frame size streamsTimeshiftDepth(PTSD,frac,D) โ Depth of the timeshift bufferTimeshiftTime(PTST,dbl,D) โ Time in the timeshift buffer in seconds โ changes are signaled through PID info (no reconfigure)TimeshiftState(PTSS,uint,D) โ State of timeshift buffer:0is OK,1is underflow,2is overflow โ changes are signaled through PID info (no reconfigure)Timescale(TIMS, uint) โ the media timescale, periodt โฑ๏ธ a timestamp delta of N is literally N/timescale seconds.ProfileLevel(PRPL, uint,D) โ profile and level indication, the little "who dis" of the stream ๐DecoderConfig(DCFG, mem) โ the decoder configuration data. that's it, that's the bytes ๐ซถDecoderConfigEnhancement(ECFG, mem) โ decoder configuration data of the enhancement layer(s) ๐ also used by 3GPP/Apple text streams to give the full sample description table used in SDP.DSISuperset(DCFS, bool) โ the decoder config is a superset of the previous decoder config โจ we're building up, not sideways.DecoderConfigIndex(ICFG, uint) โ the 1-based index of decoder config for ISO base media files. yes bestie, 1-based, not 0-based ๐ do not come for me.SampleRate(AUSR, uint) โ audio sample rate ๐ตSamplesPerFrame(FRMS, uint) โ number of audio samples in one coded frame.NumChannels(CHNB, uint) โ number of audio channels ๐BPS(ABPS, uint) โ number of bits per sample in the compressed source.ChannelLayout(CHLO, luint) โ channel layout mask.AudioFormat(AFMT, afmt) โ audio sample format.AudioPlaybackSpeed(ASPD, dbl,D) โ audio playback speed, only used for audio output reconfiguration.Delay(MDLY, lsint) โ delay of presentation compared to composition timestamps, in media timescale. A positive value imply holding (delaying) the stream. A negative value imply skipping the beginning of stream.CTSShift(MDTS, uint) โ CTS offset to apply in case of negative ctts.SkipPriming(ASKP, bool) โ audio priming shall not to be removed when initializing decoding. it stays, no takebacks ๐Width(WIDT, uint) โ visual width (video / text / graphics).Height(HEIG, uint) โ visual height (video / text / graphics).PixelFormat(PFMT, pfmt) โ pixel format.PixelFormatWrapped(PFMW, pfmt) โ the underlying pixel format of the video stream if the pixel format is an external GL texture ๐จ it's giving wrapped-gift energy.Stride(VSTY, uint) โ image or Y/alpha plane stride.StrideUV(VSTC, uint) โ UV plane or U/V planes stride.BitDepthLuma(YBPS, uint) โ bit depth for luma components.BitDepthChroma(CBPS, uint) โ bit depth for chroma components.FPS(VFPF, frac) โ video framerate ๐ฅInterlaced(VILC, bool) โ the video is interlaced.SAR(PSAR, frac) โ sample (i.e. pixel) aspect ratio. careful babes: negative values mean no SAR and removal of info in containers โ ๏ธMaxWidth(MWID, uint) โ maximum width (video / text / graphics) of all enhancement layers.MaxHeight(MHEI, uint) โ maximum height (video / text / graphics) of all enhancement layers.ZOrder(VZIX, sint) โ z-order of the video, from 0 (first) to max int (last). stacking order, main character goes last ๐TransX(VTRX, sint) โ horizontal translation of the video (positive towards right).TransY(VTRY, sint) โ vertical translation of the video (positive towards up).TransXRight(VTRx, sint) โ horizontal offset of the video from right (positive towards right), for cases where the reference width is unknown.TransYTop(VTRy, sint) โ vertical translation of the video (0 is top, positive towards down), for cases where the reference height is unknown.Hidden(HIDE, bool) โ this PID is hidden in visual/audio rendering ๐ not invited to the render party.CropOrigin(VCXY, v2di) โ position in source window; X,Y indicate coordinates in source (0,0 for top-left).OriginalSize(VOWH, v2di) โ original resolution of the video.SRD(SRDI, v4di) โ position and size of the video in the referential given bySRDRef.SRDRef(SRDR, v2di) โ width and height of the SRD referential.SRDMap(SRDM, uintl) โ mapping of input videos in the reconstructed video, expressed as{Ox,Oy,Ow,Oh,Dx,Dy,Dw,Dh}per input, with:Ox,Oy,Ow,Oh: position and size of the input video (usually matching its SRD property), expressed in the output referential given bySRDRefDx,Dy,Dw,Dh: position and size of the input video in the reconstructed output, expressed in the output referential given bySRDRef
Alpha(VALP, bool) โ the video in this PID is an alpha map ๐ฆMirror(VMIR, uint) โ mirror mode, as a bit mask with flags 0: no mirror, 1: along Y-axis, 2: along X-axis.Rotate(VROT, uint) โ video rotation as value*90 degree anti-clockwise.ClapW(CLPW, frac) โ width of clean aperture in luma pixels.ClapH(CLPH, frac) โ height of clean aperture in luma pixels.ClapX(CLPX, frac) โ horizontal offset of clean aperture center in luma pixels, 0 at image center.ClapY(CLPY, frac) โ vertical offset of clean aperture center in luma pixels, 0 at image center.NumViews(PNBV, uint) โ number of views packed in a frame (top-to-bottom only).Bitrate(RATE, uint) โ bitrate in bps.Maxrate(MRAT, uint) โ max bitrate in bps.TargetRate(TBRT, uint) โ target bitrate in bps, used to setup encoders ๐ฏDBSize(DBSZ, uint) โ decode buffer size in bytes.MediaDataSize(MDSZ, luint,D) โ size in bytes of media data.DataRef(DREF, bool,D) โ data referencing is possible (each compressed frame is a continuous set of bytes in source, with no transformation).URL(FURL, str,D) โ URL of source.RemoteURL(RURL, str,D) โ remote URL of source โ used for MPEG-4 systems.RedirectURL(RELO, str,D) โ redirection URL of source.SourcePath(FSRC, str,D) โ path of source file on the file system.FileAlias(FALI, str,D) โ alias name for the source file, replace$URL$and$File$in templates โจMIMEType(MIME, str,D) โ MIME type of source.Extension(FEXT, str,D) โ file extension of source.Cached(CACH, bool,D) โ the file is completely cached ๐พ fully downloaded, no buffering anxiety.DownloadRate(DLBW, uint,D) โ download rate of resource in bits per second โ changes are signaled through PID info (no reconfigure).DownloadSize(DLSZ, luint,D) โ size of resource in bytes.DownBytes(DLBD, luint,D) โ number of bytes downloaded โ changes are signaled through PID info (no reconfigure).ByteRange(FBRA, lfrac,D) โ byte range of resource.DisableProgressive(NPRG, uint) โ some blocks in the file need patching (replace or insertion) upon closing, potentially disabling progressive upload ๐IsoAltBrands(ABRD, 4ccl,D) โ ISOBMFF brands associated with PID/file.IsoBrand(MBRD, 4cc,D) โ ISOBMFF major brand associated with PID/file.MovieTime(MHTS, lfrac,D) โ ISOBMFF movie header duration and timescale.HasSync(PSYN, bool,D) โ the PID has sync points.ServiceWidth(DWDT, uint,D) โ display width of service.ServiceHeight(DHGT, uint,D) โ display height of service.IsDefault(PDEF, bool,D) โ default PID for this stream type.CarouselRate(CARA, uint,D) โ repeat rate in ms for systems carousel data.AudioVolume(AVOL, uint,D) โ volume of audio ๐AudioPan(APAN, uint,D) โ balance/Pan of audio.AudioPriority(APRI, uint,D) โ audio thread priority.ProtectionScheme(SCHT, 4cc) โ protection scheme type (4CC) used.SchemeVersion(SCHV, uint) โ protection scheme version used.SchemeURI(SCHU, str) โ protection scheme URI.KMS_URI(KMSU, str) โ URI for key management system ๐SelectiveEncryption(ISSE, bool) โ ISMA/OMA selective encryption is used.IVLength(ISIV, uint) โ ISMA IV size.KILength(ISKI, uint) โ ISMA KeyIndication size.CryptType(OMCT, uint) โ OMA encryption type.ContentID(OMID, str) โ OMA Content ID.TextualHeaders(OMTH, str) โ OMA textual headers.PlaintextLen(OMPT, luint) โ OMA size of plaintext data.CryptInfo(ECRI, str,D) โ URL (local file only) of crypt info file for this PID; useclearto force passthrough.DecryptInfo(EDRI, str,D) โ URL (local file only) of crypt info file for this PID โ see decrypter help.SenderNTP(NTPS, luint,DP) โ NTP 64 bits timestamp at sender side or grabber side.ReceiverNTP(NTPR, luint,DP) โ receiver NTP (64 bits timestamp), usually associated with the sender NTP property.UTC(UTCD, luint,DP) โ UTC timestamp (in milliseconds) of parent packet.Encrypted(EPCK, bool) โ packets for the stream are by default encrypted (however the encryption state is carried in packet crypt flags) โ changes are signaled through PID info change (no reconfigure).OMAPreview(ODPR, luint) โ OMA Preview range.CENC_PSSH(PSSH, mem) โ PSSH blob for CENC, formatted as(u32)NbSystems [ (bin128)SystemID(u32)version(u32)KID_count[ (bin128)keyID ] (u32)priv_size(char*priv_size)priv_data]CENC_SAI(SAIS, mem,P) โ CENC SAI for the packet, formatted as(char(IV_Size))IV(u16)NbSubSamples [(u16)ClearBytes(u32)CryptedBytes]KeyInfo(CBIV, mem) โ multi key info formatted as:
is_mkey(u8);
nb_keys(u16);
[
IV_size(u8);
KID(bin128);
if (!IV_size) {;
const_IV_size(u8);
constIV(const_IV_size);
}
]
CENCPattern(CPTR, frac) โ CENC crypt pattern, CENC pattern, skip as frac.num crypt as frac.den.CENCStore(CSTR, 4cc) โ storage location 4CC of SAI data.CENCstsdMode(CSTM, uint) โ mode for CENC sample description when using clear samples:0: single sample description is used1: a clear clone of the sample description is created, inserted before the CENC sample description2: a clear clone of the sample description is created, inserted after the CENC sample description
AMRModeSet(AMST, uint) โ ModeSet for AMR and AMR-WideBand.SubSampleInfo(SUBS, mem,P) โ binary blob describing N subsamples of the sample, formatted asN [(u32)flags(u32)size(u32)codec_param(u8)priority(u8) discardable]. Subsamples for a given flag MUST appear in order, however flags can be interleaved.NALUMaxSize(NALS, uint) โ max size of NAL units in stream โ changes are signaled through PID info change (no reconfigure).FileNumber(FNUM, uint,P) โ index of file when dumping to files ๐๏ธFileName(FNAM,str,P) โ the name of your output file when you're dumping or dashing. ๐ Bestie, this must be set on the first packet that belongs to the new file, no exceptions.IDXName(INAM,str,P) โ the name of the index file when you're dashing MPEG-2 TS. Same energy as above: must be set on the first packet belonging to the new file. ๐๏ธFileSuffix(FSUF,str,P) โ the file suffix name, aka the glow-up replacement for$FS$inside your tile templates. โจEODS(EODS,bool,P) โ End of DASH segment. That's it, that's the whole vibe. ๐CueStart(PCUS,bool,P) โ set on packets that mark the beginning of a DASH/HLS segment for cue-driven segmentation โ go peek at the dasher help for the deets. ๐ฏMediaTime(MTIM,dbl,DP) โ the corresponding media time of the parent packet, with0being the origin. โฑ๏ธMaxFrameSize(MFRS,uint,D) โ max size of a frame in the stream. Heads up: changes get signaled through PID info change, and there's no reconfigure. ๐AvgFrameSize(AFRS,uint,D) โ average size of a frame in the stream. ISOBMFF only, and it's a static property, so it's not gonna move for you. ๐MaxTSDelta(MTSD,uint,D) โ maximum DTS delta between frames. ISOBMFF only, static property. ๐ฐ๏ธMaxCTSOffset(MCTO,uint,D) โ maximum absolute CTS offset. ISOBMFF only, static property. ๐งญConstantDuration(SCTD,uint,D) โ constant duration of samples, where0means variable duration. ISOBMFF only, static property. ๐TrackTemplate(ITKT,mem,D) โ ISOBMFF serialized track box for this PID, without any sample info (so: emptystbland emptydref). ๐ฆTrexTemplate(ITXT,mem,D) โ ISOBMFF serializedtrexbox for this PID. ๐งฑSTSDTemplate(ISTD,mem,D) โ ISOBMFF serialized sample description entry for this PID. ๐๏ธMovieUserData(IMUD,mem,D) โ ISOBMFF serializedmoovUDTA and othermoov-level boxes (it's a list) for this PID. ๐พHandlerName(IHDL,str,D) โ ISOBMFF track handler name. ๐ท๏ธTrackFlags(ITKF,uint,D) โ ISOBMFF track header flags. ๐ฉTrackMatrix(ITKM,sintl,D) โ ISOBMFF track header matrix. ๐ขAltGroup(IALG,uint,D) โ ISOBMFF alt group ID. ๐ฏForceNCTTS(IFNC,bool,D) โ ISOBMFF force negative CTS offsets. โกDisable(ITKD,bool,D) โ ISOBMFF disable flag. ๐Period(PEID,str,D) โ ID of the DASH period. ๐๏ธPStart(PEST,lfrac,D) โ DASH Period start โ cf dasher help. ๐ฆPDur(PEDU,lfrac,D) โ DASH Period duration โ cf dasher help. โRepresentation(DRID,str,D) โ ID of the DASH representation. ๐ญASID(DAID,uint,D) โ ID of the parent DASH Adaptation Set. ๐งฌSSR(SSRR,sint,D) โ ID of the Adaptation Set, and it's giving options, so listen up:- same value as
ASID: regular SSR, not used for cross-AS switching - ID of another
AdaptationSet: enables cross-AS switching between this AS and the referenced one - negative value: LL-HLS compatability mode
- same value as
ASQuery(ASQR,str,D) โ query string to add to this Adaptation Set when requesting segments. โMuxSrc(MSRC,str,D) โ name of the mux source(s), set by the dasher to direct its outputs. ๐๏ธDashMode(DMOD,uint,D) โ the DASH mode the multiplexer should use, if any, set by the dasher.0is no DASH,1is regular DASH,2is VoD. ๐น๏ธInitBase64(IB64,bool,D) โ tells the multiplexer it should send the base64 encoded version of the init segment. ๐SegSync(DFSS,bool,D) โ indicates the segment must be completely flushed before sending segment/fragment size events. ๐ฐDashDur(DDUR,frac,D) โ DASH target segment duration, in seconds. โฒ๏ธFragDur(FDUR,frac,D) โ DASH target fragment duration, in seconds. โฒ๏ธDashMultiPid(DMSD,ptr,D) โ pointer to theGF_Listof input PIDs for multi-stsdentries segments, set by the dasher. ๐งตDashMultiPidIdx(DMSI,uint,D) โ 1-based index of the PID in the multi PID list, set by the dasher. ๐ขDashMultiTrack(DMTK,ptr,D) โ pointer to theGF_Listof input PIDs for multi-tracks segments, set by the dasher. ๐งถRole(ROLE,strl,D) โ list of roles for this PID, where each role string can be a DASH role, aURN:role-valueor any other string. Heads up: that last one will throw a warning and use a custom URI for the role. ๐ชPDesc(PDES,strl,D) โ list of descriptors for the DASH period containing this PID. ๐ASDesc(ACDS,strl,D) โ list of conditional descriptors for the DASH AdaptationSet containing this PID. The tea: if a PID with the same property type but a different value shows up, those PIDs land in different AdaptationSets. ๐ซASCDesc(AADS,strl,D) โ list of common descriptors for the DASH AdaptationSet containing this PID. ๐คRDesc(RDES,strl,D) โ list of descriptors for the DASH Representation containing this PID. ๐BUrl(BURL,strl,D) โ list of base URLs for this PID. ๐Template(DTPL,str,) โ template to use for DASH generation for this PID. ๐งฉStartNumber(DRSN,uint,) โ start number to use for this PID โ cf dasher help. ๐ขxlink(XLNK,str,D) โ remote period URL for DASH โ cf dasher help. ๐ClampDur(DCMD,lfrac,D) โ max media duration to process from the PID in DASH mode. โ๏ธHLSPL(HLVP,str,D) โ name of the HLS variant playlist for this media. ๐บHLSGroup(HLGI,str,D) โ name of the HLS Group of a stream. ๐ฅHLSRend(HLGR,strl,D) โ list of HLS groups allowed in group rendition. When it's not set, all groups are allowed. ๐๏ธHLSForce(HLFI,str,D) โ forces writingEXT-X-STREAM-INFif the stream is in a rendition group. The value is the name of the associated groups (and yes, it can be empty). ๐ชHLSMExt(HLMX,strl,D) โ list of extensions to add to the master playlist for this PID. ๐HLSVExt(HLVX,strl,D) โ list of extensions to add to the variant playlist for this PID. ๐DCue(DCUE,str,D) โ name of a cue list file for this PID โ see dasher help. ๐ตDSegs(DCNS,uint,D) โ number of DASH segments defined by the DASH cue info. ๐ขCodec(CODS,str,D) โ the codec parameter string to force. If it starts with., it gets appended to the ISOBMFF code point; otherwise it replaces the codec string. ๐คSingleScale(DSTS,bool,D) โ the movie header should use the media timescale of the first track added. ๐งฎRequireReorder(PUDP,bool,D) โ PID packets come from a source with losses and reordering happening (UDP, we're looking at you). ๐กPrimary(PITM,bool,D) โ primary item in ISOBMFF. ๐DFMode(DFWD,uint,D) โ DASH forward mode is used for this PID. If it's2, the manifest is also carried in the packet property. ๐DFManifest(DMPD,str,DP) โ value of the manifest in forward mode. ๐DFVariant(DHLV,strl,DP) โ value of the variant playlist in forward mode. ๐DFVariantName(DHLN,strl,DP) โ value of the variant playlist name in forward mode. ๐ท๏ธDFPStart(DPST,luint,D) โ value of the active period start time in ms, in forward mode. โณDFPckPStart(PDPS,bool,DP) โ indicates a new period start. Quick note: it's only set on the first packets of non-first periods. ๐HLSKey(HLSK,str,) โ URI,KEYFORMATandKEYFORMATVERSIONSfor HLS full segment encryption creation, otherwise the Key URI (decoding and sample-AES). ๐HLSIV(HLSI,mem,) โ init Vector for HLS decode. ๐งฟCKUrl(CCKU,str,) โ URL for the ClearKey licence server. ๐ColorPrimaries(CPRM,cprm,D) โ color primaries. ๐ColorTransfer(CTRC,ctfc,D) โ color transfer characteristics. ๐จColorTransferAlternative(CATC,ctfc,D) โ alternative color transfer characteristics. ๐๏ธColorMatrix(CMXC,cmxc,D) โ color matrix coefficient. ๐ฒFullRange(CFRA,bool,D) โ color full range flag. ๐๏ธChroma(CFMT,uint,D) โ chroma format (see ISO/IEC 23001-8 / 23091-2). ๐งชChromaLoc(CLOC,uint,D) โ chroma location (see ISO/IEC 23001-8 / 23091-2). ๐ContentLightLevel(CLLI,mem,D) โ content light level, i.e. the payload of thecllibox (see ISO/IEC 14496-12). Can be set as a list of 2 integers in fragment declaration (e.g."=max_cll,max_pic_avg_ll"). ๐กMasterDisplayColour(MDCV,mem,D) โ master display colour info, i.e. the payload of themdcvbox (see ISO/IEC 14496-12). Can be set as a list of 10 integers in fragment declaration (e.g."=dpx0,dpy0,dpx1,dpy1,dpx2,dpy2,wpx,wpy,max,min"). ๐ฅ๏ธICC(ICCP,mem,D) โ ICC profile (see ISO 15076-1 or ICC.1). ๐ฏSrcMagic(PSMG,luint,D) โ magic number to store in the track, only used by importers. ๐ชMuxIndex(TIDX,uint,D) โ target track index in the destination file, stored by lowest value first (not set by demultiplexers). ๐ขNoTSLoop(NTSL,bool,) โ timestamps on this PID get adjusted in case of loops (used by TS multiplexer output). ๐MHAProfiles(MHCP,uintl,D) โ list of compatible profiles for this MPEG-H Audio object. ๐งFragStart(PFRB,uint,DP) โ the packet is a fragment start (value1) or a segment start (value2). ๐FragRange(PFRR,lfrac,DP) โ start and end position in bytes of the fragment, if the packet is a fragment or segment start. ๐FragTFDT(PFRT,luint,DP) โ decode time of the first packet in the fragment. โฑ๏ธSIDXRange(PFSR,lfrac,DP) โ start and end position in bytes ofsidxin the segment, if any. ๐ฆVODSIDXRange(PRSR,lfrac,D) โ start and end position in bytes of the rootsidx. ๐ณMoofTemplate(MFTP,mem,DP) โ serializedmoofbox corresponding to the start of a movie fragment or segment (withstypand optionallysidx). ๐งฑInitSeg(PCKI,bool,P) โ set totrueif the packet is a complete DASH init segment file. ๐ชRawGrab(PGRB,uint,D) โ the PID is a raw media grabber (webcam, microphone, etc...). Value2is used for front camera. ๐ธKeepAfterEOS(PKAE,bool,D) โ the PID must be kept alive after EOS (LASeR and BIFS). ๐งCoverArt(PCOV,mem,D) โ PID cover art image data. If the associated data isNULL, the data is carried in the PID. ๐ผ๏ธBufferLength(PBPL,uint,D) โ playout buffer in ms. โณMaxBuffer(PBMX,uint,D) โ maximum buffer occupancy in ms. ๐ReBuffer(PBRE,uint,D) โ rebuffer threshold in ms,0disables rebuffering. ๐ViewIdx(VIDX,uint,D) โ view index for multiview (1being left). ๐FragURL(OFRA,str,D) โ fragment URL (without#) of the original URL (used by some filters to set the property on media PIDs). ๐MCASTIP(MSIP,str,D) โ session Multicast IP address for ROUTE/MABR. ๐ถMCASTPort(MSPN,uint,D) โ session port number for ROUTE/MABR. ๐ชMCASTName(MSFN,str,D) โ name (location) of the raw file to advertise in the ROUTE/MABR session. ๐ขMCASTCarousel(MSCR,frac,D) โ carousel period in seconds of the raw file, or of low-latency manifest/init segments, for ROUTE/MABR sessions. ๐MCASTUpload(MSST,frac,D) โ upload time in seconds of raw files for ROUTE/MABR sessions. โฌ๏ธStereo(PSTT, uint,D) โ the stereo type of the video ๐Projection(PPJT, uint,D) โ the projection type of the video, it's giving immersive ๐InitialPose(PPOS, v3di,D) โ initial pose for 360 video, in degrees expressed as 16.16 bits (x is yaw, y is pitch, z is roll) โ so you know exactly where the camera's looking at frame zero ๐ฅCMPad(PCMP, uint,D) โ number of pixels to pad from the edge of each face in a cube map โจEQRClamp(PEQC, v4di,D) โ clamping of the frame for EQR as 0.32 fixed point (x is top, y is bottom, z is left and w is right)SceneNode(PSND, bool, ) โ PID is a scene node decoder (AFX BitWrapper in BIFS)OrigCryptoScheme(POCS, 4cc, ) โ original crypto scheme on a decrypted PID ๐TSBSegs(PTSN, uint,D) โ time shift in number of segments for HAS streams, only set bydashinanddasherfiltersIsManifest(PHSM, uint,D) โ PID is a HAS manifest (bit 9 set to 1 if live), and the lower 8 bits value can be:- 0: not a manifest
- 1: DASH manifest
- 2: HLS manifest
- 3: GHI(X) manifest
Sparse(PSPA, bool,D) โ PID has potentially empty times between packets ๐ณ๏ธCharSet(PCHS, str,D) โ character set for an input text PIDForcedSub(PFCS, uint,D) โ PID forced sub, and the values are:- 0: not forced
- 1: some frames are forced
- 2: all frames are forced
ChapTimes(CHPT, uintl,D) โ chapter start times ๐ChapNames(CHPN, strl,D) โ chapter namesIsChap(PCHP, bool,D) โ subtitle PID is a chapter (for QT-like chapters)SkipBegin(PCKS, uint,P) โ amount of media to skip from the beginning of the packet, in PID timescale (when set on PID, it indicates packets with skip will be present)SkipPres(PCKD, bool,P) โ this packet and any following with a CTS greater than this packet shall not be presented (used by the reframer to create edit lists)OriginalDuration(PCOD, frac,P) โ elapsed time (.num) and original duration (.den, 0 if last copy of packet) for redundant packetsHasSkipBegin(PSBP, bool, ) โ indicates if the PID will carry packets withSkipBeginpropertiesHLSRef(PHLR, luint,D) โ HLS playlist reference, gives a unique ID identifying the media mux, and it's indicated in packets carrying child playlistsPckHLSRef(HPLR, luint,DP) โ same asHLSRefbut carried on packets for ROUTE/MABR file transferLLHAS(HLHS, uint,D) โ DASH/HLS low latency mode โกLLHASFragNum(HLSN, uint,DP) โ DASH-SSR/LLHLS fragment numberDownloadSession(GHTT, ptr,D) โ pointer to the download sessionHasTemi(PTEM, bool,D) โ TEMI present flagXPSMask(PXPM, uint,DP) โ parameter set maskRangeEnd(PCER, bool,P) โ signals the packet is the last one in the desired play range ๐RefID(PKID, sint,P) โ packet identifier for dependency (usually POC for video)Refs(PRFS, sintl,P) โ list of packet identifiers this packet depends onUDTA(PUDT, ptr,DP) โ user data for the packetTimecode(TCOD, mem,P) โ first timecode extracted from SEI (if present) โฑ๏ธDOVI(DOVI, mem, ) โ DolbyVision configurationOutPath(FDST, str, ) โ output file name of the PID, used by some filters creating additional raw PIDsACrypMeta(AMET, mem, ) โ meta-data for Adobe encryptionHasCRoll(CROL, bool, ) โ indicates if key roll is used in CENCSTSDAllTemplates(ISTA, mem,D) โ ISOBMFF serialized sample description box for this PIDSTSDTemplateIdx(ISTI, uint,D) โ index of the correspondingSTSDAllTemplatesPremuxType(PPST, uint, ) โ main streamtype of the PID before mux, only used for ROUTE/MABR setupCodecMerge(PCMB, uint,D) โ indicates the PID can be merged with other streams having the same value for single decoding (HEVC only for now)RelativePath(FNRL, bool,DP) โ indicates the packet file name uses a relative pathClearKeyID(CCKI, mem,D) โ key ID for the ClearKey scheme ๐DashSparse(DSSG, bool,D) โ indicates DASH segments are generated in sparse mode (from context)DashDepGroup(DGDI, uint,D) โ indicates the DASH dependency group IDSC35Ref(SC35, uint,D) โ PID has SCTE35 information carried on the indicated PID numberNoInit(PNIN, bool,D) โ PID does not use any init segment in DASH (file forward mode of dasher, only used for ROUTE/MABR)ForceUnframe(PFUF, bool,D) โ force creation of a rewriter filter (only used for forcing reparse of NALU-based codecs)MetaCodecID(MDCI, uint,D) โ identifier for meta codecs (FFmpeg, ...)MetaCodecName(MDCN, str,D) โ name used for meta codecs (FFmpeg, ...)MetaCodecOpaque(MDOP, uint,D) โ internal property used for meta demuxers (FFmpeg, ...) codec opaque dataHASSegStart(FMSS, lfrac,DP) โ start time of the segment for ROUTE/MABR schedulingSplitStart(PSPS, uint,DP) โ split start time of the packet in PID timescale, for index-based dashingSplitEnd(PSPE, uint,DP) โ split end time of the packet in PID timescale, for index-based dashingInitName(PINM, str,D) โ name of the init segment when dashing, used for ROUTE/MABRSegURL(SURL, str,DP) โ URL of the source segment (when forwarding fragment boundaries)DynPSSH(PSHP, mem,P) โ PSSH blob for CENC, same format asCENC_PSSH, used when using master key and roll keys, signaled on the first packet of the segment where the PSSH changesLLHASTemplate(PSRT, str,P) โ template for DASH-SSR and LLHLS sub-segmentsPartialRepair(PCPR, bool,P) โ indicates the mux data in the associated data is parsable but contains errors (only set on corrupted packets) ๐ญSEILoaded(PSEI, bool,D) โ indicates that the PID is extracting SEI/inband data from packetsFake(PFAK, bool,D) โ indicates a stream present in the source but not delivered as a PIDContentLightLevel(CLLP, mem,DP) โ content light level, the payload of thecllibox (see ISO/IEC 14496-12), and it can be set as a list of 2 integers in the fragment declaration (e.g."=max_cll,max_pic_avg_ll")MasterDisplayColour(MDCP, mem,DP) โ master display colour info, the payload of themdcvbox (see ISO/IEC 14496-12), and it can be set as a list of 10 integers in the fragment declaration (e.g."=dpx0,dpy0,dpx1,dpy1,dpx2,dpy2,wpx,wpy,max,min")SEILoaded(SEIP, bool,DP) โ indicates that the packet has SEI/inband data in its properties (yes bestie, this one's a different property than thePSEIone above, don't @ me ๐)OriginalPTS(OPTS, luint,DP) โ indicates the original PTS or PCR when remapping M2TS PCROriginalDTS(ODTS, luint,DP) โ indicates the original DTS when remapping M2TS PCRMABRBaseURLs(MABU, strl,D) โ optional URLs for MABR โ if the first one is none, the source server is not declared as a repair serverForced(PCFS, bool,DP) โ indicates the packet is a forced subtitle
๐จโจ Pixel formats โจ๐จ
okay so this is the full roster of pixel formats GPAC knows about, each with its file extension vibe ๐ every single one, no skipping:
yuv420(ext*.yuv) โ Planar YUV 420 8 bityvu420(ext*.yvu) โ Planar YVU 420 8 bityuv420_10(ext*.yuvl) โ Planar YUV 420 10 bityuv422(ext*.yuv2) โ Planar YUV 422 8 bityuv422_10(ext*.yp2l) โ Planar YUV 422 10 bityuv444(ext*.yuv4) โ Planar YUV 444 8 bityuv444_10(ext*.yp4l) โ Planar YUV 444 10 bituyvy(ext*.uyvy) โ Packed UYVY 422 8 bitvyuy(ext*.vyuy) โ Packed VYUV 422 8 bityuyv(ext*.yuyv) โ Packed YUYV 422 8 bityvyu(ext*.yvyu) โ Packed YVYU 422 8 bituyvl(ext*.uyvl) โ Packed UYVY 422 10->16 bitvyul(ext*.vyul) โ Packed VYUV 422 10->16 bityuyl(ext*.yuyl) โ Packed YUYV 422 10->16 bityvyl(ext*.yvyl) โ Packed YVYU 422 10->16 bitnv12(ext*.nv12) โ Semi-planar YUV 420 8 bit, Y plane and UV packed planenv21(ext*.nv21) โ Semi-planar YVU 420 8 bit, Y plane and VU packed planenv1l(ext*.nv1l) โ Semi-planar YUV 420 10 bit, Y plane and UV planenv2l(ext*.nv2l) โ Semi-planar YVU 420 8 bit, Y plane and VU planeyuva(ext*.yuva) โ Planar YUV+alpha 420 8 bityuvd(ext*.yuvd) โ Planar YUV+depth 420 8 bityuv444a(ext*.yp4a) โ Planar YUV+alpha 444 8 bityuv444p(ext*.yv4p) โ Packed YUV 444 8 bitv308(ext*.v308) โ Packed VYU 444 8 bityuv444ap(ext*.y4ap) โ Packed YUV+alpha 444 8 bitv408(ext*.v408) โ Packed UYV+alpha 444 8 bitv410(ext*.v410) โ Packed UYV 444 10 bit LEv210(ext*.v210) โ Packed UYVY 422 10 bit LEgrey(ext*.grey) โ Greyscale 8 bitalgr(ext*.algr) โ Alpha+Grey 8 bitgral(ext*.gral) โ Grey+Alpha 8 bitrgb8(ext*.rgb8) โ RGB 332, 8 bits / pixelrgb4(ext*.rgb4) โ RGB 444, 12 bits (16 stored) / pixelrgb5(ext*.rgb5) โ RGB 555, 15 bits (16 stored) / pixelrgb6(ext*.rgb6) โ RGB 555, 16 bits / pixelrgba(ext*.rgba) โ RGBA 32 bits (8 bits / component)argb(ext*.argb) โ ARGB 32 bits (8 bits / component)bgra(ext*.bgra) โ BGRA 32 bits (8 bits / component)abgr(ext*.abgr) โ ABGR 32 bits (8 bits / component)rgb(ext*.rgb) โ RGB 24 bits (8 bits / component)bgr(ext*.bgr) โ BGR 24 bits (8 bits / component)xrgb(ext*.xrgb) โ xRGB 32 bits (8 bits / component)rgbx(ext*.rgbx) โ RGBx 32 bits (8 bits / component)xbgr(ext*.xbgr) โ xBGR 32 bits (8 bits / component)bgrx(ext*.bgrx) โ BGRx 32 bits (8 bits / component)rgbd(ext*.rgbd) โ RGB+depth 32 bits (8 bits / component)rgbds(ext*.rgbds) โ RGB+depth+bit shape (8 bits / RGB component, 7 bit depth (low bits) + 1 bit shape)extgl(ext*.extgl) โ External OpenGL texture of unknown format, to be used withsamplerExternalOESuncv(ext*.uncv) โ Generic uncompressed format ISO/IEC 23001-17
and that's the whole pixel-format lineup, no cap ๐ every single one got its moment ๐
๐ง Audio formats ๐ง
okay so these are the raw PCM sample formats GPAC knows about, and every single one comes with its own file extension vibe. lowkey satisfying list ngl ๐
u8(ext*.pc8) โ 8 bit PCMs16(ext*.pcm) โ 16 bit PCM Little Endians16b(ext*.pcmb) โ 16 bit PCM Big Endians24(ext*.s24) โ 24 bit PCMs24b(ext*.s24b) โ 24 bit Big-Endian PCMs32(ext*.s32) โ 32 bit PCM Little Endians32b(ext*.s32b) โ 32 bit PCM Big Endianflt(ext*.flt) โ 32-bit floating point PCMfltb(ext*.fltb) โ 32-bit floating point PCM Big Endiandbl(ext*.dbl) โ 64-bit floating point PCMdblb(ext*.dblb) โ 64-bit floating point PCM Big Endianu8p(ext*.pc8p) โ 8 bit PCM planars16p(ext*.pcmp) โ 16 bit PCM Little Endian planars24p(ext*.s24p) โ 24 bit PCM planars32p(ext*.s32p) โ 32 bit PCM Little Endian planarfltp(ext*.fltp) โ 32-bit floating point PCM planardblp(ext*.dblp) โ 64-bit floating point PCM planar
๐ฌ Stream types ๐ฌ
the roster of what a stream can actually be. main character energy for each one, no notes โจ
Visualโ Video or Image streamAudioโ Audio streamSceneDescriptionโ Scene streamTextโ Text or subtitle streamMetadataโ Metadata streamFileโ Raw file streamEncryptedโ Encrypted media streamObjectDescriptorโ MPEG-4 ObjectDescriptor streamClockReferenceโ MPEG-4 Clock Reference streamMPEG7โ MPEG-7 description streamIPMPโ MPEG-4 IPMP/DRM streamOCIโ MPEG-4 ObjectContentInformation streamMPEGJโ MPEG-4 JAVA streamInteractionโ MPEG-4 Interaction Sensor streamFontโ MPEG-4 Font stream
๐งฌ Codecs ๐งฌ
this is the big one bestie. every codec name GPAC will answer to, plus what it actually is. some of these have multiple aliases separated by |, and yes you can use any of them. and yes, a couple of them show up twice in this list โ that's not me being sloppy, that's literally what's in the page, so I'm keeping it ๐
bifsโ MPEG-4 BIFS v1 Scene Descriptionbifs2โ MPEG-4 BIFS v2 Scene DescriptionbifsXโ MPEG-4 BIFS Extended Scene Descriptionodโ MPEG-4 ObjectDescriptor v1od2โ MPEG-4 ObjectDescriptor v2interactโ MPEG-4 Interaction Streamafxโ MPEG-4 AFX Streamfontโ MPEG-4 Font Streamsyntexโ MPEG-4 Synthetized Texturem4txtโ MPEG-4 Streaming Textlaserโ MPEG-4 LASeRsafโ MPEG-4 Simple Aggregation Formatcmp|m4ve|m4vโ MPEG-4 Visual part 2264|avc|h264โ MPEG-4 AVC|H264 Videoavcpsโ MPEG-4 AVC|H264 Video Parameter Setssvc|avc|264|h264โ MPEG-4 AVC|H264 Scalable Video Codingmvcโ MPEG-4 AVC|H264 Multiview Video Codinghvc|hevc|h265โ HEVC Videolhvc|shvc|mhvcโ HEVC Video Layered Extensionsm2vsโ MPEG-2 Visual Simplem2vโ MPEG-2 Visual Mainm2v|m2vsnrโ MPEG-2 Visual SNRm2v|m2vspatโ MPEG-2 Visual Spatialm2v|m2vhโ MPEG-2 Visual Highm2v|m2v4โ MPEG-2 Visual 422m1vโ MPEG-1 Videojpg|jpegโ JPEG Imagepngโ PNG Imagejp2|j2kโ JPEG2000 Imageaacโ MPEG-4 AAC Audioaac|aac2mโ MPEG-2 AAC Audio Mainaac|aac2lโ MPEG-2 AAC Audio Low Complexityaac|aac2sโ MPEG-2 AAC Audio Scalable Sampling Ratemp3|m1aโ MPEG-1 Audiomp2โ MPEG-2 Audiomp1โ MPEG-1 Audio Layer 1h263โ H263 Videoh263โ H263 Videohvt1โ HEVC tiles Videoevc|evrcโ EVRC Voicesmvโ SMV Voiceqcp|qcelpโ QCELP Voiceamrโ AMR Audioamr|amrwbโ AMR WideBand Audioqcp|evrcpvโ EVRC (PacketVideo MUX) Audiovc1โ SMPTE VC-1 Videodiracโ Dirac Videoac3โ AC3 Audioeac3โ Enhanced AC3 Audioac4โ AC4 Audiomlpโ Dolby TrueHDdraโ DRA Audiog719โ G719 Audiodtscโ DTS Coherent Acoustics and Digital Surround Audiodtshโ DTS-HD High Resolution Audio and DTS-Master Audiodtslโ DTS-HD Substream containing only XLLAudiodtseโ DTS Express low bit rate Audiodtsxโ DTS-X UHD Audio Profile 2dtsyโ DTS-X UHD Audio Profile 3opusโ Opus Audioetiโ DVB Event Informationsvgrโ SVG over RTPsvgzrโ SVG+gz over RTPdimsโ 3GPP DIMS Scenevttโ WebVTT Texttxtโ Simple Text Streammtxtโ Metadata Text Streammxmlโ Metadata XML Streamsubsโ Subtitle text Streamsubxโ Subtitle XML Streamtx3gโ Subtitle/text 3GPP/Apple Streamssaโ SSA /ASS Subtitlestheo|theoraโ Theora Videovorb|vorbisโ Vorbis Audioopusโ Opus Audioiamfโ AOM IAMF (Immersive Audio Model and Formats)flacโ Flac Audiospx|speexโ Speex Audiovobsubโ VobSub Subtitlevobsubโ VobSub Subtitleadpcmโ AD-PCMcsvdโ IBM CSVDalawโ ALAWmulawโ MULAWokiadpcmโ OKI ADPCMdviadpcmโ DVI ADPCMdigistdโ DIGISTDyamadpcmโ YAMAHA ADPCMtruespeechโ DSP TrueSpeechg610โ GSM 610imulawโ IBM MULAWialawโ IBM ALAWiadpclโ IBM ADPCLswfโ Adobe Flashrawโ Raw mediauncvโ Raw Videoav1|ivf|obu|av1bโ AOM AV1 Videovp8|ivfโ VP8 Videovp9|ivfโ VP9 Videovp10|ivfโ VP10 Videoavsv|avs3โ AVS3 Videoavsa|avs3โ AVS3 Audiomhasโ MPEG-H Audiomhasโ MPEG-H AudioMuxprores|apchโ ProRes Video 422 HQprores|apcoโ ProRes Video 422 Proxyprores|apcnโ ProRes Video 422 STDprores|apcsโ ProRes Video 422 LTprores|ap4xโ ProRes Video 4444 XQprores|ap4hโ ProRes Video 4444ffmpegโ FFmpeg unmapped codectmcdโ QT TimeCodesc35โ SCTE35evteโ Event Messagesvvc|266|h266โ VVC Videovvs1โ VVC Subpicture Videousac|xheaacโ xHEAAC / USAC Audioffv1โ FFmpeg Video Codec 1dvbsโ DVB Subtitlesdvbsโ DVB-TeleTextdiv3โ MS-MPEG4 V3cafโ Apple Lossless Audiodnxโ AViD DNxHD
๐ Stream types ๐
no bestie you're not losing it โ this section is also called Stream types, that's just how the page is. but this one is the audio channel layout table: a name, an int, and the hex layout value. obsessed with how chaotic that is fr fr ๐ซถ
mono(int1) โ Layout0x0000000000000004stereo(int2) โ Layout0x00000000000000033/0.0(int3) โ Layout0x00000000000000073/1.0(int4) โ Layout0x00000000000004073/2.0(int5) โ Layout0x00000000000000373/2.1(int6) โ Layout0x000000000000003f5/2.1(int7) โ Layout0x000000000000003f1+1(int8) โ Layout0x00000000000000032/1.0(int9) โ Layout0x00000000000004032/2.0(int10) โ Layout0x00000000000000333/3.1(int11) โ Layout0x000000000000043f3/4.1(int12) โ Layout0x000000000000033f11/11.2(int13) โ Layout0x000000003ffe67cf5/2.1(int14) โ Layout0x000000000006003f5/5.2(int15) โ Layout0x000000000606603f5/4.1(int16) โ Layout0x000000000036003f6/5.1(int17) โ Layout0x00000000023e003f6/7.1(int18) โ Layout0x00000600023e003f5/6.1(int19) โ Layout0x000000000036630f7/6.1(int20) โ Layout0x000000600036630f
๐ซ EXAMPLES ๐ซ
want to see this stuff actually in action? basic and advanced examples live right here:
https://wiki.gpac.io/Filters/Filters
๐ซถ MORE ๐ซถ
- Authors: GPAC developers, see git repo history (
-log) - For bug reports, feature requests, more information and source code, visit
https://github.com/gpac/gpac - build:
26.02 - Copyright: (c) 2000-2024 Telecom Paris distributed under LGPL v2.1+ -
https://gpac.io
๐ SEE ALSO ๐
okay that's the whole page bestie, you made it to the end and honestly? iconic behavior ๐ this was gpac(1), dated 2019, manual page for the gpac tool itself. go forth and mux something gorgeous. slay ๐๐ฆ๐
๐ฆ where this page comes from
- fedora 44: gpac 26.02.0-1.fc44 ยท LGPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms