[Live-devel] About AAC Streaming

Ross Finlayson finlayson at live555.com
Thu Jan 24 16:48:46 PST 2013


> Can you please provide some insight as to the frames generated by MPEG4GenericRTPSource so that we can have an idea of how to restream the AAC audio.

The frames are simply AAC audio frames, delivered one at a time.

However, to decode (or restream) these frames, you also need extra 'configuration' information.  This is carried 'out of band' in the stream's SDP description (that the client received in response to its initial RTSP "DESCRIBE" command).  You can get this information by calling the following functions on the stream's "MediaSubsession" object:
	MediaSubsession::fmtp_mode()
		This will return a string like "AAC-hbr" - describing which particular AAC 'mode' this audio stream is
	MediaSubsession::fmtp_config()
		This returns a string that contains 'configuration' information.  Depending upon your decoder, you can pass this string to your decoder 'as is', or you can translate it into binary form by calling our function "parseGeneralConfigStr()".  However, for restreaming the frames, the configuration information stays in string form (see below).

To restream these frames, you need to create a "MPEG4GenericRTPSink" object, as follows:

	RTPSink* audioRTPSink = MPEG4GenericRTPSink::createNew(envir(), rtpGroupsock, rtpPayloadType, mediaSubsession->rtpTimestampFrequency(),
								"audio", mediaSubsession->fmtp_mode(),
								mediaSubsession->fmtp_config(), mediaSubsession->numChannels());
and, as always, an associated "RTCPInstance" object (to implement RTCP).

You can then do the restreaming by calling "startPlaying()" on this "MPEG4GenericRTPSink", taking its input from "mediaSubsession->readSource()" - i.e.
	audioRTPSink->startPlaying(*(mediaSubsession->readSource()), <etc>);

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/20130124/2c704a34/attachment.html>


More information about the live-devel mailing list