I am trying to add optional unicast support to my stream server which currently runs great using multicast. I have implemented a custom DeviceFrameSource class extending FramedSource to control my MPEG4 encoder hardware. This is working great using multicast.<br>
To get it to run using unicast I based the code on wis-streamer and created a custom MediaSubSession class extending OnDemandServerMediaSubsession.<br><br>When a client connects it gets fairly far, parses the DESCRIBE, creates the stream source and rtpsink, connects to the encoder and gets two frames to create SDP, sends back the SDP, gets a SETUP command and creates the stream source again and the RTPSink/MPEG4ESVideoRTPSink, sends the response to SETUP, and finally receives the play command.<br>
The debug trace is below.<br>But when trying to get the first frame after receiving the PLAY command, it always seg faults. Some debug trace shows that it executes the GetNextFrame in FramedSource which calls doGetNextFrame on MPEG4DiscreteFramer, which calls getNextFrame on FramedSource again, where is fails.<br>
<br>It basically does the same thing it does when getting the frames for the SDP call, but this time it fails. <br>I thought it might be a problem with how I am passing the pointer to DeviceFrameSource class or something wrong with that class altogether, but it works while getting the SDP frames and when using multicast.<br>
<br>The specific point of seg fault is at the call of doGetNextFrame() from within FramedSource::getNextFrame called from MPEG4VideoStreanDiscreteFramer::doGetNextFrame.<br><br>Any insight would be greatly appreciated.<br>
Thanks,<br>-mat<br><br>Play this stream using the URL "rtsp://<a href="http://18.85.45.113:8554/videoStream">18.85.45.113:8554/videoStream</a>"<br>Created On Demand Server...<br>accept()ed connection from 18.85.45.34<br>
RTSPClientSession[0xd2720]::incomingRequestHandler1() read 134 bytes:OPTIONS rtsp://<a href="http://18.85.45.113:8554/videoStream">18.85.45.113:8554/videoStream</a> RTSP/1.0<br>CSeq: 1<br>User-Agent: VLC media player (LIVE555 Streaming Media v2008.09.02)<br>
<br><br>parseRTSPRequestString() returned cmdName "OPTIONS", urlPreSuffix "", urlSuffix "videoStream"<br>sending response: RTSP/1.0 200 OK<br>CSeq: 1<br>Date: Thu, Jan 01 1970 21:40:38 GMT<br>
Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE<br><br>RTSPClientSession[0xd2720]::incomingRequestHandler1() read 160 bytes:DESCRIBE rtsp://<a href="http://18.85.45.113:8554/videoStream">18.85.45.113:8554/videoStream</a> RTSP/1.0<br>
CSeq: 2<br>Accept: application/sdp<br>User-Agent: VLC media player (LIVE555 Streaming Media v2008.09.02)<br><br><br>parseRTSPRequestString() returned cmdName "DESCRIBE", urlPreSuffix "", urlSuffix "videoStream"<br>
Creating New Stream Source...<br>Creating New RTP Sink Buffer Set...<br>Creating New MPEG4ESVideoRTPSInk<br>Created RTPSink...<br>Get AUX SDP Line...<br>MultiFramerRTPSink buildandsendpacket<br>MultiFramerRTPSink packframe<br>
MultiFramerRTPSink getNextFrame<br>FramedSource getnextframe<br>FramedSource doinggetnextframe<br>MPEG4DiscreteFramer doGetNextFrame<br>FramedSource getnextframe<br>FramedSource doinggetnextframe<br>Spinner Video Debug: About to call requestframe...<br>
DEVICE Request Frame<br>Spinner Video Debug: Got Frame at buffer 9<br>FramedSource donegetnextframe<br>FramedSource donegetnextframe<br>Checking for AUX SDP Line...<br>Spinner Video Debug: About to capture frame..<br>MultiFramerRTPSink buildandsendpacket<br>
MultiFramerRTPSink packframe<br>MultiFramerRTPSink buildandsendpacket<br>MultiFramerRTPSink packframe<br>MultiFramerRTPSink buildandsendpacket<br>MultiFramerRTPSink packframe<br>MultiFramerRTPSink getNextFrame<br>FramedSource getnextframe<br>
FramedSource doinggetnextframe<br>MPEG4DiscreteFramer doGetNextFrame<br>FramedSource getnextframe<br>FramedSource doinggetnextframe<br>Spinner Video Debug: About to call requestframe...<br>DEVICE Request Frame<br>Spinner Video Debug: Got Frame at buffer 9<br>
FramedSource donegetnextframe<br>FramedSource donegetnextframe<br>Checking for AUX SDP Line...<br>Got AUX SDP Line...<br>a=fmtp:96 profile-level-id=5;config=000001B005000001B509000001000000012000845D4C28B42190A31F<br>sending response: RTSP/1.0 200 OK<br>
CSeq: 2<br>Date: Thu, Jan 01 1970 21:40:38 GMT<br>Content-Base: rtsp://<a href="http://18.85.45.113:8554/videoStream/">18.85.45.113:8554/videoStream/</a><br>Content-Type: application/sdp<br>Content-Length: 491<br><br>v=0<br>
o=- 78015985469 1 IN IP4 18.85.45.113<br>s=Session streamed by "spinner_video_server"<br>i=spinner_video_session<br>t=0 0<br>a=tool:LIVE555 Streaming Media v2008.12.19<br>a=type:broadcast<br>a=control:*<br>a=range:npt=0-<br>
a=x-qt-text-nam:Session streamed by "spinner_video_server"<br>a=x-qt-text-inf:spinner_video_session<br>m=video 0 RTP/AVP 96<br>c=IN IP4 0.0.0.0<br>a=rtpmap:96 MP4V-ES/90000<br>a=fmtp:96 profile-level-id=5;config=000001B005000001B509000001000000012000845D4C28B42190A31F<br>
a=control:track1<br>RTSPClientSession[0xd2720]::incomingRequestHandler1() read 191 bytes:SETUP rtsp://<a href="http://18.85.45.113:8554/videoStream/track1">18.85.45.113:8554/videoStream/track1</a> RTSP/1.0<br>CSeq: 3<br>Transport: RTP/AVP;unicast;client_port=45844-45845<br>
User-Agent: VLC media player (LIVE555 Streaming Media v2008.09.02)<br><br><br>parseRTSPRequestString() returned cmdName "SETUP", urlPreSuffix "videoStream", urlSuffix "track1"<br>Handling Command Setup<br>
Creating New Stream Source...<br>Creating New RTP Sink Buffer Set...<br>Creating New MPEG4ESVideoRTPSInk<br>Created RTPSink...<br>sending response: RTSP/1.0 200 OK<br>CSeq: 3<br>Date: Thu, Jan 01 1970 21:40:38 GMT<br>Transport: RTP/AVP;unicast;destination=18.85.45.34;source=18.85.45.113;client_port=45844-45845;server_port=6970-6971<br>
Session: 1<br><br>RTSPClientSession[0xd2720]::incomingRequestHandler1() read 163 bytes:PLAY rtsp://<a href="http://18.85.45.113:8554/videoStream/">18.85.45.113:8554/videoStream/</a> RTSP/1.0<br>CSeq: 4<br>Session: 1<br>Range: npt=0.000-<br>
User-Agent: VLC media player (LIVE555 Streaming Media v2008.09.02)<br><br><br>parseRTSPRequestString() returned cmdName "PLAY", urlPreSuffix "videoStream", urlSuffix ""<br>Handling command within<br>
Handle command play<br>Doing required seeking<br>Start Streaming<br>Start Stream 0<br>startStream<br>startPlaying<br>MultiFramerRTPSink buildandsendpacket<br>MultiFramerRTPSink packframe<br>MultiFramerRTPSink getNextFrame<br>
FramedSource getnextframe<br>FramedSource doinggetnextframe<br>MPEG4DiscreteFramer doGetNextFrame<br>FramedSource getnextframe<br>FramedSource doinggetnextframe<br>Segmentation fault<br><br><br>Trace from VLC:<br>[00000421] live555 demux error: RTSP PLAY failed Failed to read response: Success<br>
[00000424] main access error: connection failed: Connection refused<br>[00000424] access_realrtsp access error: cannot connect to <a href="http://18.85.45.113:8554">18.85.45.113:8554</a><br>[00000420] main input error: open of `rtsp://<a href="http://18.85.45.113:8554/videoStream">18.85.45.113:8554/videoStream</a>' failed: could not create access<br>
<br>