[linux-dvb] How to convert MPEG-TS to MPEG-PS on the fly?

Josef Wolf jw at raven.inka.de
Mon Aug 25 21:02:41 CEST 2008

On Fri, Aug 22, 2008 at 04:44:56PM +0100, Nick Ludlam wrote:
> On 22 Aug 2008, at 15:44, Josef Wolf wrote:
>>On Fri, Aug 22, 2008 at 11:07:47AM +1000, Kevin Sheehan wrote:
>>>Barry was right on the money with the ts2ps suggestion below.  It's  
>>>part of the libdvb package.  You don't have to use the dvb-mpegtools  
>>>app, you can just use the lib in yours - no pipes, etc.

I have now changed my application to create exactly what ts2ps creates.
Now I notice that neither mplayer nor vlc play the stream created by

Vlc gives tons of error messages like this:

  [00000365] main video output warning: vout warning: early picture skipped (47722279483)
  [00000359] main audio output warning: received buffer in the future (47722179597)

no audio and black video :-(

If I remove the PS pack header and the PS system header (stream-id 0xba
and 0xbb) then both play the stream, but no STB plays it :-(

Next, I tried:

> The command I wrapped in a popen call from a script was:
> 	/opt/local/bin/replex -o /dev/stdout -i TS -v %s -a %s -t MPEG2 
> 	/dev/ stdin

With this command, I get hopping video with VLC.

It seems to be a mess.  None of the programs seem to produce proper
streams.  Only mencoder seems to generate a proper stream.  But AFAICS,
mencoder completely decodes the stream and re-encodes it again, eating
up all the CPU.

Any more ideas how to do the conversion?

BTW: Can anybody recommend a good book on the topic?

More information about the linux-dvb mailing list