Skip to content

routein

Romain Bouqueau edited this page Mar 5, 2024 · 20 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.

ROUTE input

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

This filter is a receiver for ROUTE sessions (ATSC 3.0 and generic ROUTE).

  • ATSC 3.0 mode is identified by the URL atsc://.
  • Generic ROUTE mode is identified by the URL route://IP:PORT.

The filter can work in cached mode, source mode or standalone mode.

Cached mode

The cached mode is the default filter behavior. It populates GPAC HTTP Cache with the received files, using http://groute/serviceN/ as service root, N being the ROUTE service ID.
In cached mode, repeated files are always pushed to cache.
The maximum number of media segment objects in cache per service is defined by nbcached; this is a safety used to force object removal in case DASH client timing is wrong and some files are never requested at cache level.

The cached MPD is assigned the following headers:

  • x-route: integer value, indicates the ROUTE service ID.
  • x-route-first-seg: string value, indicates the name of the first segment (completely or currently being) retrieved from the broadcast.
  • x-route-ll: boolean value, if yes indicates that the indicated first segment is currently being received (low latency signaling).
  • x-route-loop: boolean value, if yes indicates a loop in the service has been detected (usually pcap replay loop).

The cached files are assigned the following headers:

  • x-route: boolean value, if yes indicates the file comes from an ROUTE session.

If max_segs is set, file deletion event will be triggered in the filter chain.

Source mode

In source mode, the filter outputs files on a single output PID of type file. The files are dispatched once fully received, the output PID carries a sequence of complete files. Repeated files are not sent unless requested.
If needed, one PID per TSI can be used rather than a single PID. This avoids mixing files of different mime types on the same PID (e.g. HAS manifest and ISOBMFF).
Example

gpac -i atsc://gcache=false -o $ServiceID$/$File$:dynext

This will grab the files and forward them as output PIDs, consumed by the fout filter.

If max_segs is set, file deletion event will be triggered in the filter chain.

Standalone mode

In standalone mode, the filter does not produce any output PID and writes received files to the odir directory.
Example

gpac -i atsc://:odir=output

This will grab the files and write them to output directory.

If max_segs is set, old files will be deleted.

File Repair

In case of losses or incomplete segment reception (during tune-in), the files are patched as follows:

  • MPEG-2 TS: all lost ranges are adjusted to 188-bytes boundaries, and transformed into NULL TS packets.
  • ISOBMFF: all top-level boxes are scanned, and incomplete boxes are transformed in free boxes, except mdat kept as is if repair is set to simple.

If kc option is set, corrupted files will be kept. If fullseg is not set and files are only partially received, they will be kept.

Interface setup

On some systems (OSX), when using VM packet replay, you may need to force multicast routing on your local interface.
For ATSC, you will have to do this for the base signaling multicast (224.0.23.60):
Example

route add -net 224.0.23.60/32 -interface vboxnet0

Then for each ROUTE service in the multicast:
Example

route add -net 239.255.1.4/32 -interface vboxnet0

Options

src (cstr): URL of source content
ifce (str): default interface to use for multicast. If NULL, the default system interface will be used
gcache (bool, default: true): indicate the files should populate GPAC HTTP cache
tunein (sint, default: -2): service ID to bootstrap on for ATSC 3.0 mode (0 means tune to no service, -1 tune all services -2 means tune on first service found)
buffer (uint, default: 0x80000): receive buffer size to use in bytes
timeout (uint, default: 5000): timeout in ms after which tunein fails
nbcached (uint, default: 8): number of segments to keep in cache per service
kc (bool, default: false): keep corrupted file
skipr (bool, default: true): skip repeated files (ignored in cache mode)
stsi (bool, default: false): define one output PID per tsi/serviceID (ignored in cache mode)
stats (uint, default: 1000): log statistics at the given rate in ms (0 disables stats)
tsidbg (uint, default: 0): gather only objects with given TSI (debug)
max_segs (uint, default: 0): maximum number of segments to keep on disk
odir (str): output directory for standalone mode
reorder (bool, default: false): ignore order flag in ROUTE/LCT packets, avoiding considering object done when TOI changes
rtimeout (uint, default: 5000): default timeout in ms to wait when gathering out-of-order packets
fullseg (bool, default: false): only dispatch full segments in cache mode (always true for other modes)
repair (enum, default: simple): repair mode for corrupted files

  • no: no repair is performed
  • simple: simple repair is performed (incomplete mdat boxes will be kept)
  • strict: incomplete mdat boxes will be lost as well as preceding moof boxes
  • full: HTTP-based repair, not yet implemented

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