[Live-devel] MPEG2 raw-UDP streaming

Ross Finlayson finlayson at live.com
Wed Apr 6 14:42:05 PDT 2005


>I have MPEG2 audio and video encoder which deliver discrete mpeg2 video 
>frames and mpeg layer II audio frames. I nees to streams this to a set-top 
>box like device by raw UDP and RTSP. I looked at testOnDemandRTSPServer 
>example, but it streams from file. How is it possible to set up RTSP 
>server for live source?

First, if your 'live source' is accessible as a file (e.g., in /dev), then 
you can probably use the existing "testOnDemandRTSPServer" code to stream 
it.  (Just rename "test.ts" to the name of your input device.)

If, however, your 'live source' is *not* accessible as a file (e.g., 
because you're running some brain-damaged OS like Windows), then you will 
need to write a new "ServerMediaSession" class that gets its input from 
your live source, rather than from a file.  In particular, you will need to 
write a new subclass of "OnDemandServerMediaSubsession" that defines the 
two virtual functions
         createNewStreamSource()
and
         createNewRTPSink()

"createNewStreamSource()" will be similar to the version that was 
implemented for "MPEG2TransportFileServerMediaSubsession", except that it 
will read from your live input source instead of from a "ByteStreamFileSource".

"createNewRTPSink()" can be *identical* to the version that was implemented 
for "MPEG2TransportFileServerMediaSubsession".  (If you are streaming raw 
UDP rather than RTP, then this function won't actually get called, but it 
needs to be defined.)


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



More information about the live-devel mailing list