Ross, would you please look at this MP2TS file for us?

        http://etr-usa.com/live555/novideo.ts

It always streams successfully via RTSP over raw UDP from mediaServer, but shows no video when streamed from testMPEG2TransportStreamer if the sender starts before the receiver.

This doesn't happen with any other file we have tried so far. I'm guessing the problem is that some necessary bit of synchronization data appears only at the beginning of the file, so that if the client isn't receiving when it goes by, it never figures out how to decode the video properly.

I see this with three different clients: testMPEG2TransportReceiver, VLC, and an STB.

The patch in my previous message is a result of going down a rathole, thinking maybe the problem was in the demuxing that's part of RTP. I figured I could avoid the problem by going with raw UDP streaming, so I hacked testMPEG2TransportStreamer to do that.

By the way, I've attached a new version of that patch. The previous one doesn't build if you pound out USE_RAW_UDP, and it should have that line commented out by default anyway.
--- testMPEG2TransportStreamer.cpp.orig	2012-04-30 12:03:15.000000000 -0600
+++ testMPEG2TransportStreamer.cpp	2012-04-30 12:50:57.000000000 -0600
@@ -15,7 +15,7 @@
 **********/
 // Copyright (c) 1996-2012, Live Networks, Inc.  All rights reserved
 // A test program that reads a MPEG-2 Transport Stream file,
-// and streams it using RTP
+// and streams it using either RTP or raw UDP
 // main program
 
 #include "liveMedia.hh"
@@ -30,6 +30,9 @@
 Boolean const isSSM = False;
 #endif
 
+// Uncomment this to send TS file over raw UDP instead of remuxing it for RTP
+//#define USE_RAW_UDP 1
+
 // To set up an internal RTSP server, uncomment the following:
 //#define IMPLEMENT_RTSP_SERVER 1
 // (Note that this RTSP server works for multicast only)
@@ -41,7 +44,7 @@
 UsageEnvironment* env;
 char const* inputFileName = "test.ts";
 FramedSource* videoSource;
-RTPSink* videoSink;
+MediaSink* videoSink;
 
 void play(); // forward
 
@@ -50,7 +53,6 @@
   TaskScheduler* scheduler = BasicTaskScheduler::createNew();
   env = BasicUsageEnvironment::createNew(*scheduler);
 
-  // Create 'groupsocks' for RTP and RTCP:
   char const* destinationAddressStr
 #ifdef USE_SSM
     = "232.255.42.42";
@@ -61,12 +63,21 @@
   // of the (single) destination.  (You may also need to make a similar
   // change to the receiver program.)
 #endif
-  const unsigned short rtpPortNum = 1234;
-  const unsigned short rtcpPortNum = rtpPortNum+1;
   const unsigned char ttl = 7; // low, in case routers don't admin scope
-
   struct in_addr destinationAddress;
   destinationAddress.s_addr = our_inet_addr(destinationAddressStr);
+  static const int basePortNum = 1234;
+
+#ifdef USE_RAW_UDP
+  // Create 'groupsock' for raw UDP, then bind a raw UDP sink to it
+  const Port udpPort(basePortNum);
+  Groupsock udpGroupsock(*env, destinationAddress, udpPort, ttl);
+  videoSink = BasicUDPSink::createNew(*env, &udpGroupsock);
+#else
+  // Create 'groupsocks' for RTP and RTCP:
+  const unsigned short rtpPortNum = basePortNum;
+  const unsigned short rtcpPortNum = basePortNum+1;
+
   const Port rtpPort(rtpPortNum);
   const Port rtcpPort(rtcpPortNum);
 
@@ -93,7 +104,8 @@
 #endif
     RTCPInstance::createNew(*env, &rtcpGroupsock,
 			    estimatedSessionBandwidth, CNAME,
-			    videoSink, NULL /* we're a server */, isSSM);
+			    dynamic_cast<RTPSink*>(videoSink),
+				NULL /* we're a server */, isSSM);
   // Note: This starts RTCP running automatically
 
 #ifdef IMPLEMENT_RTSP_SERVER
@@ -115,7 +127,8 @@
   char* url = rtspServer->rtspURL(sms);
   *env << "Play this stream using the URL \"" << url << "\"\n";
   delete[] url;
-#endif
+#endif  // defined(IMPLEMENT_RTSP_SERVER)
+#endif	// defined(USE_RAW_UDP)
 
   // Finally, start the streaming:
   *env << "Beginning streaming...\n";
_______________________________________________
live-devel mailing list
live-devel@lists.live555.com
http://lists.live555.com/mailman/listinfo/live-devel

Reply via email to