TSDuck - MPEG Transport Stream Toolkit

TSDuck - MPEG Transport Stream Toolkit

TSDuck is an extensible toolkit for MPEG/DVB transport streams. TSDuck is used in digital television systems for test, monitoring, integration, debug, lab, demo.
This toolkit contains many variables, here we will currently focus on HLS streams re-direction to local Multicast UDP using the TSP tool

TSP, the transport stream processor

Usage: TSP <options> -I <input type> <source> -P <processing type> -O <output type> <target>

You can get detailed help on each module used:
tsp {-I|-O|-P} name –-help

Input Type:
  1. file : binary TS file
  2. hls : HTTP Live Streaming (m3u8)
  3. srt: Secure Reliable Transport
  4. dektec : Dektec ASI device
  5. dvb : DVB-S, DVB-T, DVB-C receiver devices
  6. ip : UDP/IP (unicast or multicast)
Processing Type:
There are over 50 types of Processing tools available for usage, in this example i'll be using the regular for the purpose of realtime re-streaming of source

Output Type:
  1. drop : drop packets
  2. file : binary TS file
  3. hls : HTTP Live Streaming (m3u8)
  4. dektec : Dektec ASI or modulator device
  5. ip : UDP/IP (unicast or multicast)
  6. play : render output using VLC, mplayer, xine, whichever is available
FILE input

Example: "C:\Program Files\TSDuck\bin\tsp" -I file <TS_file.ts> --infinite/repeat <number> -P regulate --pcr-synchronous -O ip 127.0.0.1:1000

In this example, we'll be using a local TS file as input and streaming it locally as a Unicast UDP
We can use the --infinite to create an endless loop of the input, or use --repeat <number> to loop a specific amount of times
Also here using -P regulate --pcr-synchronous to make sure the output will play as Realtime

HLS Input

Example: "C:\Program Files\TSDuck\bin\tsp" -I hls --live https://mnmedias.api.telequebec.tv/m3u8/29880.m3u8 -P regulate --pcr-synchronous -O IP 234.250.1.6:6000

In this example i'm using HLS input type and providing the URL source, and i've added option --live to indicate the source is a Live Stream.
then using the regulate processing type to slow down the incoming feed so it will be fed into the output at realtime (otherwise it will be read as fast as saving it to a file)
Finally, using output to IP to generate a local Multicast UDP that can be used by VLC or Recorder

NOTE: Option "--live" is an Alias to "--start- segment -1" and changing the -1 to 0, 1, 2... will allow you to start the streaming not from the first chunk.

SRT Input

Example: "C:\Program Files\TSDuck\bin\tsp" -I SRT --caller IP:port -P regulate --pcr-synchronous -O ip -l <local IP address> 234.250.1.6:6000

In this example i'm using SRT input type and providing the URL source, and i've added option --caller to indicate TSP calls the source feed.
then using the regulate processing type to slow down the incoming feed so it will be fed into the output at realtime (otherwise it will be read as fast as saving it to a file)
Finally, using output to IP to generate a local Multicast UDP that can be used by VLC or Recorder

DEKTEC Input

Example: "C:\Program Files\TSDuck\bin\tsp" -I dektec -c <port> -P regulate --pcr-synchronous -O ip -l <local IP address> 234.250.1.6:6000

In this example, we're using a DekTec ASI as the source for input and streaming it locally as a Multicast UDP to a specific local network address
To find which <port> we can use for the dektec source, we must first run the following command:

Example: "C:\Program Files\TSDuck\bin\tsdektec" -a -v

This command will list all DekTec cards available in the system and the inputs that can be used.
Then we output to IP and using the -l <local IP address> we will send the broadcasting to a specific network card to avoid overloading the network

ATSC/DVB Input

Example: "C:\Program Files\TSDuck\bin\tsp -I dvb --adapter 0 --frequency 206000000 -P regulate --pcr-synchronous -O ip -l <local IP address> 234.250.1.6:6000

In this example, we're using Hauppauge WinTV as the source input (or any other DVB/ATSC compatible adapter) and streaming it locally as a Multicast UDP similar to the DekTec ASI option. However, this requires additional setting of frequency as seen in the example above.

FILE Output

Example: "C:\Program Files\TSDuck\bin\tsp" -I hls --live https://weather-lh.akamaihd.net/i/twc_1@92006/index_2400_av-b.m3u8 -O file WeatherChannel.ts

In this example, we are taking an HLS source and creating a local identical copy by dumping all contents into a TS file.
For this we are using the -O file <filename.ts> to specify we are using the file output plugin and then the target filename to be saved
    • Related Articles

    • HLS to Local UDP using FFMpeg

      This is how to use FFMPEG to take an HLS (or any Network Source) and "re-direct" it as a local standard UDP for the Recorder: ffmpeg -reconnect 1 -reconnect_at_eof 1 -reconnect_streamed 1 -reconnect_delay_max 2 -i ...
    • ActTS - Automatic Uploading of EPG/Guide

      Step 1: SystemConfig - Creating the TS Go to the C:\Actus\Bin folder and run the SystemConfig tool If your system has an active license of Transport Stream, then you will have that section appearing in the left panel SystemConfig - TS ...
    • DekTec - DVB Configuration

      1) In order to configure a DekTec DVB type card, we must first install the DtInfo tool and open it, first screen will look similar to this: 2) From this screen we can take important information that will be used for the configuration (eg: Bus and ...
    • HLS Streams for Testing

      NEW Streaming - Tested January 2, 2023 Perfect Test Channel: http://www.nacentapps.com/m3u8/index.m3u8 http://srv6.zoeweb.tv:1935/z330-live/stream/playlist.m3u8 http://sample.vodobox.net/skate_phantom_flex_4k/skate_phantom_flex_4k.m3u8 SD ...
    • ActTS - Channel Configuration

      ActTS tool allows the system to Capture Transport Stream (.ts) sources directly without encoding involved, preserving all the source quality and information. In order to do this, we need to edit two configuration files: ActControl.cfg - This will ...