<HTML><HEAD></HEAD>
<BODY dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt">
<DIV>Hi Ross, </DIV>
<DIV> </DIV>
<DIV>Been using Live555 for Video streaming on multiple platforms, used on
Linux, iOS and now ported to WinCE7. Video streaming works like a charm.</DIV>
<DIV>Now I want to add the audio stream in the media session. As a test I want
stream a mp3 file with video stream (H.264 video data generated by a encoder
source). </DIV>
<DIV>I am assuming to use MP3AudioFileServerMediaSubsession as audio subsession
and add it to ServerMediaSession.</DIV>
<DIV>Below is my code:</DIV>
<DIV> const Port rtpPort(rtpPortNum);</DIV>
<DIV> const Port rtcpPort(rtcpPortNum);</DIV>
<DIV> </DIV>
<DIV> Groupsock rtpGroupsock(*env, destinationAddress, rtpPort,
ttl);</DIV>
<DIV> rtpGroupsock.multicastSendOnly(); // we're a SSM source</DIV>
<DIV> Groupsock rtcpGroupsock(*env, destinationAddress, rtcpPort,
ttl);</DIV>
<DIV> rtcpGroupsock.multicastSendOnly(); // we're a SSM source</DIV>
<DIV> </DIV>
<DIV> // Create a 'H264 Video RTP' sink from the RTP 'groupsock':</DIV>
<DIV> OutPacketBuffer::maxSize = 500000;</DIV>
<DIV> videoSink = H264VideoRTPSink::createNew(*env, &rtpGroupsock,
96);</DIV>
<DIV> </DIV>
<DIV> // Create (and start) a 'RTCP instance' for this RTP sink:</DIV>
<DIV> const unsigned estimatedSessionBandwidth = 500; // in kbps; for RTCP
b/w share</DIV>
<DIV> const unsigned maxCNAMElen = 100;</DIV>
<DIV> unsigned char CNAME[maxCNAMElen+1];</DIV>
<DIV> gethostname((char*)CNAME, maxCNAMElen);</DIV>
<DIV> CNAME[maxCNAMElen] = '\0'; // just in case</DIV>
<DIV> RTCPInstance* rtcp</DIV>
<DIV> = RTCPInstance::createNew(*env, &rtcpGroupsock,</DIV>
<DIV>
estimatedSessionBandwidth, CNAME,</DIV>
<DIV>
videoSink, NULL /* we're a server */,</DIV>
<DIV>
True /* we're a SSM source */);</DIV>
<DIV> // Note: This starts RTCP running automatically</DIV>
<DIV> </DIV>
<DIV> RTSPServer* rtspServer = RTSPServer::createNew(*env, 8554);</DIV>
<DIV> if (rtspServer == NULL) {</DIV>
<DIV> *env << "Failed to create RTSP server: " <<
env->getResultMsg() << "\n";</DIV>
<DIV> exit(1);</DIV>
<DIV> }</DIV>
<DIV> ServerMediaSession* sms</DIV>
<DIV> = ServerMediaSession::createNew(*env, "testStream",
inputFileName,</DIV>
<DIV> "Session
streamed by \"testH264VideoStreamer\"",</DIV>
<DIV>
True /*SSM*/);</DIV>
<DIV> </DIV>
<DIV> ServerMediaSubsession* VideoSession = NULL;</DIV>
<DIV> VideoSession = PassiveServerMediaSubsession::createNew(*videoSink,
rtcp);</DIV>
<DIV> sms->addSubsession(VideoSession);</DIV>
<DIV> </DIV>
<DIV> //rtspServer->addServerMediaSession(sms);</DIV>
<DIV> </DIV>
<DIV> ServerMediaSubsession* AudioSession = NULL;</DIV>
<DIV> </DIV>
<DIV> AudioSession = MP3AudioFileServerMediaSubsession</DIV>
<DIV>
::createNew(*env, inputaudioFileName, reuseFirstSource,</DIV>
<DIV>
true, NULL);</DIV>
<DIV> sms->addSubsession(AudioSession);</DIV>
<DIV> </DIV>
<DIV> rtspServer->addServerMediaSession(sms);</DIV>
<DIV> </DIV>
<DIV> char* url = rtspServer->rtspURL(sms);</DIV>
<DIV> </DIV>
<DIV>Please let me know whether this is the correct method of adding audio
stream with video. I don’t have a audio codec source, hence want to test with
MP3 file only.</DIV>
<DIV> </DIV>
<DIV>Thanks in advance.</DIV></DIV></DIV></BODY></HTML>