Skip to content
Romain Bouqueau edited this page Mar 5, 2024 · 7 revisions

Warning

GPAC's wiki has moved to wiki.gpac.io.

This github wiki will no longer be updated.

You can contribute to GPAC's documentation here.

GHI demultiplexer

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

This filter handles pre-indexed content for just-in-time processing of HAS manifest, init segment and segments

Warning: This is work in progress, the format of indexes (binary or XML) may change until finalization of this filter.

Generating indexes

Indexes are constructed using the dasher filter and a given segment duration.
Example

gpac -i SRC [... -i SRCn] -o index.ghi:segdur=2

This constructs a binary index for the DASH session.
Example

gpac -i SRC -o index.ghix:segdur=2

This constructs an XML index for the DASH session.

Warning: XML indexes should only be used for debug purposes as they can take a significant amount of time to be parsed.

When indexing, the default template used is $Representation$_$Number$. The template is stored in the index and shouldn't be re-specified when generating content.

Using indexes

The index can be used to generate manifest, child variants for HLS, init segments and segments.
Example

gpac -i index.ghi:gm=all -o dash/vod.mpd

This generates manifest(s) and init segment(s).

Example

gpac -i index.ghi:rep=FOO:sn=10 -o dash/vod.mpd

This generates the 10th segment of representation with ID FOO.

Note: The manifest file(s) and init segment(s) are not written when generating a segment. The manifest target (mpd or m3u8) is only used to setup the filter chain and target output path.

Example

gpac -i index.ghi:gm=main -o dash/vod.m3u8

This generates main manifest only (MPD or master HLS playlist).

Example

gpac -i index.ghi:gm=child:rep=FOO:out=BAR -o dash/vod.m3u8

This generates child manifest for representation FOO in file BAR.

Example

gpac -i index.ghi:gm=init:rep=FOO:out=BAR2 -o dash/vod.m3u8

This generates init segment for representation FOO in file BAR2.

The filter outputs are PIDs using framed packets marked with segment boundaries and can be chained to other filters before entering the dasher (e.g. for encryption, transcode...).

If representation IDs are not assigned during index creation, they default to the 1-based index of the source. You can check them using:
EX: gpac -i src.ghi inspect:full

Muxed Representations

The filter can be used to generate muxed representations, either at manifest generation time or when generating a segment.
Example

gpac -i index.ghi:mux=A@V1@V2 -o dash/vod.mpd

This will generate a manifest muxing representations A with representations V1 and V2.

Example

gpac -i index.ghi:mux=A@V1@V2,T@V1@V2 -o dash/vod.mpd

This will generate a manifest muxing representations A and T with representations V1 and V2.

Example

gpac -i index.ghi:rep=V2:sn=5:mux=A@V2 -o dash/vod.mpd

This will generate the 5th segment containing representations A and V2.

The filter does not store any state, it is the user responsibility to use consistent information across calls:

  • do not change segment templates
  • do not change muxed representations to configurations not advertised in the generated manifests

Recommendations

Indexing supports fragmented and non-fragmented MP4, MPEG-2 TS and seekable inputs.

  • It is recommended to use fragmented MP4 as input format since this greatly reduces file loading times.
  • If non-fragmented MP4 are used, it is recommended to use single-track files to decrease the movie box size and speedup parsing.
  • MPEG-2 TS sources will be slower since they require PES reframing and AU reformating, resulting in more IOs than with mp4.
  • other seekable sources will likely be slower (seeking, reframing) and are not recommended.

Options

gm (enum, default: main): manifest generation mode

  • none: no manifest generation (implied if sn is not 0)
  • all: generate all manifests and init segments
  • main: generate main manifest (MPD or master M3U8)
  • child: generate child playlist for HLS
  • init: generate init segment

force (bool, default: false): force loading sources in manifest generation for debug
rep (str): representation to generate
sn (uint): segment number to generate, 0 means init segment
mux (strl): representation to mux - cf filter help
out (str): output filename to generate

HOME » Filters

Filters Overview

General Filters Concepts
gpac General Usage
Built-in Properties

GPAC Configuration

Configuration File
Global Options
Logging

Filters Help

Inspect packets (inspect)
Probe source (probe)
Compositor (compositor)
ISOBMFF/QT demultiplexer (mp4dmx)
MPEG-4 BIFS decoder (bifsdec)
MPEG-4 OD decoder (odfdec)
File input (fin)
BT/XMT/X3D loader (btplay)
HTTP input (httpin)
SVG loader (svgplay)
JPG/J2K/PNG/BMP reframer (rfimg)
PNG/JPG decoder (imgdec)
ADTS reframer (rfadts)
LATM reframer (rflatm)
MP3 reframer (rfmp3)
FAAD decoder (faad)
MAD decoder (maddec)
OpenJPEG2000 decoder (j2kdec)
AC3 reframer (rfac3)
A52 decoder (a52dec)
AMR/EVRC reframer (rfamr)
OGG demultiplexer (oggdmx)
Vorbis decoder (vorbisdec)
Theora decoder (theoradec)
MPEG-2 TS demultiplexer (m2tsdmx)
UDP/TCP input (sockin)
DVB for Linux (dvbin)
OpenSVC decoder (osvcdec)
VideoToolBox decoder (vtbdec)
MediaCodec decoder (mcdec)
MPEG-4 LASeR decoder (lsrdec)
SAF demultiplexer (safdmx)
MPEG-DASH and HLS client (dashin)
CENC decryptor (cdcrypt)
CENC encryptor (cecrypt)
ISOBMFF/QT multiplexer (mp4mx)
QCP reframer (rfqcp)
H263 reframer (rfh263)
M1V/M2V/M4V reframer (rfmpgvid)
NHNT reader (nhntr)
NHML reader (nhmlr)
AVC/HEVC reframer (rfnalu)
MPEG PS demultiplexer (m2psdmx)
AVI demultiplexer (avidmx)
Subtitle loader (txtin)
TTXT/TX3G decoder (ttxtdec)
WebVTT decoder (vttdec)
TTML decoder (ttmldec)
RTP/RTSP/SDP input (rtpin)
File output (fout)
Raw AAC to LATM writer (uflatm)
ADTS writer (ufadts)
MHAS writer (ufmhas)
Media Reframer (reframer)
Stream to file (writegen)
AVC/HEVC to AnnexB writer (ufnalu)
QCP writer (writeqcp)
WebVTT unframer (ufvtt)
NHNT writer (nhntw)
NHML writer (nhmlw)
VobSub parser (vobsubdmx)
AVI multiplexer (avimx)
Audio output (aout)
M4V writer (ufm4v)
VC1 writer (ufvc1)
Audio resampler (resample)
Video output (vout)
Video crop (vcrop)
Video flip (vflip)
RAW video reframer (rfrawvid)
PCM reframer (rfpcm)
JPG encoder (jpgenc)
PNG encoder (pngenc)
Audio/Video rewinder (rewind)
Sources concatenator (flist)
MPEG-2 TS multiplexer (m2tsmx)
DASH and HLS segmenter (dasher)
HEVC tile aggregator (tileagg)
HEVC tile bitstream splitter (tilesplit)
pipe input (pin)
pipe output (pout)
GSF Multiplexer (gsfmx)
GSF demultiplexer (gsfdmx)
UDP/TCP output (sockout)
AV1/IVF/VP9 reframer (rfav1)
IVF/OBU/annexB writer (ufobu)
NVidia decoder (nvdec)
ROUTE input (routein)
RTP Streamer (rtpout)
RTSP Server (rtspout)
HTTP Server (httpout)
HEVC tile splitter (hevcsplit)
HEVC Tile merger (hevcmerge)
FLAC reframer (rfflac)
MPEH-H Audio Stream reframer (rfmhas)
ProRes reframer (rfprores)
MPEG Transport Stream splitter (tssplit)
Compressed bitstream rewriter (bsrw)
Compressed layered bitstream splitter (bssplit)
Compressed layered bitstream aggregator (bsagg)
TX3G unframer (ufttxt)
TX3G to SRT (tx3g2srt)
TX3G to WebVTT (tx3g2vtt)
TX3G to TTML (tx3g2ttml)
WebVTT to TX3G (vtt2tx3g)
SRT reframer (rfsrt)
TTML to WebVTT (ttml2vtt)
TTML to SRT (ttml2srt)
MPEG-H Audio decoder (mpeghdec)
FFMPEG demultiplexer (ffdmx)
FFMPEG decoder (ffdec)
FFMPEG AV Capture (ffavin)
FFMPEG video rescaler (ffsws)
FFMPEG encoder (ffenc)
FFMPEG multiplexer (ffmx)
FFMPEG AVFilter (ffavf)
FFMPEG BitStream filter (ffbsf)
JavaScript filter (jsf)
ROUTE output (routeout)
TrueHD reframer (rftruehd)
CryptFile input (cryptin)
CryptFile output (cryptout)
Packet timestamp rewriter (restamp)
OGG multiplexer (oggmx)
Stream unframer (unframer)
Stream to unframed format (writeuf)
UNCV decoder (uncvdec)
GHI demultiplexer (ghidmx)
EVG video rescaler (evgs)
Closed-Caption decoder (ccdec)
DekTec SDIOut (dtout)
OpenHEVC decoder (ohevcdec)
Uncompressed Video File Format Generator Utility (uncvg)
GPU texture uploader (glpush)
Thumbnail collection generator (thumbs)
Audio Video Mixer (avmix)
AV Counter Generator (avgen)

Clone this wiki locally