[Live-devel] Having trouble implementing a live unicast stream

Robert Smith smith at cognitec.com
Fri Apr 26 01:20:49 PDT 2013


  I am implementing an RTSP server to stream live H264 video via either 
multicast or unicast RTP.

My multicast solution is working fine but the unicast stream is giving 
me trouble.

I've read the FAQ and based on this I created a test program like so:

1) Created an OnDemandServerMediaSubsession subclass which holds a 
FramedSource* provided in the class constructor and returns this pointer 
in it's 'createNewStreamSource' method as well as setting the estBitrate 
parameter. 'createNewRTPSink' is identical to that of 
H264FileServerMediaSubsession. The 'reuseFirstSource' parameter is set 
to 'True'.

2) Modified testOnDemandRTSPServer to create a ByteStreamFileSource, 
wrap it in an H264VideoStreamFramer and pass it to my 
OnDemandServerMediaSubsession subclass.

I had expected this to work but instead it crashes in a call to 
'H264VideoRTPSink::sourceIsCompatibleWithUs', this is the top of the 
stack trace:

#0  0x000000000045da92 in typeinfo name for HashTable::Iterator ()
#1  0x0000000000000207 in ?? ()
#2  0x000000000067d3f0 in ?? ()
#3  0x000000000040776f in H264VideoRTPSink::sourceIsCompatibleWithUs 
(this=0x67d4a0, source=...)
     at H264VideoRTPSink.cpp:101
#4  0x0000000000406b85 in MediaSink::startPlaying (this=0x67d4a0, 
source=..., afterFunc=
     0x415333 <afterPlayingStreamState(void*)>, 
afterClientData=0x67d090) at MediaSink.cpp:70

When I create a new ByteSteamFileSource/H264VideoStreamFramer inside the 
'createNewStreamSource' method ala H264FileServerMediaSubsession it 
works as expected.

 From this I take it that each call to 'createNewStreamSource' should 
return a pointer to a different object, but then I'm unsure how this 
works when there is only a single source, I thought that using 
reuseFirstSource = True would mean that I could use a single source object.

I've obviously misunderstood the instructions in the FAQ so it would be 
great if you could point me in the right direction.

Regards,

Robert Smith.


More information about the live-devel mailing list