<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=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:"Courier New";}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:759331456;
mso-list-type:hybrid;
mso-list-template-ids:1050281522 -1818856298 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
{mso-level-start-at:0;
mso-level-number-format:bullet;
mso-level-text:\F0D8;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Courier New";}
@list l0:level2
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level3
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l0:level4
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l0:level5
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level6
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l0:level7
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l0:level8
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level9
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></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-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Hi Mr Finlayson<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Sorry just found out that you’ve replied question, I went through live555 mail archives trying to find some answer.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><![if !supportLists]><span style="font-size:10.0pt;font-family:Wingdings;color:black"><span style="mso-list:Ignore">Ø<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]><span style="font-size:10.0pt;font-family:"Courier New";color:black">There is no bug in the LIVE555 code. There is perhaps a bug in the custom code that the server uses to feed NAL units from the camera to the server.<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Correct, it was only my assumption, the more I learn from mailing list, it is intended to send frames in multiple packets, you already mentioned the advantage of this from your older email.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<pre style="margin-left:36.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo1"><![if !supportLists]><span style="font-family:Wingdings;color:black"><span style="mso-list:Ignore">Ø<span style="font:7.0pt "Times New Roman""> </span></span></span><![endif]><span style="color:black">What is the value of the “numTruncatedBytes” parameter to this call? If it’s >0, then this means that the supplied buffer size (the “maxSize” parameter to the call to “getNextFrame()” was too small, and needs to be increased.<o:p></o:p></span></pre>
<pre><span style="color:black"><o:p> </o:p></span></pre>
<p class="MsoNormal">This one already answered, I didn’t get any error since my buffer is well above the maxSize therefore numTruncatedBytes is always 0.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Let me rephrase my problem from my findings, for older camera I get the data from getNextFrame() as follows<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Nal Remark<o:p></o:p></p>
<p class="MsoNormal">32 VPS<o:p></o:p></p>
<p class="MsoNormal">33 SPS<o:p></o:p></p>
<p class="MsoNormal">34 PPS<o:p></o:p></p>
<p class="MsoNormal">19 I-Frame (full size)<o:p></o:p></p>
<p class="MsoNormal">1 P-Frame (full size)<o:p></o:p></p>
<p class="MsoNormal">…<o:p></o:p></p>
<p class="MsoNormal">1 P-Frame (full size)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">These I & P frames can be fed to the decoder and I can get the picture without problem.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">For latest HEVC stream camera, the data will look like this<o:p></o:p></p>
<p class="MsoNormal">Nal Remark<o:p></o:p></p>
<p class="MsoNormal">32 VPS<o:p></o:p></p>
<p class="MsoNormal">33 SPS<o:p></o:p></p>
<p class="MsoNormal">34 PPS<o:p></o:p></p>
<p class="MsoNormal">39 Prefix<o:p></o:p></p>
<p class="MsoNormal">19 I-Frame (1/3 size)<o:p></o:p></p>
<p class="MsoNormal">19 I-Frame (1/3 size)<o:p></o:p></p>
<p class="MsoNormal">19 I-Frame (1/3 size)<o:p></o:p></p>
<p class="MsoNormal">39 Prefix<o:p></o:p></p>
<p class="MsoNormal">1 P-Frame (1/3 size)<o:p></o:p></p>
<p class="MsoNormal">1 P-Frame (1/3 size)<o:p></o:p></p>
<p class="MsoNormal">1 P-Frame (1/3 size)<o:p></o:p></p>
<p class="MsoNormal">….<o:p></o:p></p>
<p class="MsoNormal">39 Prefix<o:p></o:p></p>
<p class="MsoNormal">1 P-Frame (1/3 size)<o:p></o:p></p>
<p class="MsoNormal">1 P-Frame (1/3 size)<o:p></o:p></p>
<p class="MsoNormal">1 P-Frame (1/3 size)<o:p></o:p></p>
<p class="MsoNormal">That’s where I tried to merge the fragmented frames before sending it to the decoder.
<o:p></o:p></p>
<p class="MsoNormal">I have tried to store the frame when I get Nal prefix (39) as follows on afterGetFrame function<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">If (firstFU){<o:p></o:p></p>
<p class="MsoNormal"> memcpy(temp_rtp_data, rtp_data, frameSize);<o:p></o:p></p>
<p class="MsoNormal"> temp_buffer_size = frameSize;<o:p></o:p></p>
<p class="MsoNormal"> firstFU = false;<o:p></o:p></p>
<p class="MsoNormal">}<o:p></o:p></p>
<p class="MsoNormal">else{<o:p></o:p></p>
<p class="MsoNormal"> size_t data_pos = 6; /// I have experiment this with many different values following hevc rfc document, still no avail<o:p></o:p></p>
<p class="MsoNormal"> memcpy(temp_rtp_data + temp_buffer_size, rtp_data + data_pos, frameSize – data_pos);<o:p></o:p></p>
<p class="MsoNormal"> temp_buffer_size += frameSize – data_pos;<o:p></o:p></p>
<p class="MsoNormal"> firstFU = false;<o:p></o:p></p>
<p class="MsoNormal">}<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">If I find another nal equal to 39, I send the data to the decoder, still I can only see 1/3 frame being decoded.
<o:p></o:p></p>
<p class="MsoNormal">I have tried to find answer anywhere (including SO), but couldn’t get any, there’s also unanswered question regarding merging Fragmented Unit.
<o:p></o:p></p>
<p class="MsoNormal">I am very new to video streaming world, the original code belongs to my client, I’m grateful to have a chance to learn about it.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Also pardon for my lack of netiquette from my last email, I was mindlessly replying to the email using outlook.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Best regards, <o:p></o:p></p>
<p class="MsoNormal">Firdaus<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>