<div dir="ltr">Hi Ross,<div>I want to serve a live RTP source serving MP2T tv channel through an RTSP server. To do it I have subclassed the OnDemandServerSubsession throug my MPEG2TransportUDPServerSubsession class where I have redefined the createNewStreamSource function as follow</div>
<div><br></div><div><div>FramedSource* MPEG2TransportUDPServerMediaSubsession</div><div>::createNewStreamSource(unsigned/* clientSessionId*/, unsigned& estBitrate){</div><div> estBitrate = 5000;</div><div> return MPEG2TransportStreamFramer::createNew(fEnv,fSource);</div>
<div>}</div></div><div><br></div><div>And I have redefined the createNewRTPSink exactly as done in the MPEG2TransportFileServerMediaSubsession class.</div><div><div><br></div><div>To test this implementation I have added a new bloc to the testOnDemandRTSPServer to serve this live stream like this :</div>
<div><br></div><div><div>{</div><div> char const* tvServiceName = "tv";</div><div> char const* inputAddressStr = "127.0.0.1";</div><div> struct in_addr inputAddress;</div><div> inputAddress.s_addr = our_inet_addr(inputAddressStr);</div>
<div> Port const inputPort(5004);</div><div> unsigned char const inputTTL = 0;</div><div> Groupsock inputRTPsock(*env, inputAddress, inputPort, inputTTL);</div><div> SimpleRTPSource* RTPSource = SimpleRTPSource::createNew(*env,&inputRTPsock, 33,</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>90000, "video/MP2T",</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>0, False);</div><div> ServerMediaSession* sms</div>
<div> = ServerMediaSession::createNew(*env, tvServiceName, tvServiceName,</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> descriptionString);</div><div> sms->addSubsession(MPEG2TransportUDPServerMediaSubsession::createNew(*env,</div>
<div> RTPSource,</div><div> True));// All clients share the same live source</div><div> rtspServer->addServerMediaSession(sms);</div><div> announceStream(rtspServer, sms,tvServiceName,tvServiceName);</div>
<div> </div><div> }</div></div><div><br></div><div><br></div><div><br></div><div>The RTP source is obtained like that</div><div>STB--http raw MP2T-->VLC----MP2T on RTP--->testOnDemandRTSPServer . The VLC and the testOnDemandRTSPServer are running on the same machine. The problem is that when I request the live stream from any client player I get a SEGMENTATION FAULT on the tesOnDemandRTSPServer. When I request the RTP stream with vlc without passing through the server (STB--http raw MP2T-->VLC----MP2T on RTP--->VLC client) I get the display without any problem.</div>
<div><br></div><div>Am I missing some thing ????</div><div><br></div><div>Thanks in advance </div>-- <br>Achraf Gazdar<br>Associate Professor on Computer Science<br>Hana Research Unit, CRISTAL Lab.<br><a href="http://www.hana-uma.org">http://www.hana-uma.org</a><br>
Tunisia<br>
</div></div>