[Live-devel] Parsing frames received by testRTSPClient
Ross Finlayson
finlayson at live555.com
Mon Jan 28 13:51:56 PST 2013
> I want two know if testRTSPClient allows me to specify codec type and if it can give me single encoded frame every time afterGettingFrame() is invoked?
Yes. 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 wanted to decode 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.
Because 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/20130128/072cf6bf/attachment.html>
More information about the live-devel
mailing list