[mythtvnz] mpeg2 TS demux, TS -> PS

Michael Dilger mike at mikedilger.com
Mon May 5 10:28:12 BST 2008


Our DVB-T cards dump MPEG TS streams.   Most MPEG2/4 software expects to 
deal with Program Streams (PS) not Transport Streams (TS).

I have tried to do TS to PS conversion using ts2ps (dvb-mpegtools), but 
it fails to work properly.   I have also tried using mencoder to just 
copy the streams (-oac copy -ovc copy) of identified PIDs (-aid $APID 
-vid $VPID) but it also fails to work properly.   Both of these tools 
work fine on most sources, but fail when they encounter the audio 
streams in NZ DTT (LATM HE-AAC).

So I forged ahead, studied the 174 page standard, and wrote a simple 
little tool to analyze an MPEG2 TS, synchronize, and collect stats on 
the 188-byte packets.   It is just a few steps away from being a 
demuxer, and then a few more steps from being able to translate a 
Transport Stream (TS) into a Program Stream (PS).

Since I did this for fun and have no immediate need for it, it's sitting 
idle and unfinished.   But if anyone is interested, let me know and I'll 
see if I can finish it.

-Mike




More information about the mythtvnz mailing list