<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><blockquote type="cite"><div dir="ltr"><div><div><div>I`m implementing low-latency h264 rtsp source. Based on this code<br><a href="http://stackoverflow.com/questions/13863673/how-to-write-a-live555-framedsource-to-allow-me-to-stream-h-264-live" target="_blank">http://stackoverflow.com/questions/13863673/how-to-write-a-live555-framedsource-to-allow-me-to-stream-h-264-live</a> <br></div></div></div></div></blockquote><div><br></div>Oh please!  Only second-rate programmers use '<a href="http://stackoverflow.com">stackoverflow.com</a>'.</div><div><br></div><div>The proper web site for documentation on the "LIVE555 Streaming Media" code is <<a href="http://www.live555.com/">http://www.live555.com/</a>>.  In particular, you should read</div><div><span class="Apple-tab-span" style="white-space:pre">     </span><a href="http://www.live555.com/liveMedia/faq.html#liveInput">http://www.live555.com/liveMedia/faq.html#liveInput</a></div><div>and</div><div><span class="Apple-tab-span" style="white-space:pre">        </span><a href="http://www.live555.com/liveMedia/faq.html#liveInput-unicast">http://www.live555.com/liveMedia/faq.html#liveInput-unicast</a></div><div><br></div><div><br><blockquote type="cite"><div dir="ltr"><div><div><div>

</div>I wrote subclass of FramedSource and able to watch this stream in my client app. But even if I put 1 frame per second setting in x264 codec, I have exactly one frame-delayed data in my client. This delay is 100% on server side, because MultiFramedRTPSink::sendPacketIfNecessary() sending compressed data of previous frame (i just compare first several bytes of data in fOutBuf with those I wrote in fTo).<br></div></div></div></blockquote><div><br></div>I haven't looked at your code in detail, but you should note that once a H.264 NAL unit is delivered to the downstream "H264VideoStreamDiscreteFramer" object (using "FramedSource::afterGetting()"), this delivery will take place immediately.  Similarly, the delivery from the "H264VideoStreamDiscreteFramer" to *its* downstream object - a "H264VideoRTPSink" - will also take place immediately.  There is no '1 frame (NAL unit) delay'.</div><div><br></div><div>(Note also that for H.264 video streaming, because you are delivering discrete NAL units (i.e., one at a time), your NAL unit source class *must* feed into a "H264VideoStreamDiscreteFramer" object (*not* a "H264VideoStreamFramer"), and each NAL unit that's delivered *must not* begin with a 0x00000001 'start code'.)</div><div><br></div><div><br></div><div><blockquote type="cite"><div dir="ltr">    nextTask() = envir().taskScheduler().scheduleDelayedTask(0,<br>

                (TaskFunc*)FramedSource::afterGetting, this);<br></div></blockquote><div><br></div>Because your code will already be returning to the event loop immediately afterwards, note that you can simplify this to</div><div><span class="Apple-tab-span" style="white-space:pre">       </span>FramedSource::afterGetting(this);</div><br><br><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;  "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;  ">Ross Finlayson<br>Live Networks, Inc.<br><a href="http://www.live555.com/">http://www.live555.com/</a></span></span>
</div>
<br></body></html>