<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:"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:0in;
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;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
p.m2429361133567484417msolistparagraph, li.m2429361133567484417msolistparagraph, div.m2429361133567484417msolistparagraph
{mso-style-name:m_2429361133567484417msolistparagraph;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
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-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Thanks Chris! I appreciate the explanation. I need to spend some time getting familiar with the specification.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">-Eric.</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> live-devel [mailto:live-devel-bounces@us.live555.com]
<b>On Behalf Of </b>Chris Paucar<br>
<b>Sent:</b> Thursday, May 30, 2019 4:31 PM<br>
<b>To:</b> LIVE555 Streaming Media - development & use <live-devel@us.live555.com><br>
<b>Subject:</b> Re: [Live-devel] rtspTestClient consumes the first bytes of each packet? How to prevent?<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">Hi Eric,<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Regarding #3, those are the SPS and PPS NAL units, size 22 and 4 respectively. You can confirm by looking at the 5 lower bits of the first byte and matching the NAL unit type with values 7 and 8 for SPS and PPS. <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Some RTSP sources provide them in a separate stream while others embed them together with the video stream, as it appears in your case. You can read more about it in ISO 14496-10. <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Chris<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Thu, May 30, 2019 at 5:16 PM <<a href="mailto:Eric.Brandt@nikon.com">Eric.Brandt@nikon.com</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Hello,<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">I am streaming the test.264 file from live555 using the testOnDemandRTSPServer.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">I am receiving it using testRTSPClient. This part works fine.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">I have modified testRTSPClient with a custom Sink such that the ‘afterGettingFrame’ virtual function passes the contents of each fReceiveBuffer to libav/ffmpeg’s av_parser_parse2()
to parse the incoming data into packets, later to be submitted to avcodec_send_packet() and avcodec_receive_frame() pair to decode it. I can use this same av_parser_parse2()/avcodec_send_packet()/avcodec_receive_frame() to properly decode frames by supplying
bytes to the parser directly from the test.264 file (using fopen()/fread()), so I know that part of the pipeline works if the incoming data is correct.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">However, when supplying the fReceiveBuffer data from ‘afterGettingFrame()’, the av_parser_parse2() never finds a packet, because the testRTSPClient has consumed the 0x0001 header
at the start of the h.264 packet. I have several questions, all of which center around how to properly decode data arriving through afterGettingFrame().
<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="m2429361133567484417msolistparagraph">1.<span style="font-size:7.0pt">
</span>Is there a way to prevent the testRTSPClient infrastructure from consuming that header byte so that I can supply it to the parser?<o:p></o:p></p>
<p class="m2429361133567484417msolistparagraph">2.<span style="font-size:7.0pt">
</span>If I should not use the av_parser_parse2() function to find packets, then how do I properly segment the data coming in via afterGettingFrame() into packets that I can supply to the avcodec_send_packet()/avcodec_receive_frame()?
<o:p></o:p></p>
<p class="m2429361133567484417msolistparagraph">3.<span style="font-size:7.0pt">
</span>The sizes of the data received in fReceiveBuffer are clearly not entire frames…in fact the first few times the function is called the data sizes are 22, 4, 3017, 3081… Why the small size callbacks every so often?<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Any help you can provide generally on how to supply data being received by testRTSPClient to libav/ffmpeg decoder would be very much appreciated.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Thanks,<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">-Eric.
<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
</div>
<p class="MsoNormal">_______________________________________________<br>
live-devel mailing list<br>
<a href="mailto:live-devel@lists.live555.com" target="_blank">live-devel@lists.live555.com</a><br>
<a href="http://lists.live555.com/mailman/listinfo/live-devel" target="_blank">http://lists.live555.com/mailman/listinfo/live-devel</a><o:p></o:p></p>
</blockquote>
</div>
</div>
</div>
</body>
</html>