[Live-devel] Write completed Nal / frame to sink when a new begins

Ross Finlayson finlayson at live555.com
Wed Dec 7 04:09:24 PST 2011


> First of all, I am aware that I must not be touching existent and working code. I have not done any modifications. I am just trying to understand how it works. And the code has no problem. I just want to adapt it to my needs.
You should be thinking in terms of "subclassing the code for your needs"; not "adapting the code to your needs".

> Let's say I would like to have a Video RTP source that identify complete frames (now it does at Nal-by-nal basis). Then the Source waits until the frame is completed, to write it to the sink at once. As you explained to me already, i can use the markerBit (at RTPSource) to check the end of a frame (use it with "completesFrame" flag (leaving MultiFramedRTPSource as a black box). I have done it and it works. Thanks for that.
> But what if i can't rely on markerBit (which the RFC already advises)?. What I have is a way to detect the beginning of a new frame, but not the end of it. ¿Do you know how can I use the beginsFrame/completesFrame flags to write the frame to the sink in that situation?
You can't, because the "H264VideoRTPSource" code sets these flags based on the beginning/end of each NAL unit - because that (i.e., one NAL unit at a time) is what it delivers to its downstream object.

The right place to detect "video frame" (i.e., "access unit") boundaries is in your H.264 decoder - or whatever downstream object you have that receives NAL units from your "H264VideoRTPSource" - because that is what decoders do (i.e., render video frames).

The RTP receiving code - on the other hand - would be the *wrong* place to be doing this, because, for H.264, RTP packets contain "NAL units", not "access units" ('video frames').

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/20111207/749164dc/attachment.html>


More information about the live-devel mailing list