[Live-devel] Proxying SIP live RTP to RTSP problem (segfault)

Ross Finlayson finlayson at live555.com
Sun Sep 24 12:57:15 PDT 2017


The key to understanding your problem is this line:

> "FramedSource[0x2493050]::getNextFrame(): attempting to read more than once at the same time!”

What’s happening (according to the stack trace) is that the “FramedSource” object that’s being fed into the “H264VideoStreamDiscreteFramer” object is being read from more than once at the same time.  In this case, this is the “MediaSubsession”s “readSource()”.

You’re problem is that you’re setting up a RTSP server to read from the incoming H.264 video stream (from SIP), but you’re still writing that same incoming H.264 video stream into a file.  Therefore, two different objects are trying to read from the same “FramedSource” object at the same time, which is a no no.

You have two solutions:
1/ Stop writing the video stream to a file.  The easiest way to do this is to run your (modified) “playSIP” application with the “-r” command-line flag.
2/ Duplicate the H.264 video stream - using the “StreamReplicator” class - before you feed it into your “H264VideoStreamDiscreteFramer” object (for the RTSP server), and into the “H264VideoFileSink” (for saving the data into a file).  This is rather complicated; you should look at the “testReplicator” demo application code for guidance.  Also, you would need to change the call to “startPlaying()” at line 948 of “playCommon.cpp” to take its input from one of the duplicates (the one that you’re not feeding into your RTSP server), rather than "subsession->readSource()”.


I should also point out, however, that there’s a much much easier way to feed the video output from “playSIP” into a RTSP server: Run them as separate applications, and pipe the H.264 video between them.  I.e., run (on the command line):
	playSIP -v etc | your-modified-testOnDemandRTSPServer
where "your-modified-testOnDemandRTSPServer” is a slightly modified version of the “testOnDemandRTSPServer” demo application that:
	1/ Sets “reuseFirstSource” to True (“testOnDemandRTSPServer.cpp”, line 29)
	2/ Changes “test.264” to “stdin” (“testOnDemandRTSPServer.cpp”, line 99)
	See also http://live555.com/liveMedia/faq.html#liveInput-unicast


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/




More information about the live-devel mailing list