[Live-devel] Pls give suggestion about the testReplicator.cpp

Yuan, Chao (Chao)** CTR ** chao.yuan at alcatel-lucent.com
Mon Jul 9 23:26:16 PDT 2012


All,
I used the live555 lib to make a simple RTSP server, my server IP is 135.240.130.30, the inputPort is 1236, the outputPort is 8556,
One phone can send TS packet to 1236 port, another phone can get the packets from rtsp://135.240.130.30:8556/mobileLiveVideo,
This works fine.

However, I also want to store/save this TS stream source on the live555 server into a stream file,for example(test.ts), after I see the code in testProgs/testReplicator.cpp, I add some code to do this:

unsigned fOurSessionId;
  Port clientRTPPort(0), clientRTCPPort(0), serverRTPPort(0), serverRTCPPort(0);
  netAddressBits destinationAddress = 0;
  u_int8_t destinationTTL = 0;
  Boolean isMulticast = False;
  void* streamToken;
  subsess->getStreamParameters(fOurSessionId, 0, clientRTPPort,clientRTCPPort, 0,0,0, destinationAddress,destinationTTL,
  isMulticast, serverRTPPort,serverRTCPPort, streamToken);

// get the source
  FramedSource* source = subsess->getStreamSource(streamToken);
  StreamReplicator* replicator = StreamReplicator::createNew(*env, source);

  // Then create a network (UDP) 'sink' object to receive a replica of the input stream, and start it.
  // If you wish, you can duplicate this line - with different network addresses and ports - to create multiple output UDP streams:
  startReplicaUDPSink(replicator,"135.240.130.30",8556);

  // Then create a file 'sink' object to receive a replica of the input stream, and start it.
  // If you wish, you can duplicate this line - with a different file name - to create multiple output files:
  startReplicaFileSink(replicator, "test.ts");
  startReplicaFileSink(replicator, "test2.ts");
  *env<<"\nstartReplicaFileSink\n";


The startReplicaUDPSink and startReplicaFileSink  is same as in testProgs/testReplicator.cpp.
The problem is the test.ts and test2.ts can save the TS packet correctly, but the phone can not get packets from rtsp://135.240.130.30:8556/mobileLiveVideo,
And an error on my server occurred:
FramedSource[0x1fea260]::getNextFrame(): attempting to read more than once at the same time!
Aborted

Can anyone tell we what's wrong? Thank you.

BR,
Chao,Yuan

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


More information about the live-devel mailing list