Skip to content
jeanlf edited this page Dec 6, 2019 · 4 revisions

HOME » Filters » MPEG-2 TS muxer

MPEG-2 TS muxer

Register name used to load filter: m2tsmx

GPAC TS multiplexer selects M2TS PID for media streams using the PID of the PMT plus the stream index.
For example, default config creates the first program with a PMT PID 100, the first stream will have a PID of 101.
Streams are grouped in programs based on input PID property ServiceID if present. If absent, stream will go in the program with service ID as indicated by sid option.
name option is overriden by input PID property ServiceName.
provider option is overriden by input PID property ServiceProvider.

Time and External Media Information (TEMI)

The temi option allows specifying a list of URLs or timeline IDs to insert in the program.
Only a single TEMI timeline can be specified per PID.
The syntax is a comma-separated list of one or more TEMI description, each of them separated by '#'
Each TEMI description is formated as #ServiceID#ID_OR_URL, with:

  • ServiceID: optional, number indicating the target serviceID
  • ID_OR_URL: If numbern indicates the TEMI ID to use for external timeline. Otherwise, gives the URL to insert
    Each comma-separated description designs a stream index in the target service.

Iinserts a TEMI URL+timecode in the first stream of all programs.


Inserts a TEMI URL+timecode in the first stream of all programs and an external TEMI with ID 4 in the second stream of all programs.


Inserts an external TEMI with ID 4 in the first stream of program with ServiceID 20 and a TEMI URL to the second stream of program with ServiceID 10.


Inserts an external TEMI with ID 4 in the first stream of program with ServiceID 20 and a TEMI URL to the third stream of program with ServiceID 10 (and nothing on second stream).

In DASH mode, the PCR is always initialized at 0, and flush_rap is automatically set.


breq (unsigned int, default: 100): buffer requirements in ms for input pids
pmt_id (unsigned int, default: 100): define the ID of the first PMT to use in the mux
rate (unsigned int, default: 0): target rate in bps of the multiplex. If not set, variable rate is used
pmt_rate (unsigned int, default: 200): interval between PMT in ms
pat_rate (unsigned int, default: 200): interval between PAT in ms
pcr_offset (unsigned int, default: -1): offset all timestamps from PCR by V, in 90kHz. Default value is computed based on input media
mpeg4 (enum, default: none): force usage of MPEG-4 signaling (IOD and SL Config).

  • none: disables 4on2
  • full: sends AUs as SL packets over section for OD, section/pes for scene (cf bifs_pes)
  • scene: sends only scene streams as 4on2 but uses regular PES without SL for audio and video

pmt_version (unsigned int, default: 200): set version number of the PMT
disc (boolean, default: false): set the discontinuity marker for the first packet of each stream
repeat_rate (unsigned int, default: 0): interval in ms between two carousel send for MPEG-4 systems. Is overriden by carousel duration PID property if defined
repeat_img (unsigned int, default: 0): interval in ms between resending (as PES) of single-image streams. If 0, image data is sent once only
max_pcr (unsigned int, default: 100): set max interval in ms between 2 PCR
nb_pack (unsigned int, default: 4): pack N TS packets in output packets
pes_pack (enum, default: audio): set AU to PES packing mode.

  • audio: will pack only multiple audio AUs in a PES
  • none: make exactly one AU per PES
  • all: will pack multiple AUs per PES for all streams

rt (boolean, default: false): use real-time output
bifs_pes (enum, default: off): select BIFS streams packetization (PES vs sections)

  • on: uses BIFS PES
  • off: uses BIFS sections
  • copy: uses BIFS PES but removes timestamps in BIFS SL and only carries PES timestamps

flush_rap (boolean, default: false): force flushing mux program when RAP is found on video, and injects PAT and PMT before the next video PES begin
pcr_only (boolean, default: false): enable PCR-only TS packets
pcr_init (long int, default: -1): set initial PCR value for the programs. Negative value implies random value is picked
sid (unsigned int, default: 0): set service ID for the program - see filter help
name (string): set service name for the program - see filter help
provider (string): set service provider name for the program - see filter help
sdt_rate (unsigned int, default: 0): interval in ms between two DVB SDT tables. If 0, SDT is disabled
temi (string): insert TEMI time codes in adaptation field - see filter help
temi_delay (unsigned int, default: 1000): set delay in ms between two TEMI url descriptors
temi_offset (unsigned int, default: 0): set offset in ms to add to TEMI timecodes
temi_ntp (boolean, default: false): insert NTP timestamp in TEMI timeline descriptor
log_freq (unsigned int, default: 500): delay between logs for realtime mux
latm (boolean, default: false): use LATM AAC encapsulation instead of regular ADTS
subs_sidx (int, default: -1): number of subsegments per sidx. negative value disables sidx

HOME » Filters

GPAC Configuration

Configuration File
Global Options

Filters Overview

General Filters Concepts
gpac General Usage
Built-in Properties

Filters Help

Inspect packets (inspect)
Probe source (probe)
Compositor (compositor)
ISOBMFF/QT demuxer (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)
XVid decoder (xviddec)
OpenJPEG2000 decoder (j2kdec)
AC3 reframer (rfac3)
A52 decoder (a52dec)
AMR/EVRC reframer (rfamr)
OGG demuxer (oggdmx)
Vorbis decoder (vorbisdec)
Theora decoder (theoradec)
MPEG-2 TS demuxer (m2tsdmx)
UDP/TCP input (sockin)
OpenSVC decoder (osvcdec)
VideoToolBox decoder (vtbdec)
MPEG-4 LASeR decoder (lsrdec)
SAF demuxer (safdmx)
MPEG-DASH and HLS client (dashin)
CENC decryptor (cdcrypt)
CENC encryptor (cecrypt)
ISOBMFF/QT muxer (mp4mx)
QCP reframer (rfqcp)
H263 reframer (rfh263)
M1V/M2V/M4V reframer (rfmpgvid)
NHNT reader (nhntr)
NHML parser (nhmlr)
AVC/HEVC reframer (rfnalu)
MPEG PS demuxer (m2psdmx)
AVI demuxer (avidmx)
Subtitle loader (txtin)
TTXT/TX3G decoder (ttxtdec)
WebVTT decoder (vttdec)
RTP/RTSP/SDP input (rtpin)
File output (fout)
Raw AAC to LATM writer (uflatm)
ADTS writer (ufadts)
Media Reframer (reframer)
Stream to file (writegen)
AVC/HEVC to AnnexB writer (ufnalu)
QCP writer (writeqcp)
WebVTT writer (writevtt)
NHNT writer (nhntw)
NHML writer (nhmlw)
VobSub demuxer (vobsubdmx)
AVI muxer (avimx)
Audio output (aout)
M4V writer (ufm4v)
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 muxer (m2tsmx)
DASH and HLS segmenter (dasher)
HEVC tile aggregator (tileagg)
pipe input (pin)
pipe output (pout)
GSF Muxer (gsfmx)
GSF Demuxer (gsfdmx)
UDP/TCP output (sockout)
AV1/IVF/VP9 reframer (rfav1)
IVF/OBU/annexB writer (ufobu)
ATSC input (atscin)
RTP Streamer (rtpout)
RTSP Server (rtspout)
HTTP Server (httpout)
HEVC tile spliter (hevcsplit)
HEVC Tile merger (hevcmerge)
FLAC reframer (rfflac)
ProRes reframer (rfprores)
MPEG Transport Stream splitter (tssplit)
FFMPEG demuxer (ffdmx)
FFMPEG decoder (ffdec)
FFMPEG AV Capture (ffavin)
FFMPEG video rescaler (ffsws)
FFMPEG encoder (ffenc)
FFMPEG muxer (ffmx)
FFMPEG AVFilter (ffavf)
JavaScript filter (jsf)
OpenHEVC decoder (ohevcdec)

Clone this wiki locally
You can’t perform that action at this time.