Skip to content
Sonny Walkman edited this page Mar 28, 2024 · 26 revisions

Welcome to the mptsd wiki!

Below is my basic usage information page to assist with usage and shall be updated when improvements and feature available.

mptsd is a versatile tool for MPEG TS multichannel multiplexing of individual SPTS => MPTS. (Single Program Transport Stream) => (Multiple Program Transport Stream)

MPEG transport stream

mptsd offering a wide range of features from server configuration to handling various output settings.

This document provides an overview of all command-line options available as of 28-03-2024.

Usage

Identification

  • -i ident: Sets the server ident. Default: ux/mptsd.

Server Settings

  • -b addr: Binds to a local IP address. Default: 0.0.0.0.
  • -p port: Sets the port to listen on. Default: 0.
  • -N: Disables network.
  • -d pidfile: Daemonizes with specified pidfile.
  • -l host: Specifies the Syslog host. Default: disabled.
  • -L port: Sets the Syslog port. Default: 514.

Configuration Files

  • -g file: Specifies the global configuration file. Default: mptsd.conf.
  • -c file: Specifies the channels configuration file. Default: mptsd_channels.conf.
  • -e file: Specifies the EPG configuration file. Default: mptsd_epg.conf.
  • -n file: Specifies the NIT configuration file. Default: mptsd_nit.conf.

Output Settings

  • -O ip: Sets the output UDP address.
  • -P ip: Sets the output UDP port. Default: 5000.
  • -o ip: Specifies the output interface address. Default: 0.0.0.0.
  • -t ttl: Sets the multicast TTL. Default: 1.
  • -s SSRC: Enables RTP. Default: disabled.
  • -B Mbps: Sets the output bitrate in Mbps. Default: 38.00.
  • -m mode: Sets the PCR mode. Available modes:
    • Mode 0: Do not touch PCRs (default).
    • Mode 1: Move PCRs to their calculated place.
    • Mode 2: Rewrite PCRs using output bitrate.
    • Mode 3: Move PCRs and rewrite them.

Mode 3 Note:-

mptsd provides the capability for exact PCR restamping, achievable by employing the -m 3 option. This functionality is especially vital for hardware modulators that necessitate precise PCR values to function correctly. Given the importance of this feature for many cost-effective modulators, it is advised to always use -m 3 setting with them.

Compatibility and performance testing of mptsd has successfully demonstrated its effective operation with the following modulators:

  • Dektec DTE-3114
  • HiDes UT-100C

Employing the -m 3 option ensures that mptsd meets the technical requirements needed for optimal functionality with these and potentially other hardware modulators.

Other Settings

  • -q: Quiet mode.
  • -D: Debug mode.
  • -W: Write output file (recommended to use with -N).
  • -f: Specifies the output filename. Default: mptsd-output.ts (use - for stdout).
  • -E: Write input file.
  • -9: Enable LCN support. Default: disabled.

mptsd Configuration Files Analysis

mptsd.conf

The global configuration file for mptsd, affecting server-wide settings.

Key Sections:

  • Global: Set the network ID.
  • Timeouts: Controls the insertion times for needed PSI.

Example:

[Global]
network_id=1

[Timeouts]
pat = 100       // Min:25 Max:500
#cat = 200      // Min:25 Max:500       ** unused **
pmt = 200       // Min:25 Max:500
nit = 2000      // Min:25 Max:10000
sdt = 500       // Min:25 Max:2000
#bat = 5000     // Min:25 Max:10000     ** unused **
eit = 1000      // Min:25 Max:2000
#rst = 20000    // Min:25 Max: -        ** unused **
tdt = 5000      // Min:25 Max:30000
tot = 15000     // Min:25 Max:30000
stats = 1000    // No limits

mptsd_channels.conf

Defines channels and their source streams for the multiplex.

Key Sections:

  • Channel Definition: Names, IDs, and source addresses for each channel.
  • PID Mappings: Custom mappings of PIDs from source to multiplex.

Example:

[Global]
provider_name = Unix Solutions
transport_stream_id = 1

[Channel1]
service_id	= 1
id		= btv
name		= bTV
eit_mode	= 0 # 0 = ignore EIT data from input
		# 1 = forward EIT data for the configured service, ignore any other EIT data
source1		= http://signal-server/stb/btv.mpg
#source2	= http://signal-server2/stb/btv.mpg
#source3	= http://signal-server3/stb/btv.mpg
#source4	= udp://239.0.0.1:5000/
#source5	= rtp://239.78.78.2:5000/
#worktime	= 14:18-14:19
lcn		= 2
lcn_visible	= yes

[Channel2]
service_id	= 2
id		= kanal1
name		= "Kanal 1"
source		= http://signal-server/stb/kanal1.mpg
lcn		= 2
lcn_visible	= yes

[Channel3]
service_id	= 3
id		= novatv
name		= "Nova"
source1		= http://signal-server/stb/novatv.mpg
lcn		= 3
lcn_visible	= yes

[Channel4]
service_id	= 4
id		= tv2
name		= "TV 2"
source1		= http://signal-server/stb/tv2.mpg
lcn		= 7
lcn_visible	= yes

[Channel5]
service_id	= 5
id		= ngc
name		= "NatGeo"
source1		= http://signal-server/stb/ngc.mpg
lcn		= 72
lcn_visible	= yes

[Channel6]
service_id	= 6
id		= tv1
name		= "TV 1"
source1		= http://signal-server/stb/tv1.mpg
lcn		= 25
lcn_visible	= yes

[Channel7]
service_id	= 7
id		= planetahit
name		= "Planeta HIT"
source1		= http://signal-server/stb/planetahit.mpg
lcn		= 33
lcn_visible	= no

[Channel8]
service_id	= 8
id		= fresh
name		= "Radio Fresh"
radio		= yes
source		= http://signal-server/stb/fresh.mpg
lcn		= 201
lcn_visible	= yes

[Channel9]
service_id	= 9
id		= bgradio
name		= "BG Radio"
radio		= yes
source1		= http://signal-server/stb/bgradio.mpg
lcn		= 202
lcn_visible	= yes

mptsd_epg.conf

Configures EPG data sourcing and association for the multiplex.

Key Sections:

  • EPG Sources: Methods and sources for acquiring EPG data.
  • EPG Association: Links EPG data to specific channels.

Example:

[btv-now]
start=1271055600
duration=3600
event=the day is wonderful
sdescr=A women's talk show with hosts Iva and Bogi
descr=123456789012345678901234567890123456789012345678901234567890xxxxxxyy

[btv-next]
start=1271059200
duration=3600
event=Wind from the valley
sdescr=series, еп. 69
descr=

[kanal1-now]
start=1271056500
duration=2700
event=Bold and the Beautiful
sdescr=tv movie /2477 episodes/
descr=

[kanal1-next]
start=1271059200
duration=2700
event=Women with Marta Vachkova /talk show/
sdescr=
descr=

[novatv-now]
start=1271052900
duration=8100
event=For coffee
sdescr=broadcast on NTV
descr=

[novatv-next]
start=1271061000
duration=5400
event=The house of money
sdescr=a fun show on NTV
descr=

[tv2-now]
start=1271055600
duration=3600
event=Intermission
sdescr=
descr=

[tv2-next]
start=1271059200
duration=7200
event=Password. Fish match
sdescr=criminal with John Travolta, Holy Berry
descr=

[ngc-now]
start=1271055600
duration=3600
event=The incredible bear
sdescr=
descr=

[ngc-next]
start=1271059200
duration=3600
event=Some Other Event Information
sdescr=
descr=

mptsd_nit.conf

Manages the Network Information Table (NIT) for the digital television network.

Key Sections:

  • Network ID: Unique identifier for the network.
  • Transport Streams: List of transport streams with identifiers.
  • Network Descriptors: Additional network metadata.

Example:

[Global]
network_name = "Unixsol DVB-C network"

[Transponder1]
transport_stream_id = 1
frequency           = 0658,0000
modulation          = 64-QAM
symbol_rate         = 006,8750

[Transponder2]
transport_stream_id = 2
frequency           = 0666,0000
modulation          = 64-QAM
symbol_rate         = 006,8750

[Transponder3]
transport_stream_id = 3
frequency           = 0674,0000
modulation          = 64-QAM
symbol_rate         = 006,8750

[Transponder4]
transport_stream_id = 4
frequency           = 0682,0000
modulation          = 64-QAM
symbol_rate         = 006,8750

[Transponder5]
transport_stream_id = 5
frequency           = 0690,0000
modulation          = 64-QAM
symbol_rate         = 006,8750

[Transponder6]
transport_stream_id = 6
frequency           = 0698,0000
modulation          = 64-QAM
symbol_rate         = 006,8750

[Transponder7]
transport_stream_id = 7
frequency           = 0706,0000
modulation          = 64-QAM
symbol_rate         = 006,8750

[Transponder8]
transport_stream_id = 8
frequency           = 0714,0000
modulation          = 64-QAM
symbol_rate         = 006,8750

Example command line

mptsd -m 3 -b 0.0.0.0 -O 224.0.0.1 -p 1234 -g ./somepath/mux/mptsd.conf -c ./somepath/mux/mptsd_channels.conf -e ./somepath/mux/mptsd_epg.conf -n ./somepath/mux/mptsd_nit.conf -i mysuper-mux
Clone this wiki locally