[Live-devel] Streaming an MPEG2 Transport Stream

Ross Finlayson finlayson at live.com
Wed Jan 14 14:40:34 PST 2004


At 02:25 PM 1/14/04, you wrote:
>I have files that are MPEG2 TS files that I'd like to stream as opposed to 
>the PS or ES files that are supported by the live streamer.
>
>I was just playing around with the code and created a MPEG2TS subsession 
>class so that I can add it to a on demand server.  I took a byte file 
>source and routed it to a simpleRTPSink.   Seems to work ok, except that 
>the data is streamed WAY to fast.

Jeff,

This is happening because the "fDurationInMicroseconds" field (i.e., the 
frame duration) is not being set properly in the "doGetNextFrame()" member 
function.  Because of this, the default duration of 0 is being used, which 
causes the RTP streaming module ("MultiFramedRTPSink") to not delay at all 
after sending each outgoing RTP packet.

To fix this, make sure that you set the "preferredFrameSize" and 
"playTimePerFrame" parameters in
         ByteStreamFileSource::createNew()
(See "liveMedia/include/ByteStreamFileSource.hh".)

These parameter tell the "ByteStreamFileSource" implementation (i) how 
large a chunk of data to treat as being a 'frame', and (ii) the average 
duration (in microseconds) of this chunk.


	Ross Finlayson
	LIVE.COM
	<http://www.live.com/>



More information about the live-devel mailing list