<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=iso-8859-1"><meta name=Generator content="Microsoft Word 14 (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: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;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 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.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.apple-tab-span
        {mso-style-name:apple-tab-span;}
span.apple-style-span
        {mso-style-name:apple-style-span;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1982028795;
        mso-list-type:hybrid;
        mso-list-template-ids:-322802780 2024291466 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Calibri","sans-serif";
        mso-fareast-font-family:Calibri;}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        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:-.25in;
        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:-.25in;
        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:-.25in;
        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:-.25in;
        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:-.25in;
        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:-.25in;
        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:-.25in;
        font-family:Wingdings;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></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'>Hi Ross,<o:p></o:p></span></p><p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><span style='mso-list:Ignore'>-<span style='font:7.0pt "Times New Roman"'>        </span></span></span><![endif]><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I am still not able to resolve the issue.<o:p></o:p></span></p><p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><span style='mso-list:Ignore'>-<span style='font:7.0pt "Times New Roman"'>        </span></span></span><![endif]><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I would like to elaborate my issue. Basically I want to stream frames I grab from a opengl windows and I get these frames in encoded h264 format<o:p></o:p></span></p><p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><span style='mso-list:Ignore'>-<span style='font:7.0pt "Times New Roman"'>        </span></span></span><![endif]><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>The following is my code for the thread that starts RTSP streaming.<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 style='margin-left:1.0in'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>int RTSPStreamer::Main()<o:p></o:p></span></p><p class=MsoNormal style='margin-left:1.0in'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>{<o:p></o:p></span></p><p class=MsoNormal style='margin-left:1.0in'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>    TaskScheduler* taskSchedular = BasicTaskScheduler::createNew();<o:p></o:p></span></p><p class=MsoNormal style='margin-left:1.0in'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>    BasicUsageEnvironment* usageEnvironment = BasicUsageEnvironment::createNew(*taskSchedular);<o:p></o:p></span></p><p class=MsoNormal style='margin-left:1.0in'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>    RTSPServer* rtspServer = RTSPServer::createNew(*usageEnvironment, 8554, NULL);<o:p></o:p></span></p><p class=MsoNormal style='margin-left:1.0in'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>    if(rtspServer == NULL)<o:p></o:p></span></p><p class=MsoNormal style='margin-left:1.0in'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>    {<o:p></o:p></span></p><p class=MsoNormal style='margin-left:1.0in'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>        *usageEnvironment << "Failed to create rtsp server ::" << usageEnvironment->getResultMsg() <<"\n";<o:p></o:p></span></p><p class=MsoNormal style='margin-left:1.0in'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>        exit(1);<o:p></o:p></span></p><p class=MsoNormal style='margin-left:1.0in'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>    }<o:p></o:p></span></p><p class=MsoNormal style='margin-left:1.0in'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:1.0in'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>    std::string streamName = "usb1.mkv";<o:p></o:p></span></p><p class=MsoNormal style='margin-left:1.0in'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>    ServerMediaSession* sms = ServerMediaSession::createNew(*usageEnvironment, streamName.c_str(), streamName.c_str(), "Live H264 Stream");<o:p></o:p></span></p><p class=MsoNormal style='margin-left:1.0in'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>    H264LiveServerMediaSession *liveSubSession = </span><b><span style='font-family:"Calibri","sans-serif";color:#1F497D'>H264LiveServerMediaSession</span></b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>::createNew(*usageEnvironment, true, </span><b><span style='font-family:"Calibri","sans-serif";color:#1F497D'>rtspStreamQueue</span></b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>);<o:p></o:p></span></p><p class=MsoNormal style='margin-left:1.0in'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>    sms->addSubsession(liveSubSession);<o:p></o:p></span></p><p class=MsoNormal style='margin-left:1.0in'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>    rtspServer->addServerMediaSession(sms);<o:p></o:p></span></p><p class=MsoNormal style='margin-left:1.0in'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>    char* url = rtspServer->rtspURL(sms);<o:p></o:p></span></p><p class=MsoNormal style='margin-left:1.0in'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>    *usageEnvironment << "Play the stream using url "<<url << "\n";<o:p></o:p></span></p><p class=MsoNormal style='margin-left:1.0in'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>    delete[] url;<o:p></o:p></span></p><p class=MsoNormal style='margin-left:1.0in'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>    taskSchedular->doEventLoop();<o:p></o:p></span></p><p class=MsoNormal style='margin-left:1.0in'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:1.0in'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>  return 0;<o:p></o:p></span></p><p class=MsoNormal style='margin-left:1.0in'><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=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><span style='mso-list:Ignore'>-<span style='font:7.0pt "Times New Roman"'>        </span></span></span><![endif]><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I have written a custom class </span><b><span style='font-family:"Calibri","sans-serif";color:#1F497D'>H264LiveServerMediaSession </span></b><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>which get frames from rtspStreamQueue.</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p></o:p></span></p><p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><span style='font-family:"Calibri","sans-serif";color:#1F497D'><span style='mso-list:Ignore'>-<span style='font:7.0pt "Times New Roman"'>        </span></span></span><![endif]><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>In </span><b><span style='font-family:"Calibri","sans-serif";color:#1F497D'>H264LiveServerMediaSession  </span></b><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>the fun</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>ction </span><b><span style='font-family:"Calibri","sans-serif";color:#1F497D'>createNewStreamSource() </span></b><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>creates an instance of </span><b><span style='font-family:"Calibri","sans-serif";color:#1F497D'>LiveSourceWithx264</span></b><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> which is basically responsible for getting the frame from </span><b><span style='font-family:"Calibri","sans-serif";color:#1F497D'>rtspStreamQueue.<o:p></o:p></span></b></p><p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><span style='font-family:"Calibri","sans-serif";color:#1F497D'><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:"Calibri","sans-serif";color:#1F497D'>In the function </span><b><span style='font-family:"Calibri","sans-serif";color:#1F497D'>deliverFrame() </span></b><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>–> </span><b><span style='font-family:"Calibri","sans-serif";color:#1F497D'>fMaxSize </span></b><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>will<b> </b>start at<b> </b>15000</span><b><span style='font-family:"Calibri","sans-serif";color:#1F497D'><o:p></o:p></span></b></p><p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><span style='font-family:"Calibri","sans-serif";color:#1F497D'><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:"Calibri","sans-serif";color:#1F497D'>In the next call to </span><b><span style='font-family:"Calibri","sans-serif";color:#1F497D'>deliverFrame(</span></b><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>) </span><span style='font-size:10.0pt;font-family:Wingdings;color:#1F497D'>à</span><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><b><span style='font-family:"Calibri","sans-serif";color:#1F497D'>fMaxSize</span></b><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> will be 15000-“size of frame in previous call”.</span><b><span style='font-family:"Calibri","sans-serif";color:#1F497D'><o:p></o:p></span></b></p><p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><span style='font-family:"Calibri","sans-serif";color:#1F497D'><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:"Calibri","sans-serif";color:#1F497D'>I think this should now happen and .</span><b><span style='font-family:"Calibri","sans-serif";color:#1F497D'><o:p></o:p></span></b></p><p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><span style='font-family:"Calibri","sans-serif";color:#1F497D'><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:"Calibri","sans-serif";color:#1F497D'>Can you suggest me what I did wrong. I have attached the files </span><b><span style='font-family:"Calibri","sans-serif";color:#1F497D'>H264LiveServerMediaSession</span></b><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> and </span><b><span style='font-family:"Calibri","sans-serif";color:#1F497D'>LiveSourceWithx264.<o:p></o:p></span></b></p><p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><span style='font-family:"Calibri","sans-serif";color:#1F497D'><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:"Calibri","sans-serif";color:#1F497D'>I am new to live555 and please help me out.</span><b><span style='font-family:"Calibri","sans-serif";color:#1F497D'><o:p></o:p></span></b></p><p class=MsoListParagraph><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Thanks and Regards,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Vikram Singh.<o:p></o:p></span></p><p class=MsoNormal><b><span style='font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></b></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> live-devel-bounces@ns.live555.com [mailto:live-devel-bounces@ns.live555.com] <b>On Behalf Of </b>Ross Finlayson<br><b>Sent:</b> Tuesday, April 15, 2014 8:26 PM<br><b>To:</b> LIVE555 Streaming Media - development & use<br><b>Subject:</b> Re: [Live-devel] Frames are corrupted<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"'>But if fFrameSize is greater than fMaxSize then I have to truncate the data.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>I think this is what that is causing the corrupted frames.<o:p></o:p></span></p></div></div></blockquote><div><p class=MsoNormal><o:p> </o:p></p></div><p class=MsoNormal>Yes, because if a frame has to be truncated, then the truncated data will be lost (i.e., not sent to the client).<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><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"'>Is there any way to get around this problem.<o:p></o:p></span></p></div></div></blockquote><div><p class=MsoNormal><o:p> </o:p></p></div><p class=MsoNormal>Yes, there are two possible solutions.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>1/ The best solution is to not send such large NAL units.  Reconfigure your encoder to break up 'key frames' into multiple (therefore much smaller) 'slice' NAL units.<o:p></o:p></p></div><div><p class=MsoNormal>2/ Alternatively (though not as good), you can increase the size of the server's output buffer.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><div><p class=MsoNormal>Try adding the following line to your application - at the start of "main()":<o:p></o:p></p></div><div><p class=MsoNormal><span class=apple-tab-span>            </span>OutPacketBuffer::maxSize = 100000;<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>and recompile.  If that doesn't work, try increasing to 150000, 200000, etc., depending on the size of your frames. <o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>It's important to understand, though, that this is a bad solution.  See:<o:p></o:p></p></div><div><p class=MsoNormal><span class=apple-tab-span>            </span><a href="http://lists.live555.com/pipermail/live-devel/2013-April/016805.html">http://lists.live555.com/pipermail/live-devel/2013-April/016805.html</a><o:p></o:p></p></div><div><p class=MsoNormal>1/ is a *much* better solution - i.e., decrease the size of the NAL units that you're streaming.<o:p></o:p></p></div></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 class=apple-style-span><a href="http://www.live555.com/">http://www.live555.com/</a></span></span> <o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p></div></body></html>