[Live-devel] Streaming RTSP and pulling single frames
Ross Finlayson
finlayson at live555.com
Thu Feb 14 08:11:48 PST 2013
> I would like to is pull from a RTSP stream, and then pull individual frames (whole images) from it and be able to pass pointers around and use those frames from there. Seems like it should be simple but I'm going in circles.
>
> I see testRTSPClient & openRTSP and more or less see how they work & that they can save to a file
No, "testRTSPClient" does not save to a file. It receives each frame into a memory buffer, but does not do anything with the frame data. However, it is this code that you should use as a model for your own application.
In particular, look at the "DummySink" class that the "testRTSPClient" demo application uses. Note, in particular, the (non-static) "DummySink::afterGettingFrame()" function ("testRTSPClient.cpp", lines 479-500. Note that when this function is called, a complete 'frame' (for H.264, this will be a "NAL unit") will have already been delivered into "fReceiveBuffer". Note that our "DummySink" implementation doesn't actually do anything with this data; that's why it's called a 'dummy' sink.
If you want to decode (or otherwise process) these frames, you would replace "DummySink" with your own "MediaSink" subclass. It's "afterGettingFrame()" function would pass the data (at "fReceiveBuffer", of length "frameSize") to a decoder.
If you are receiving H.264 video data, there is one more thing that you have to do before you start feeding frames to your decoder. H.264 streams have out-of-band configuration information (SPS and PPS NAL units) that you may need to feed to the decoder to initialize it. To get this information, call "MediaSubsession::fmtp_spropparametersets()" (on the video 'subsession' object). This will give you a (ASCII) character string. You can then pass this to "parseSPropParameterSets()", to generate binary NAL units for your decoder.)
Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20130215/d5df5bd3/attachment-0001.html>
More information about the live-devel
mailing list