TSReader Command-Line Interface
Updated February 9, 2004

Note: This section applies only to the registered version of TSReader - 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. The parameters are:

TSReader parameters

Summary

Switch Parameters Function
-1 (figure one) none Force TSReader to run in uniprocessor mode on a multiprocessor machine.
-a service file length Record All single file
-A splitsize service file length Record All split files
-c port TSReader control server enable
-C receiver-type serial-port Receiver serial control enable
-d none Disable stream parsing
-D none Force DVB mode
-H filename HTML export
-i none Force single TSReader instance
-I outfile duration options "PID PID PID" Record PIDs
-l none Force low-res mode
-m filename Load manual channels
-M none Launch TSReader minimized
-p none Force Program Stream format for command-line recordings
-P position delay Sends a DiSEqC motor command then delays
-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
-v service VLC-configuration Auto stream to VLC
-V service VLC-configuration seconds Auto stream to VLC time limited
-x filename Automatic XML export
-X filename Automatic XMLTV export

Running uniprocessor mode

We have seen instances where either hardware drivers or MD-Plugins don't perform correctly when run on multiprocessor machines (including HyperThreading Intel 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 DVB Mode

Some muxes contain both ATSC and DVB tables - the ATSC tables might be used with a remultiplexer to feed a digital TV transmitter for example. Using the -D switch forces TSReader into DVB mode (by ignoring ATSC PSIP on PID 0x1ffb) should you wish to look at the DVB tables. There's no option needed for ATSC mode - the rate of the ATSC PSIP is high enough to ensure ATSC mode on these mixed muxes.

-D (no additional parameters)

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.

Force Low-Res mode

TSReader is designed for at least an 800x600 display but works much better with a 1024x768 or higher resolution monitor. If you're using 1024x768 and having a hard time seeing the entire window use this switch. Note that this switch is a lower-case L and not a figure one.

-l (no additional parameters)

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.

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

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

SCTE 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 card (DVB-S/Turbo/DCII)

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
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
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

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 source

TSReader {TSReader-options} {ipaddr port}

ipaddr The IP address to listen to.
port The UDP port to listen on.

Dish Network Legacy Switches

Some satellite cards support these switches. 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