What's new:

OK, looking at some of the articles on this site and because of the overall favorable feedback I've received on this program, I've decided to update this article. The program is the same, only the article is improved. So, here it goes, the improved version:

The concept:

This program is about multiplexing more Elementary Streams (usually MPEG 2 files) into a Transport Stream. That's the idea behind HDTV (High Definition TV or Digital TV) standard. That's how your digital TV signal is formed (of course, if you have one). The standard stream chosen for HDTV is MPEG 2, because it has many advantages regarding video & audio streams and formats. A MPEG 2 file (also called Program Stream) contains VIDEO, AUDIO and ancillary data organized in PES (Packetized Elementary Stream) packets.

If you want to know more about PES packets, I suggest reading the ISO 138181 documentation (sadly, ANSI has it on sale for 560$ !!!)

The problem resides in multiplexing PES packets into a Transport Stream (TS) and sending this stream over the network at a preferably fixed bit rate. A TS packet is of fixed length - 188 bytes, no matter the type of carried data (audio or video), and one TS packet can carry data from only one PES packet.

So, let's review: you multiplex multiple movie files into a stream that you send over the network. The clients in that network receive your stream and decode it (each client wants only one movie from the stream). Then, the client application plays the stream, and if your Transport Stream isn't adequate, the client might receive a too small amount of data - then you'll see glitches in the player, or, on the opposite, the amount of data received might be excessive and at the client player, frames are discarded.

This program:

Don't think for a moment that this program resolves the issue of HDTV communication. It's just a speedometer, very useful to understand the concept and still functioning as a benchmark. As a note, there are some companies in the Internet offering such a multiplexing software, more or less performing, but if you'll take a look at their software license price, you'll easily understand why nobody will share their sources of such a program on a free basis.

This sample program has the following features:

Lets you choose how many ES (Elementary Stream) files you want to generate

Lets you chose how the TS stream will be created (to a file or to "Emulated Network")

Generates the multiplexing stream you can read to identify individual TS packets and their content

Constructs a diagram for buffer efficiency after each multiplexing process

Main window (at start point):

That's how the program looks when started.

Main window (after multiplexing):

That's how the program looks after a completed multiplexing process.

TS settings window:

Here you can specify PES HEADER & PES PACKET LENGTH to see how the multiplexer does with different values.

About window:

This is a window containing some about info, specifications and a calendar.

Diagram window:

That's the scalable diagram you can view after completing a multiplexing process.

Legend window:

This window is useful if you wish to understand how the output TS stream is formed.

Author notes:

This sample program demonstrates that C# is adequate to write that sort of HDTV multiplexing application. I've heard some voices saying that only C++ and Assembler are suited to reach the desired multiplexing speed (usually around 27 MBit/s) and I wrote this program to demonstrate they are wrong. Anyway, my view is that this program is interesting because of the subject it approaches.

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.

Thanks for the info,I didn't know that.
I've seen the ANSI page and using a search engine I found a russian site ofering that standard for download (free). It's a little "ripped" but ANSI pretentions are exagerated in my opinion.
Thanks again for the tip.

Even without joining somewhere you can download ISO/IEC 13818-1 to -3 (among others). On WOTSIT (file format information on hundreds of different file types) search for MPEG. The result contains links to zipped MS-Word files:

Nice piece of work you have here.I don't understand why this article is so low rated ? Was it such a mess before you update it ?
Anyway,I'm interested in this subject and I'd like to learn more...I saw your two articles and I have the impression that clearly you don't have the skill of a 17 year old ( LOL )

I guess it was your High School disploma the one you obtained using the sample application since the horrible UI of the application, the quality of the article --can it be called an article?--and the lack of source code seems to indicate that the whole thing comes from a 17 years old kid taking his first shots at writing and coding.

You're close with the age,but not quite.
The thing that make me upload the code was that in all my reserch through the Internet I haven't found much info on this topic...and,as some of the feedback I received sugest,there are others interested on this subject as well.
To answer your ironical post,I did't wrote this program to be sharp looking or to get credit for it,just to serve a research purpose(speed & buffer load).I'll upload the code also,just to make some of you feel better and less ironical.
I think the ideea behind the program matters in this case,not the interface,wich,designing the program in 3 days,I didn't make it to your standards it seems.
And by the way, this indeed my first shot at C#...

I have to assume the best of everyone, so I assume you really did write that. However I could just as easily upload some third party exe and call it mine. Upload the code, and share you obvious knowledge on this topic with the rest of us. This looks extremely interesting, but hardly anything to study from clicking around an exe.

ro_angel_bv,
I would guess that the reason this article was rated so low, is because you did not provide the sourcecode or a discussion of the sourcecode. We can't email you and ask for you to send SourceCode as you did not provide an email address.
I'd love to see the sourcecode myself. Can you please put it up on Code Project?
Additionally, I'd enjoy reading a discussion/article from you about your code and Transport Stream Construction.