<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:'
        panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Trebuchet MS";
        panose-1:2 11 6 3 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.apple-style-span
        {mso-style-name:apple-style-span;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle19
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Hello Ross.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">I now have a packet capture of the second case I mentioned (H.264 I frame being dropped) which I think is related.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><a href="https://dl.dropboxusercontent.com/u/2931731/Bugs/liveMedia/dropped%20I%20frame/videostream.pcapng">https://dl.dropboxusercontent.com/u/2931731/Bugs/liveMedia/dropped%20I%20frame/videostream.pcapng</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><a href="https://dl.dropboxusercontent.com/u/2931731/Bugs/liveMedia/dropped%20I%20frame/frames2.LOG">https://dl.dropboxusercontent.com/u/2931731/Bugs/liveMedia/dropped%20I%20frame/frames2.LOG</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">If you look at the frame2.log, you will see a “frame num gap” being reported by FFmpeg on line 421.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">The 2 lines immediately before it are P frames with a frame number of 14, then 1, but the intermediary I frame was never passed from
 liveMedia to our file sink.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><a href="https://dl.dropboxusercontent.com/u/2931731/Bugs/liveMedia/dropped%20I%20frame/rawframe/425%201430469392.350150.dat">https://dl.dropboxusercontent.com/u/2931731/Bugs/liveMedia/dropped%20I%20frame/rawframe/425%201430469392.350150.dat</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><a href="https://dl.dropboxusercontent.com/u/2931731/Bugs/liveMedia/dropped%20I%20frame/rawframe/426%201430469392.425538.dat">https://dl.dropboxusercontent.com/u/2931731/Bugs/liveMedia/dropped%20I%20frame/rawframe/426%201430469392.425538.dat</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><a href="https://dl.dropboxusercontent.com/u/2931731/Bugs/liveMedia/dropped%20I%20frame/rawframe/427%201430469392.425538.dat">https://dl.dropboxusercontent.com/u/2931731/Bugs/liveMedia/dropped%20I%20frame/rawframe/427%201430469392.425538.dat</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><a href="https://dl.dropboxusercontent.com/u/2931731/Bugs/liveMedia/dropped%20I%20frame/rawframe/428%201430469392.507293.dat">https://dl.dropboxusercontent.com/u/2931731/Bugs/liveMedia/dropped%20I%20frame/rawframe/428%201430469392.507293.dat</a></span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">These 4 files represent each frame passed to our sink, P frame 14, an SPS, a PPS, and a P frame (with no intermediary I frame).<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">Comparing these to the packet capture, the SPS and PPS (file 426 and 427) are in packet 19288, with the I frame at packet numbers 19289 to 19463
 where the marker bit is set.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">The P frame in file 428 can be seen in the packet capture starting at packet 19511.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">For reference, here is the top of our afterGettingFrame method in our file sink:<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:blue">void</span><span style="font-size:10.0pt;font-family:"Courier New""> H264VideoMemorySink::afterGettingFrame(<span style="color:blue">unsigned</span>
 frameSize, <span style="color:blue">unsigned</span> <span style="color:blue">int</span> numTruncatedBytes,
<span style="color:blue">struct</span> timeval presentationTime) {<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New"">     
<span style="color:blue">char</span> str[512];<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New"">      sprintf_s(str, 512,
<span style="color:#A31515">"c:\\debug\\rawframe\\%d %u.%06u.dat"</span>, ++framex, presentationTime);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New"">      FILE* file = fopen(str,
<span style="color:#A31515">"wb"</span>);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New"">      fwrite(fBuffer, 1, frameSize, file);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New"">      fclose(file);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">As far as I can see, the data in the network stream is correct and framed correctly.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">(A test tool isn’t flagging any errors about oversized SPS/PPS frames, or unexpected ordering of H.264 frames.)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">Do you have any further thoughts on what could be going wrong?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">I've spent a while looking at the code and can’t see anything obvious in liveMedia or our code.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">Note that our original problem was liveMedia joining several frames together before sending them through to our sink, but that only occurs very infrequently.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">The dropped I frames occurs every few minutes and seems to be in the same area of the code (parsing H.264 frames).<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">I’m still investigating here and will post if I find anything else out.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">Many thanks<span style="color:#1F497D"><o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Trebuchet MS",sans-serif;color:#5E5E5F">--
<o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.5pt;font-family:"Trebuchet MS",sans-serif;color:#5E5E5F">Deanna Earley |</span></b><span style="font-size:10.5pt;font-family:"Trebuchet MS",sans-serif;color:#5E5E5F"> Lead d</span><span style="font-size:10.5pt;font-family:"Trebuchet MS",sans-serif;color:#5E5E5F">eveloper <b>| </b></span><b><span lang="EN-US" style="font-size:10.5pt;font-family:"Trebuchet MS",sans-serif;color:black">icatcher</span></b><b><span lang="EN-US" style="font-size:10.5pt;font-family:"Trebuchet MS",sans-serif;color:#FF9223">cctv</span></b><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:black"><o:p> </o:p></span></b></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Trebuchet MS",sans-serif;color:#5E5E5F">w:
</span><a href="http://www.icode.co.uk/icatcher"><span lang="EN-US" style="font-size:9.0pt;font-family:"Trebuchet MS",sans-serif">www.icode.co.uk/icatcher</span></a><span style="font-size:9.0pt;font-family:"Trebuchet MS",sans-serif;color:#5E5E5F">
<span lang="EN-US">| t: 01329 835335 | f: 01329 835338</span></span><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:7.5pt;font-family:"Trebuchet MS",sans-serif;color:#919191">Registered Office : 71 The Hundred, Romsey, SO51 8BZ. Company Number : 03428325</span><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> live-devel [mailto:live-devel-bounces@ns.live555.com]
<b>On Behalf Of </b>Ross Finlayson<br>
<b>Sent:</b> 05 May 2015 09:44<br>
<b>To:</b> LIVE555 Streaming Media - development & use<br>
<b>Subject:</b> Re: [Live-devel] Multiple NALUs concatenated together in one afterGettingFrame<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Thanks, I was trying to get something concrete by analysing the network stream.</span><span style="font-family:"&apos",serif"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">This camera is unusual (compared to others we have) in that it sends an SPS and a PPS before every I frame.</span><span style="font-family:"&apos",serif"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">The SPS/PPS share an RTP frame in a STAP with no marker bit, while the I/P frames are in FU-A packets (with the marker set on the last RTP frame).</span><span style="font-family:"&apos",serif"><o:p></o:p></span></p>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">That looks correct.  As far as I can tell, our code (“H264VideoRTPSource.cpp”) should correctly be delivering each NAL unit - one at a time - from this input stream.<o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><span class="apple-style-span"><span style="font-family:"Helvetica",sans-serif;color:black">Ross Finlayson</span></span><span style="font-family:"Helvetica",sans-serif;color:black"><br>
<span class="apple-style-span">Live Networks, Inc.</span><br>
</span><a href="http://www.live555.com/"><span style="font-family:"Helvetica",sans-serif">http://www.live555.com/</span></a>
<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>