View Full Version : About TS and why it's my favorite container
I see very little talk about transport stream containers on this forum. I wonder why. It is my favorite container because of the following:
Industry standard (ISO 13818-1)
Used by Satellite, Cable TV, Over-The-Air HDTV
Used by DVHS decks and AVC camcorders
Used by Blu-Ray
Used by VideoLAN. :)
Uses fixed sized packets and is easy to parse
It's relatively easy to play it back on a PC. For TS files containing MPEG2 video with AC3 or MPEG2 audio, you can use virtually any splitter/decoder package (Elecard, NVidia Pure Video Decoder etc.), but for TS streams that contain VC-1, AVC (H.264) video and/or advanced Audio (Dolby TrueHD, DTS-HD, etc) you will need either the Sonic filters, or my personal favorite Nero blu-ray/HD-DVD add on module. Nero will allow you to use the splitter and video decoder in any app, but to use the audio decoder the stream must be in source packet format (192 byte packets) and the app must be called "recode.exe" :) I'm sure sooner, or later other packages will follow.
I can find two disadvantages to ts:
1) it's meant to be used for streaming, so randomly seeking in it is not what it's good for (no index). This is more problematic with h264 video where GOPs can be quite big
2) it has a very large overhead, which means you sacrifice lots of space compared to other containers
It's great for streaming, not great for storing.
enantiomer
5th May 2007, 13:27
I can find two disadvantages to ts:
1) it's meant to be used for streaming, so randomly seeking in it is not what it's good for (no index). This is more problematic with h264 video where GOPs can be quite big
2) it has a very large overhead, which means you sacrifice lots of space compared to other containers
It's great for streaming, not great for storing.
1) The PCR works just fine for indexing.
2) With null packets, yes, there's wasted space. Without null packets, not really, at least no more than a standard MPEG2 PS.
1) The PCR works just fine for indexing. Huh? The PCR just defines the timebase. How can that be useful for random access?
If you misspoke and meant PTS, then again, I don't see your point. There is no index in a transport stream file, so given a desired frame number, how will you seek to it without some lengthy heuristic search? If you concede that such a search is required, then you've acknowledged KoD's point about seeking.
enantiomer
10th May 2007, 00:41
Huh? The PCR just defines the timebase. How can that be useful for random access?
If you misspoke and meant PTS, then again, I don't see your point. There is no index in a transport stream file, so given a desired frame number, how will you seek to it without some lengthy heuristic search? If you concede that such a search is required, then you've acknowledged KoD's point about seeking.
If by random access you mean seeking to a specific frame, then no, the TS container doesn't have an index for it. But what's wrong with using the PCR counter to seek forward by 30 seconds, or backward by 600 seconds? Isn't that good enough for "randomly accessing" a TS file for viewing? Think slider bars in MPC, not DGIndex. :)
Haali
10th May 2007, 02:39
This only works good for constant bitrate files, but then PCR is not needed anyay. For VBR you don't know the exact file position of the requested timestamp, you need to guess some initial value, then arrive at the desired frame using some iterative process. This is certainly possible, but without index seeking is noticeably slower.
As for PCR, it is not really needed/used for file playback. In TS A/V frames have individual timestamps, and those are used for proper A/V sync. PCR's main purpose is recovering exact encoder clock when playing live streams, with files the playback is driven by local clock (in PCs it's usually the one on the audio device).
Edit: the issue is further complicated because to decode the frame at requested time X, you actually need to start from the keyframe preceding X, and its position is unknown even in the CBR case.
check
10th May 2007, 04:45
Used by Satellite, Cable TV, Over-The-Air HDTV
Used by DVHS decks and AVC camcorders
Used by Blu-Ray
Why does the fact it is used by various commercial organisations count as an advantage?
dmz01
10th May 2007, 07:03
Why does the fact it is used by various commercial organisations count as an advantage?
Because that will be a forcing function to have plenty of (at least commercially avilable) editing programs.
honai
11th May 2007, 11:57
... leaving aside the issue that, in actual fact, the majority of commercial manufacturers out there are either unwilling or unable to adhere to said industry standard.
Or, at some later point in time, deliberately cripple and corrupt the standard. Exhibit A: "copy protection" on CD/DVD discs.
cipher
14th May 2007, 22:20
say you have a .ts file and would like to back it up for future references, what would be a good container to store the video/audio/sub streams, with proper index and less overhead just enough for local playback? mp4?
thanks!
check
15th May 2007, 03:07
I would suggest mp4 if the file has compatible streams, mkv otherwise.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.