TSReader

Command-Line Interface


Updated September 17, 2013

Note: This section applies only to TSReader Standard and TSReader Professional - command-line interface is not supported by TSReader Lite.

TSReader can be run from the command-line prompt or from programs such as the Windows Scheduler. Typically with sources like satellite cards, TSReader will provide a dialog to allow you to setup the parameters associated with the TSReader session. By supplying these parameters on the command-line, you can make TSReader run automatically.

TSReader has two sets of parameters. The first are parameters for TSReader itself. These are options like automatic recording. Following these parameters on the command-line are parameters specific to the source currently selected by TSReader. So for example:

TSReader -x nbc.xml 3860 H 26670 5150 0

The text in blue is a TSReader parameter and the green is specific to the selected source - in this case, parameters for a satellite card.

Parameters surrounded with { } characters are optional. If spaces are used in filenames or any other text, put " " marks around the text.

TSReader parameters

Summary

Switch Parameters Function
-1 (figure one) none Force TSReader to run in uniprocessor mode on a multiprocessor machine.
-2
none
Forces on the "Allow PC to Sleep" option
-4
export-format
Selects the HTML and XML export character set. Options are: ISO-8859-1 and UTF-8.
-5
language
Sets the EIT language filter. The language is always parameter must be three characters.
-a service file length Record All single file
-A splitsize service file length Record All split files
-b program Limits thumbnail generation to the specified program.
-B none Disables elementary stream blacklisting.
-c port TSReader control server enable
-C receiver-type serial-port Receiver serial control enable
-d none Disable stream parsing
-D a/d/i/m Forces network type. a=ATSC, d=DVB, i=ISDB, m=DCII.
-e filename In TSReader Professional this sets the name of the EPG-data save file. This allows all EPG data received by TSReader to be automatically exported.
-Es none Sets TSReader's EIT parser to process the UK/Ireland Sky EEPG
-Ed none Sets TSReader's EIT parser to handle Dish Network's EEPG
-Eb  none Sets TSReader's EIT parser to handle Bell ExpressVu's EEPG
-f {+network-addr}
Starts UDP forwarding when TSReader Professional starts. Make sure the parameters for forwarding are already setup before using this switch.The optional network-addr specifies the network interface to send the forwarded stream to.
-F {+/*reload} filename
In TSReader Professional, this command runs a control server script (a file with a list of control server commands). It is suggested that the -c switch also be used to ensure the control server is active. The optional +reload parameter causes TSReader to re-run the script after a delay of reload seconds. For example: -F +3600 c:\test.txt would run the script in test.txt every hour. The optional *reload parameter is the same as the +reload however, the filename is a file with a list of files to try - http:// prefixed are supported in this file.
-g
none
TSReader Pro only. This switch is used to enable automatic profile import/export when running TSReader from a memory stick. The first time TSReader is run this way, profiles from the current system will be copied onto the memory stick. From that point on, the profiles will remain on the memory stick being automatically to and from the system TSReader is being run on. The -g MUST be the first switch on the command line.
-G
PID
Sets the PAT PID - almost always this is zero, but if specfied, the PID can either be decimal or hex if prefixed with 0x. For example, -G 0x1000.
-h chart-number Displays the specified chart when TSReader starts: -h0 PID pie, -h1 PID pie 3D, -h2 Video Bitrate, -h3 Video Bitrate Area, -h4 Mux Usage, -h5 Mux Usage Area, -h6 Active PIDs by Rate, -h7 Active PIDs by PID, -h8 Program Usage Stacked, -h9 Video Composition, -h: (minus h colon) Signal Chart.
-H filename HTML export - all information is output
-H+ option filename HTML export but with control over what gets output to the HTML file. the parameter option is HEX ASCII combination of these bit values to select which tables are exported (all in hex): 1-PAT, 2-PMT, 4-CAT, 8-NIT, 10-SDT, 20-EIT,40-SDT only for this mux,80-PID chart,100-thumbnails,200-MPEG-2 stats,400-source info.
-i none Force single TSReader instance
-I outfile duration options {+}"PID PID PID" Record PIDs. If the "PID PID PID" section is prefixed with a + sign, the quoted text becomes the name of a PDL file containing the list of PIDs to record.
-L profile Selects the profile in TSReader Professional. -L by itself shows the profile list.
-m filename Load manual channels
-M none Launch TSReader minimized
-Mm none Launch TSReader minimized to the tray notification area.
-n{H} none In TSReader Professional starts automatic archiving with the Record All Channels feature. The optional H characters tells TSReader to hide its main window.
-N none Pro: Starts the stream monitor when TSReader starts.
-p none Force Program Stream format for command-line recordings
-P position delay Sends a DiSEqC motor command then delays for 'delay' seconds while the rotor moves to the stored position.
-PU position delay Sends a USALS motor command via DiSEqC. The position should be the orbital location required, multiplied by 1000 with either E/W on the end of the position. For example, 61.5 west would be 61500W and 19.2 east would be 19200E.
-q none Switches to quiet mode. TSReader runs normally but should there be an issue starting (like not being able to tune), TSReader will display no message and return a value of one to the application that started TSReader. This is useful for automating TSReader.
-r service file length Record Program single file
-R splitsize service file length Record Program split files
-s source-filename Specify source name
-S  card-number Source device number
-t audio-track Select audio track for automatic recording
-T filename Loads a PID list file (PDL)
-u none Include subtitle streams in recording
-v service VLC-configuration Auto stream to VLC
-V service VLC-configuration seconds Auto stream to VLC time limited
-x{+} filename Automatic XML export. The optional + character after the switch is used along with -y followed by a very large number and the file source with the option to close TSReader when the file has been processed. Using this combination, it's possible for TSReader to process an entire file and then do XML export and exit.
-X{+}
{+opt remapfile) filename
Automatic XMLTV export. Adding a + before the filename adds two parameters - opt is a single digit value with a bitmap for export options: 1 - export using UTC time (XMLTV is usually local-time), 2 - export a script file (compatible with TSReader's control server) and 4 - remap channel numbers per the remap file which is a text file containing lines with mmmmm=nnnnn where mmmmm is the TSReader service number and nnnnn is the exported service number. The remap file is only specified when the 4 value is in the opt field.
-y delay Delays auto-export for up to delay seconds. The default delay is 10 seconds and starts once TSReader stops seeing new SI data. If a negative value is specified, TSReader will perform the automatic export after the number of seconds, irrelevant of any new SI data being received.

Running uniprocessor mode

We have seen instances where either hardware drivers or MD-Plugins don't perform correctly when run on multiprocessor machines (including Hyper-Threading / Multi-Core CPUs). By using the -1 switch, TSReader will only run on the first processor. Note that this switch is figure one, not a lower-case L.

-1 (no additional parameters)

Automatic Transport Stream Recording

The -r and -R switches record a single program - the -a and -A switches are used to record the entire transport stream:

-a service file length
-A splitsize service file length

splitsize Only used with the -A option. Specifies the size in MB of each file to be recorded. Once files recorded by TSReader get larger than this size, a new file will be generated.
service The MPEG service number from the Program Association Table
file The name of the file to record
length The number of seconds to record

When -a is used, a single file is generated. When -A is used, the file split mechanism is used to ensure files don't get bigger than the specified size.

As an example, this records half an hour of transport stream from NBC on AMC4 from a satellite card and the second example records channel 10 for 30 minutes, splitting the recording into 120 MB files. Since there are no parameters, one must assume that the source doesn't need any parameters - the Linear Systems ASI source is an example.

TSReader -a 10 c:\mpeg\nbc.mpg 1800 3860 H 26670 5150 0
TSReader -A 120 10 c:\mpeg\nbc.mpg 1800

Note that the service number still needs to be specified although the entire mux is received. This is done so that any installed plugins can correctly set themselves up for the recording. If you don't use plugins for the recording session, simply set the service number to zero.

Control Server enable

TSReader includes a remote control TCP/IP based server which may be used to automate TSReader. This switch enables it on the specified port.

-c port

port The TCP/IP port number to use for the control server

Enabling Serial Receiver Control

This switch turns on serial receiver control. This is used with external commercial receivers feeding TSReader through SPI or ASI sources.

-C receiver-type serial-port

receiver-type The type of the receiver. Currently supported are AlteiaPlus, DSR-4800 and TT1260. To disable serial receiver control use "off" as the receiver type.
serial-port The serial port to use the communicate with the receiver, for example COM2

Disabling thumbnails and stream parsing

The -d switch disables thumbnails and ES parsing for the current TSReader session. Useful if you want thumbnails enabled when using TSReader interactively but want all processing overhead turned off when TSReader is performing automatic recording.

-d (no additional parameters)

Forcing Network Mode

TSReader normally figures out which network type being processed. However, some muxes contain both DVB and ATSC tables, so the -Dx switch is used to force a particular network type.

-Da (ATSC)
-Dd (DVB)
-Di (ISDB)
-Dm (DCII)

Automatic HTML Export

This option behaves just like the -x option but exports in HTML format.

-H filename

filename The name of the file to write decoded tables in HTML format

Controlling TSReader Instances

The -i switch forces TSReader to close any other instance of TSReader already running.

-i (no additional parameters)

Automatically Recording PIDs

The -I switch tells TSReader to automatically record data from selected PIDs and then quit.

-I filename duration options "PID PID PID PID..."

filename The name of the filename or folder to write to depending on options
duration The number of seconds to record data from the seleced PIDs
options Bit field indicating record options:
 1 - Drop transport stream headers
 2 - Record selected PIDs into a single file.
 4 - Append recordings to any existing files
PID The PID(s) to record. These must be surrounded by " characters. Assumed to be decimal unless prefixed with 0x for hex.

If the value 2 is not present in the options bitfield, TSReader treats filename as the folder to write transport stream data to. Recorded files will be named "PID_0xnnnn.bin" in this output directory. If this value is set in the bitfield, TSReader will treat filename as a true filename and write data from the selected PIDs to that file.

Automatic Manual Channel Load

The -m switch tells TSReader to load a manual channel file before starting processing. This switch is useful with the -r option when you want to record from a mux that doesn't carry proper MPEG-2 tables.

-m filename

filename The name of the TMC file created by TSReader to load

Starting TSReader Minimized

The -M switch causes TSReader to startup minimized. Useful when performing an automatic recording or playback via VLC and you don't want the TSReader window showing up. Additionally if TSReader's option to hide when minimized is set TSReader's window will be hidden with an icon placed on the taskbar notification area.

-M (no additional parameters)

Force Program Stream recordings

By default, TSReader records programs as an MPEG-2 Transport Stream. It can record in Program Stream format which is more widely accepted in the PC realm. This switch forces TSReader in Program Stream mode.

-p (no additional parameters)

Sending DiSEqC Positioner commands

The -P switch is used to tell a DiSEqC 1.2 compatible positioner to move to a particular stored position. The position number (1 through 60) should have already been programmed into the positioner. After the move command is sent, TSReader stalls for the specified number of seconds before attemtping to tune. This delay should take into consideration the time it takes the positioner to move to a particular satellite.

-P position delay

position The stored position to move to. This is in the range 1 through 60
delay The number of seconds to delay after sending the command

Automatic Recording

TSReader supports automatic recording from the command-line. When used with the Windows Scheduler, this allows for unattended recording.

To use this function, add the following to the start of the command-line:

-r service file length
-R splitsize service file length

splitsize Only used with the -R option. Specifies the size in MB of each file to be recorded. Once files recorded by TSReader get larger than this size, a new file will be generated.
service The MPEG service number from the Program Association Table
file The name of the file to record. If you want to output to a D-VHS deck, specify the filename as "D-VHS"
length The number of seconds to record

When -r is used, a single file is generated. When -R is used, the file split mechanism is used to ensure files don't get bigger than the specified size.

As an example, this records half an hour of programming from NBC Central on AMC4 from a satellite card and the second example records channel 10 for 30 minutes, splitting the recording into 120MB files. Since there are no parameters, one must assume that the source doesn't need any parameters - the Linear Systems ASI source is an example.

TSReader -r 10 c:\mpeg\nbc.mpg 1800 3860 H 26670 5150 0
TSReader -R 120 10 c:\mpeg\nbc.mpg 1800

Resetting the TSReader Source

The -s switch resets the source TSReader will use for the session. This is useful to add to all automatic functions to ensure TSReader is using the source you expect. For example if you switch to the File source to look at an existing transport stream, you'll need to reset back to your hardware interface for recording new streams

-s source-filename

source-filename The name of the source DLL to switch to.

For example:

TSReader -s TSReader_Twinhan1030.dll -r 10 c:\mpeg\nbc.mpg 1800 3860 H 26670 5150 0

Specifying the source device number

Dektec and TechnoTrend drivers support multiple cards in the same system. The -S option is used to specify which of these TSReader will use. By default, the first card (card zero) will be used.

-S card-number

card-number The card number. First card is card 0, second card 1 and so on

For example:

TSReader -s TSReader_TTBudgetS.dll -S 1 3860 H 26670 5150 0

Automatic Recording Audio Track Selection

If the program being recorded contains multiple audio tracks, the -t switch is used to select between them:

-t audio-track

track The number of the audio track to record. To find this value launch TSReader in non-automatic mode, select the appropriate program and use the Record/Record Program menu. The audio tracks shown on the Record Program dialog use the same order as this switch - for example, -t 2 would select the second audio stream listed. Setting this value to zero (or not specifying the -t parameter) will record all audio streams defined in the program.

This switch has no effect unless the -r or -R switches are also used.

Recording Subtitles

The -u switch tells TSReader to include streams containing a subtitle descriptor when doing a recording.

-u (no additional parameters)

Automatic playback via VLC

The -v and -V switches force TSReader to automatically start playing a selected stream through VLC.

-v service VLC-configuration
-V service VLC-configuration seconds

service The MPEG service number from the Program Association Table
VLC-configuration The VLC configuration number. This parameter is in the range 1-16 and represents a VLC configuration in TSReader. Typically 1 will be used for live playback.
seconds The number of seconds to run VLC. TSReader will automatically shutdown after this time. Used with the -V switch.

For example this command will play NASA-TV from Dish Network at 119 west:

TSReader -v 213 1 12297 L 20000 11250 0

Automatic XML Export

TSReader can automatically decode DVB tables and then export the data to a XML file that can be parsed by external programs. Since the MPEG and DVB systems doesn't have any flags to indicate "you've got all the data", TSReader will process tables and determine when it's got all the data it needs, write the file and then quit. Obviously this means that the time spent running will vary depending on the rate at which tables are sent in the mux. This code sample shows how to enumerate processes on Windows 2000 and greater to see if TSReader is still doing it's stuff.

To use this function, add the following to the start of the command-line:

-x filename

filename The name of the file to write tables to

As an example, this will decode tables for NBC on AMC4 to "nbc.xml" and then exit:

TSReader -x nbc.txt 3860 H 26670 5150 0

For documentation on the exported files, please follow this link.

Automatic XMLTV Export

This option behaves just like the -x option but exports in XMLTV format for use with the myHPTC program.

-X filename

filename The name of the file to write EPG data in XMLTV format

Delaying Automatic Export

When TSReader performs an automatic export in HTML, XML or XMLTV formats, it listens to the mux until nothing new has been added to the tree view of TSReader for a default of 10 seconds. On some transmissions this default delay may not be enough to catch all tables, so the -y switch is used to set the delay in seconds. Keep in mind that the counter which causes the export and eventual termination of TSReader gets reset every time a new item is added to the tree-view, so long delays around a few minutes may cause TSReader to keep running for a long time.

-y delay

delay The delay in seconds to auto export after TSReader hasn't seen a new table.

Source Parameters

DVB-S/DSS satellite cards

TSReader {TSReader-options} {freq pol sr lnbf 22khz {DiSEqC}}

freq The frequency to tune in MHz (for example 11.700 GHz would be 11700)
pol The polarity to set. This actually controls the voltage on the coax so if you're using a big dish, you'll need to set the polarity manually.
sr The symbol rate to use.
lnbf The frequency of the local oscillator in the LNB. For C-Band, this is 5150, for the FSS Ku-Band, it's 10750 and for the DBS band 11250.
22khz Turns the 22 KHz tone on with a value of 1. Useful to switch between signals with an external switch.
DiSEqC Optional. Sends DiSEqC command to select LNB input on a DiSEqC switch. Values are 1-4 for DiSEqC ports 1-4, 5 = Tone A, 6 = Tone B. Some cards also support Dish Network switches with values 7-20. See the bottom of this document for a list.

DVB-C cable cards

TSReader {TSReader-options} {freq sr QAM inversion bandwidth}

freq frequency to tune in KHz (for example, 520.167 MHz would be 520167)
sr The symbol rate to use
QAM The QAM mode to use: 0=QAM-16 1=QAM-32 2=QAM-64 3=QAM-128 4=QAM-256
inversion inverted spectrum (0 or 1)
bandwidth bandwidth of signal (0 = 6, 1 = 7, 2 = 8 MHz)

DVB-T terrestrial cards

TSReader {TSReader-options} {freq inversion bandwidth}

freq frequency to tune in KHz (for example, 520.167 MHz would be 520167)
inversion Spectrum inversion. Set to 0 or 1 as appropriate for your area
bandwidth Bandwidth of the COFDM transmission. 0 = 6 MHz 1 = 7 MHz 2 = 8 MHz

ATSC terrestrial cards

TSReader {TSReader-options} {freq}

freq frequency to tune in MHz. Prefix with 0 to specify a standard channel number

Annex B QAM cable cards

TSReader {TSReader-options} {freq}

freq frequency to tune in MHz. Prefix with 0 to specify a standard channel number

Full-mode satellite (DVB-S, Turbo, DCII, DVB-SNG, DVB-S2)

TSReader {TSReader-options} {freq pol sr lnbf 22khz mode fec {DiSEqC}}

freq The frequency to tune in MHz (for example 11.700 GHz would be 11700)
pol The polarity to set. This actually controls the voltage on the coax so if you're using a big dish, you'll need to set the polarity manually.
sr The symbol rate to use.
lnbf The frequency of the local oscillator in the LNB. For C-Band, this is 5150, for the FSS Ku-Band, it's 10750 and for the DBS band 11250.
22khz Turns the 22KHz tone on with a value of 1. Useful to switch between signals with an external switch.
mode Modulation mode to select. 0 = DVB QPSK, 1 = Turbo QPSK, 2 = Turbo 8PSK, 3 = Turbo 16QAM, 4 = DCII combo QPSK, 5 = DCII split QPSK I, 6 = DCII split QPSK Q, 7 = DCII OQPSK, 8=DVB S2, 9=DSS
fec FEC selection - varies depending on mode. See table below for details.
DiSEqC Optional. Sends DiSEqC command to select LNB input on a DiSEqC switch. Values are 1-4 for DiSEqC ports 1-4, 5 = Tone A, 6 = Tone B. Some cards also support Dish Network switches with values 7-20. See the bottom of this document for a list.

FEC Rate Table

Mode Rate Value
DVB QPSK 1/2 0
  2/3 1
  3/4 2
  5/6 3
  7/8 4
  Auto 5
Turbo QPSK 1/4 0
  1/2 1
  3/4 2

2/3
3

5/6
4

Auto
5
Turbo 8PSK 2/3 0
  3/4 I 1
  3/4 II 2
  5/6 3
  8/9 4
Turbo 16QAM 3/4 0
DCII modes 5/11 0
  1/2 1
  3/5 2
  2/3 3
  3/4 4
  4/5 5
  5/6 6
  7/8  7
  Auto 8
DVB-S2 1/4 0
  1/3 1
  2/5 2
  1/2 3
  3/5 4
  2/3 5
  3/4 6
  4/5 7
  5/6 8
  8/9 9
  9/10 10
  Auto 11
DSS 2/3
0

6/7
1

Auto
2

File version (File and File-loop sources)

TSReader {TSReader-options} {file}

file Optional. The name of the file containing the transport stream. If not provided, TSReader will prompt

The input transport stream file can contain either 188 or 204 byte transport stream packets. If TSReader generates a single program stream or PID recording is used, TSReader will always write 188 byte packets.

Linear Systems DVB/ATSC Master/Dektec ASI/SPI sources

TSReader {TSReader-options}

There are no parameters for these cards - the first card in the system is always used. The card receives in "Auto 204/188" mode where 204 byte packets sent to TSReader get stripped of their Reed-Solomon code resulting in 188 byte streams recorded by TSReader.

Multicast UDP/RTP sources

TSReader {TSReader-options} {ipaddr port {multicast-interface}}

ipaddr The IP address to listen to.
port The UDP port to listen on.
multicast-interface Optionally the IP address of the interface to listen on

For IGMPv3 join messages, specify the router address after the @ sign. For example, "224.0.0.2 1234@192.168.1.5" would send the IGMPv3 join message to 192.168.1.5 for stream 224.0.0.2 port 1234.

Unicast UDP/RTP sources

TSReader {TSReader-options} {port}

port The UDP port to listen on.

Alitronika ASI/SPI sources

TSReader {TSReader-options} {input}

input Selected input: 0 for DVB-ASI, 1 for DVB-SPI

Dish Network Legacy Switches

Some satellite cards support these switches in addition to DiSEqC port switching. Input ports are as follows:

7 SW21 Dish 1
8 SW21 Dish 2
9 SW42 Dish 1
10 SW42 Dish 2
11 SW44 Dish 2
12 SW64 Dish 1A
13 SW64 Dish 1B
14 SW64 Dish 2A
15 SW64 Dish 2B
16 SW64 Dish 3A
17 SW64 Dish 3B
18 Twin LNB 1
19 Twin LNB 2
20 Quad LNB 2