[Live-devel] RTSP client on STB.

Ross Finlayson finlayson at live555.com
Thu Mar 10 06:58:55 PST 2011


>-Using one PC with VLC as an RTSP server, I have managed to open and 
>play an RTSP H264 video stream on another PC.
>-Using one PC with VLC as an RTSP server, I have managed to issue 
>the sendOptionsCmd() and describeURL() commands from the STB. I have 
>also successfully read the replies from the server and everything 
>seems correct.
>
>Now I need access to the H264 stream sent via RTP. I then need to 
>pass this stream (after stripping off the RTP header) to a decoder 
>on the STB. How do I do this?

Look at the "openRTSP" code (in "testProgs/playCommon.cpp" and 
"testProgs/openRTSP.cpp") as a model.

First, you should really be using the asynchronous "RTSPClient" 
interface, rather than the old, deprecated synchronous interface. 
I.e., you should really be calling "sendOptionsCommand()" (not 
"sendOptionsCmd()") and "sendDescribeCommand()" (not "describeURL()").

Then, after you have a SDP description (from calling 
"sendDescribeCommand()"), you use this to create a "MediaSession" 
object, then iterate through its subsessions, calling 
"MediaSubsession::initiate()" on each.  (This creates the 
"*RTPSource" objects that will receive network data.)

You then send the RTSP "SETUP" and "PLAY" commands, by calling 
"sendSetupCommand()" and "sendPlayCommand()".

Now you're ready to start receiving data.  You do this by
1/ Creating a 'sink' object (a subclass of "MediaSink") that will 
receive and process the data.  (Unless you simply want to write the 
data into a file, this is something that you would write yourself.) 
Then,
2/ Call
	yourSinkObject->startPlaying(*(subsession->readSource()), ...);
    to begin the flow of data within your application.  (Once again, I 
suggest using the "openRTSP" code as a model.)

Note, by the way, that you should *not* access the "Groupsock" 
objects directly.  (They objects are used behind the scenes.)
-- 

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


More information about the live-devel mailing list