<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div>Ross,</div><div><br></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"><meta http-equiv="x-dns-prefetch-control" content="off"><div id="yiv1803684931"><div><div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"><div><span><div><span style="font-size:12pt;">> </span><span style="font-size:12pt;">I don't understand what you mean by this, because VLC - when receiving RTSP streams - does so using the LIVE555 libraries, and so does so by receiving one NAL unit at a time, just as your own receiver application does.</span><br></div><div><span style="font-size:12pt;"><br></span></div><div>Sorry, probably
 not explained myself.  I am using the VLC code as reference as it also does receive one NAL unit at a time in it's live555 demuxer module, however these units pass through and get collected by a h264 packetizer module before getting to the avcodec module.  VLC does play everything fine in this setup, unless I delete the h264 packetizer plugin .dll - which causes VLC to use the fall-back copy packetizer (which just copies
 each unit as is, no grouping).  With no packetizer VLC as a client really struggles on most H264 RTSP sources, having similar issues as I was having, so it looks like the h264 packetizer in VLC gets it out of a lot of trouble.  I was under the impression the packetizers in VLC were just for making sense from a bitstream but it seems they are used to 'help' other modules along as well - in this case the live555 demux module.</div></span></div><div><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><div>> One thing to keep in mind, though, is that because network packets have 'jitter' (i.e., are not received at a smooth, constant rate), received NAL units will need to be buffered before being rendered.  </div><div>> (The rendering time should be based upon the 'presentation time' that you get with each NAL unit.)
  Some decoders might do buffering automatically; others might not (in which case you'll need to add some buffering yourself).</div><div><br></div><div>I think you've pretty much hit the issue, I'm guessing (as the MF decoder is closed source) the MF decoder does this buffering whereas avcodec does not.  I've now implemented the suggestion you have above where I base the rendering on the 'presentation time' from live555 - all works smoothly, both the troublesome feeds and the ones that previously worked without this.</div><div><br></div><div>Thanks!</div><div>Mark.</div><div><br></div></div>  <div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"> <div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"> <div dir="ltr"> <font size="2" face="Arial"> <hr size="1">  <b><span style="font-weight:bold;">From:</span></b> Ross Finlayson <finlayson@live555.com><br> <b><span
 style="font-weight:bold;">To:</span></b> LIVE555 Streaming Media - development & use <live-devel@ns.live555.com> <br> <b><span style="font-weight:bold;">Sent:</span></b> Thursday, 14 March 2013, 5:00<br> <b><span style="font-weight:bold;">Subject:</span></b> Re: [Live-devel] using live555 as a client to receive 1920x1080 H264 over rtsp<br> </font> </div> <br><div id="yiv1803684931"><div><div><blockquote type="cite"><div><div style="background-color: rgb(255, 255, 255); font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"><div id="yiv1803684931"><div style="background-color: rgb(255, 255, 255); font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"><div id="yiv1803684931"><div style="background-color: rgb(255, 255, 255);
 font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;">I've been using the RTSP client of
 live555 to receive a 'full-hd' stream of H264 encoded video over RTSP, sent by VLC (2.0.5).  I have been using the NAL units sent from live555 (via H264VideoRTPSource) and passing them directly (no packetizer or grouper e.g, just prefixing the start code) to a Media Foundation H264 decoder.  This worked perfectly, so then I changed decoder to avcodec (ffmpeg libraries) and the same video
 source has corrupted decoder output (sort of grey smudges with bits of the actual frames in).<br><br>I've been reading through the live555 code and searching through posts on forums to try and see if this is
 a issue with live555 or the av decoder. </div></div></div></div></div></div></div></div></blockquote><div><br></div>Because you've demonstrated that your received H.264 NAL units render OK with one decoder, but not with the other, this suggests that the problem is with the decoder.  (Logic 101 :-)</div><div><br></div><div>One thing to keep in mind, though, is that because network packets have 'jitter' (i.e., are not received at a smooth, constant rate), received NAL units will need to be buffered before being rendered.  (The rendering time should be based upon the 'presentation time' that you get with each NAL unit.)  Some decoders might do buffering automatically; others might not (in which case you'll need to add some buffering yourself).</div><div><br></div><div><br><blockquote type="cite"><div><div style="background-color: rgb(255, 255, 255); font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"><div
 style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"><div id="yiv1803684931"><div style="background-color: rgb(255, 255, 255); font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"><div id="yiv1803684931"><div style="background-color: rgb(255, 255, 255); font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"> FYI, the same RTSP stream works in VLC as client, but *only* with the use of a H264 packetizer in between the RTSP and decoder modules.</div></div></div></div></div></div></div></div></blockquote><div><br></div>I don't understand what you mean by this, because VLC - when receiving RTSP streams - does so using the LIVE555 libraries, and so does so by receiving one NAL unit at a time, just as your own receiver application does.</div><div><br></div><div>You should check whether the (original,
 unmodified) VLC media player application plays your stream OK.  If it does, then you could use the VLC code as a model.</div><br><br><div>
<span class="yiv1803684931Apple-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-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span class="yiv1803684931Apple-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-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;">Ross Finlayson<br>Live Networks, Inc.<br><a rel="nofollow" target="_blank" href="http://www.live555.com/">http://www.live555.com/</a></span></span>
</div>
<br></div></div><br>_______________________________________________<br>live-devel mailing list<br><a rel="nofollow" ymailto="mailto:live-devel@lists.live555.com" target="_blank" href="mailto:live-devel@lists.live555.com">live-devel@lists.live555.com</a><br><a rel="nofollow" target="_blank" href="http://lists.live555.com/mailman/listinfo/live-devel">http://lists.live555.com/mailman/listinfo/live-devel</a><br><br><br> </div> </div>  </div></div></div><meta http-equiv="x-dns-prefetch-control" content="on"><br><br> </div> </div>  </div></body></html>