Click here to Skip to main content
15,881,600 members
Articles / Programming Languages / C#
Article

Transport Stream Analyzer for HDTV standard

Rate me:
Please Sign up or sign in to vote.
4.87/5 (39 votes)
7 May 20042 min read 200.1K   12.2K   72   17
A program that analyzes a transport stream.

Intro

This program deals with Transport Stream files. Basically, Transport Stream means one or more streams (usually, MPEG-2 files) multiplexed into a single stream. That's what the HDTV is using (the digital television).

The concept:

A Transport Stream consists of fixed length packets. There can be more sizes but the standard one is 188 bytes. A packet can contain info from a Program Stream, can be a null packet, a Program Association Table or a Conditional Access Table. The PID is the field deciding the packet.

Mainly, the TS packets transport data from Program Streams at a fixed bit rate which must be greater than the sum of Program Streams bit rate. For example, if a standard MPEG-2 is encoded at a few Mbits per second, the Transport Stream usually has bigger bit rate values.

To better understand the composition of a Transport Stream, take a look at the picture below:

Sample screenshot

The program:

TS_Analyzer reads each packet from the input stream and analyzed it. You can view the packets as a graphical display of fields, or use the "write to file" option to list individual packets info or statistics.

I know that a Transport Stream is not so easy to find as a MPEG-2 file, so I've included a sample at the downloads section above. If you'll play this sample with Media Player, you'll hear about 1s of sound, and if you have the appropriate codec, you'll also see an image. It's a small part (4000 packs) of a larger transport stream (about 400,000 packs) but can give you an idea about the concept. Another player you can use is DVD2AVI.

If you would like to try a real transport stream, download mp2tsmpdex.exe from here. This is a Transport Stream Demo producer that will give you a 10s transport stream that can be analyzed by my program.

To use the program, just read the readme file included.

Main window:

Sample screenshot

This is how the program looks when you start it.

Browse window:

Sample screenshot

This is the browse window used to change the current directory.

Analyzer window:

Sample screenshot

That's how the analyzer window looks.

Output text file "tsinfo.txt":

That's what you'll see in the output text file after processing a Transport Stream:

Sample screenshot

Output text file "ts_stats.txt":

These are statistics about your input Transport Stream:

Sample screenshot

Author notes:

I don't really know of how much interest this subject really is. It's not a very known one and might not be the thing you're looking for. Still, the HDTV standard uses it and some VPN networks also. It's fun to see how digital TV signal is formed, and surely this is not an obsolete subject.

For impressions regarding this program or discussions related to this subject, feel free to contact me by e-mail (ro_angel_bv@hotmail.com or ro_angel_bv@fastmail.fm).

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Malaysia Malaysia
Dumitru Bogdan - alias Angel

Born 1980 , Brasov , Romania

Final year student at Transilvania University of Brasov , Faculty of Electrical Engineering & Computer Science , Department of Electronics & Computers

Programming : Visual C++ , Visual Fox Pro , Assembler & later , C#

Motto : "Nothing Last Forever" , and software is no exception

Comments and Discussions

 
Praisevery good article Pin
csmanul23-Nov-15 7:45
csmanul23-Nov-15 7:45 
QuestionMpeg Containers Pin
jfriedman13-Dec-14 2:42
jfriedman13-Dec-14 2:42 
Generalths Pin
chyk_11926-Nov-09 15:10
chyk_11926-Nov-09 15:10 
QuestionHow to Create Transport Stream file Pin
anujverm00014-Jul-09 0:36
anujverm00014-Jul-09 0:36 
QuestionHow to get frame type Pin
Sudhanshu Gupta23-Dec-08 19:29
Sudhanshu Gupta23-Dec-08 19:29 
GeneralBit rate information Pin
vishwamysTEL25-Oct-07 22:39
vishwamysTEL25-Oct-07 22:39 
GeneralRe: Bit rate information Pin
Trollslayer24-Aug-08 0:01
mentorTrollslayer24-Aug-08 0:01 
GeneralI wanna analise the TS Pin
laxmiprashanth19-Jul-07 21:02
laxmiprashanth19-Jul-07 21:02 
GeneralMacro-Block DCT Coefficients of MPEG-2 TS Pin
Andy Rama14-May-07 23:18
Andy Rama14-May-07 23:18 
Generalgreat Pin
mars_mars14-Nov-06 15:45
mars_mars14-Nov-06 15:45 
GeneralThanks! Pin
Radha Krishna. S.27-Feb-06 20:43
Radha Krishna. S.27-Feb-06 20:43 
GeneralBitrate Pin
david_I14-Dec-05 22:47
david_I14-Dec-05 22:47 
GeneralI found a bug in your program Pin
matt ting1-Dec-05 12:47
matt ting1-Dec-05 12:47 
Generalnewbi Pin
Anonymous23-Jun-05 8:54
Anonymous23-Jun-05 8:54 
QuestionHow to playback the Transport Stream file? Pin
xiyuxi300013-Apr-05 6:30
xiyuxi300013-Apr-05 6:30 
AnswerRe: How to playback the Transport Stream file? Pin
Anonymous17-Apr-05 6:23
Anonymous17-Apr-05 6:23 
GeneralD-VHS VCR Emulation Pin
tomdoyle28-Jun-04 5:12
tomdoyle28-Jun-04 5:12 
One interesting and useful applicaton for HDTV transport streams is a D-VHS VCR emulator to run under windows XP. If you are not familiar with D-VHS VCR's like the JVC HM-DH40000U here is a short run down on their operation. The D-VHS VCR can connect to a HDTV set top box like the Samsung SIR-T165 with a firewire connection. The HDTV set top box is able to control the VCR using firewire. It is possible to power up/down the VCR as well as control play, pause, fast forward, fast reverse and record functions from the set top box remote. A useful application would be a program that connects to a HDTV set top box via firewire and emulates a D-VHS VCR. The emulator would simply record the transport stream to the HDD for recording and play back the transport stream file from the HDD for playback.

tom ...

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.