[Live-devel] Please help: I have difficulties implementing the right classes

Ross Finlayson finlayson at live555.com
Thu Sep 4 10:35:07 PDT 2014


> Could it be that calling deliverFrame() multiple times might be wrong?

Yes, that's wrong.  Your "doGetNextFrame()" function should deliver one, and only one, H.264 NAL unit (note, not a H.264 'frame') each time it's called.  Note that if - at the time that "doGetNextFrame()" is called - no H.264 NAL unit is currently available, your "doGetNextFrame()" implementation should return immediately, and your "deliverFrame()" function must not get called again until later, when a new H.264 NAL unit becomes available.  I suggest reviewing the "DeviceSource" demo code, and note how it uses an 'event trigger' (signaled from a separate thread) to do this.

Also, because you're delivering discrete H.264 NAL units (i.e., one at a time), your "OnDemandServerMediaSubclass::createNewStreamSource()" implementation should be feeding your input source object into a "H264VideoStreamDiscreteFramer", not a "H264VideoStreamFramer".  (Note that, in this case, the H.264 NAL units from your input source must *not* begin with a 'start code' (0x00 0x00 0x00 0x01).)

Finally, because you're delivering from a live source (rather than a prerecorded source like a file), you don't need to set "fDurationInMicroseconds".

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

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


More information about the live-devel mailing list