[Live-devel] Using MPEG4GenericRTPSink for AAC on client?

Ross Finlayson finlayson at live555.com
Tue Jul 17 22:40:49 PDT 2012


> I am attempting to receive and play AAC encoded audio from a webcam via RTSP. I have successfully done this for uLaw encoded audio using a custom MediaSink subclass class modeled heavily on the testRTSPClient.cpp example.
> 
> How do I do this for AAC encoded audio? Apparently it's not as simple as grabbing the AAC encoded data the same way I did for the uLaw encoded data in my afterGettingFrame callback.

It actually is.  Each chunk of data that's received by your "RTPSource" object (in this case, it will be a "MPEG4GenericRTPSource" object, but you shouldn't have to care about that, because it gets created automatically by the RTSP client code) should be a single (and complete) AAC audio frame.  You will then feed each such frame to your decoder.

The only tricky thing is that you (probably) will also need to pass 'configuration' data to your decoder, in order for it to be able to successfully decode the stream.  This configuration data is derived from the stream's 'configuration string', which you (the client) can access by calling "MediaSubsession::fmtp_config()".  You will probably then need to decode this string into binary form by calling "parseGeneralConfigStr()" on it.  The resulting binary data will probably need to be input to your decoder.


> In my digging around it would appear that I may need to use the MPEG4GenericRTPSink

No!  "RTPSink"s (and their subclasses) are used only for *transmitting* RTP packets, not for receiving them.


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/20120717/117da4fe/attachment.html>


More information about the live-devel mailing list