Skip to content

fout

File output

Register name used to load filter: fout
This filter may be automatically loaded during graph resolution.

This filter is used to write data to disk, and does not produce any output PID.
In regular mode, the filter only accept PID of type file. It will dump to file incoming packets (stream type file), starting a new file for each packet having a frame_start flag set, unless operating in cat mode.
If the output file name is std or stdout, writes to stdout.
The output file name can use gpac templating mechanism, see gpac -h doc.The filter watches the property FileNumber on incoming packets to create new files.

Discard sink mode

When the destination is null, the filter is a sink dropping all input packets.
In this case it accepts ANY type of input PID, not just file ones.

HTTP streaming recording

When recording a DASH or HLS session, the number of segments to keep per quality can be set using max_cache_segs.
- value 0 keeps everything (default behaviour)
- a negative value N will keep -N files regardless of the time-shift buffer value
- a positive value N will keep MAX(N, time-shift buffer) files

Example

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

Options

dst (cstr): location of destination file
append (bool, default: false): open in append mode
dynext (bool, default: false): indicate the file extension is set by filter chain, not dst
start (dbl, default: 0.0): set playback start offset. A negative value means percent of media duration with -1 equal to duration
speed (dbl, default: 1.0): set playback speed when vsync is on. If negative and start is 0, start is set to -1
ext (cstr): set extension for graph resolution, regardless of file extension
mime (cstr): set mime type for graph resolution
cat (enum, default: none): cat each file of input PID rather than creating one file per filename
none: never cat files
auto: only cat if files have same names
* all: always cat regardless of file names

ow (enum, default: yes): overwrite output mode when concatenation is not used
yes: override file if existing
no: throw error if file existing
* ask: interactive prompt

mvbk (uint, default: 8192): block size used when moving parts of the file around in patch mode
redund (bool, default: false): keep redundant packet in output file
max_cache_segs (sint, default: 0): maximum number of segments cached per HAS quality when recording live sessions (0 means no limit)
force_null (bool, default: false): force no output regardless of file name