[Live-devel] using testMPEG2ProgramStreamToTransportStream for streaming mpeg2 PS files

Ross Finlayson finlayson at live555.com
Mon Aug 13 07:30:15 PDT 2007


>I want to stream mpeg2 Program Stream files  by converting in a
>transport stream in run time
>I have tried to use "testMPEG1or2ProgramToTransportStream".
>I have replaced "FileSink"  with "MPEG2TransportStreamFramer" filter +
>"BasicUDPSink".
>It works, but a sometimes picture began to shake and it's possible to
>see cubes.
>In what there can be a problem?

The problem may be that your outgoing UDP packets each contain only 
one (188-byte) Transport Stream packet.  This is legal, but some 
clients might not be handle many very small UDP packets, rather than 
a smaller number of larger UDP packets.

You can fix this by accumulating several 188-byte Transport Stream 
packets into each outgoing UDP packet.  People usually pack 7 
Transport Stream packets into each UDP packet (because 7*188 < 1500 
bytes, which is less than the MTU of most networks).

I suggest reusing the code for the "MPEG2TransportStreamAccumulator" 
class; this code is bundled with the "wis-streamer" source code - see 
<http://www.live555.com/wis-streamer/>.  Insert an object of this 
class between your "MPEG2TransportStreamFramer" and your 
"BasicUDPSink", and you will get larger outgoing UDP packets.
-- 

Ross Finlayson
Live Networks, Inc.
http://www.live555.com/


More information about the live-devel mailing list