[Live-devel] testOnDemandRTSPServer multicast question

Tim J Shackleton live555 at timshackleton.com
Mon Dec 17 16:47:19 PST 2012


On 18/12/12 11:20, Ross Finlayson wrote:
> Unfortunately I wasn't able to reproduce your problem at all.  I ran 
> "testMPEG2TransportStreamer" to continuously stream a Transport Stream 
> file via multicast, and also ran "testOnDemandRTSPServer" to receive 
> this multicast stream, and use it as input for a unicast RTSP server. 
>  I then kept running
> openRTSP -d 5 -n <rtspURL>
> to repeatedly open and receive the stream for 5 seconds, then close 
> it.  Each time, "openRTSP" received data.
>
> So unfortunately you're going to have to track down yourself what is 
> going wrong.

Hi Ross,

Yes, I shall look into it more deeply.  In case it makes any difference, 
I'll describe the setup here for you.

Linux 64 bit, multicast source is RAW, not RTP, from an external machine 
(In this case a Cisco Digital Content Manager), SPTS at 3.7MBit/sec.

The only mechanical modifications to the testOnDemandRTSPServer that 
have been made are reuseFirstSource=True, inputStreamIsRawUDP=True, and 
the inputAddressStr and inputPortNum values.

When I run the testOnDemandRTSPServer, I, like you, am able to connect 
to it with openRTSP and it says it receives data. /That is not in 
dispute/.  I thought at first data was completely lacking but as I 
described in my previous email, that is not actually the case.

However, if I subsequently try and play from the RTSP server with VLC, 
it connects but cannot play because /insufficient data/ appears to be 
sent.  Are you able to play the transport stream via RTSP successfully 
with VLC after a few launches of openRTSP?

I have a hunch at this point that the TransportStreamFramer is not being 
reinitialized when a new client arrives (after all clients have left) 
and the packet playout rate is no longer correct - but like I said, it's 
only a hunch.

In order to make sure I'm on absolutely the right page, I rebuilt the 
latest source.  I have trimmed testOnDemandRTSPServer from your example 
(to cut out all other example instances other than the multicast source) 
and made only the modifications I mentioned above.  The same results are 
exhibited.  The source of the test program is as follows:


#include "liveMedia.hh"
#include "BasicUsageEnvironment.hh"

UsageEnvironment* env;
Boolean reuseFirstSource = True;
Boolean iFramesOnly = False;

static void announceStream(RTSPServer* rtspServer, ServerMediaSession* sms,
                            char const* streamName, char const* 
inputFileName); // fwd
int main(int argc, char** argv) {
   TaskScheduler* scheduler = BasicTaskScheduler::createNew();
   env = BasicUsageEnvironment::createNew(*scheduler);

   UserAuthenticationDatabase* authDB = NULL;

   RTSPServer* rtspServer = RTSPServer::createNew(*env, 8554, authDB);
   if (rtspServer == NULL) {
     *env << "Failed to create RTSP server: " << env->getResultMsg() << 
"\n";
     exit(1);
   }
   char const* descriptionString
     = "Session streamed by \"testOnDemandRTSPServer\"";

   // A MPEG-2 Transport Stream, coming from a live UDP (raw-UDP or 
RTP/UDP) source:
   {
     char const* streamName = "mpeg2TransportStreamFromUDPSourceTest";
     char const* inputAddressStr = "239.200.1.102";
     portNumBits const inputPortNum = 5500;
     Boolean const inputStreamIsRawUDP = True;
     ServerMediaSession* sms
       = ServerMediaSession::createNew(*env, streamName, streamName,
                                       descriptionString);
     sms->addSubsession(MPEG2TransportUDPServerMediaSubsession
                        ::createNew(*env, inputAddressStr, inputPortNum, 
inputStreamIsRawUDP));
     rtspServer->addServerMediaSession(sms);

     char* url = rtspServer->rtspURL(sms);
     *env << "\n\"" << streamName << "\" stream, from a UDP Transport 
Stream input source \n\t(";
     if (inputAddressStr != NULL) {
       *env << "IP multicast address " << inputAddressStr << ",";
     } else {
       *env << "unicast;";
     }
     *env << " port " << inputPortNum << ")\n";
     *env << "Play this stream using the URL \"" << url << "\"\n";
     delete[] url;
   }
   env->taskScheduler().doEventLoop(); // does not return
   return 0; // only to prevent compiler warning
}




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20121218/6dad06a2/attachment.html>


More information about the live-devel mailing list