<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div><blockquote type="cite" class=""><div class=""><div style="font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; direction: ltr; font-family: Tahoma; font-size: 10pt;" class=""><div dir="ltr" id="yiv2230296969yui_3_16_0_1_1426141957505_33528" class="">What's happening is that the BasicUDPSource::incomingPacketHandler1() function is being called too many times.</div></div></div></blockquote><div><br class=""></div>This is apparently happening due to a flaw in your runtime library and/or OS: “select()” (called each time within the event loop) is returning an indication that the UDP socket has incoming packet(s) available - when it doesn’t.</div><div><br class=""></div><div>Unless you can fix this problem (again, in your system, not in our code), then you’re going to have to use some other input mechanism than UDP packets.  Is the input source (running “ffmpeg”) running on the same computer as the RTSP server?  If so, then you don’t need to use network packets to communicate between them.  Instead, I suggest using a named pipe (and thus using a “MPEG2TransportFileServerMediaSubsession” rather than a “MPEG2TransportUDPServerMediaSubsession”.</div><div><br class=""></div><div><br class=""></div><div><blockquote type="cite" class=""><div class=""><div style="font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; direction: ltr; font-family: Tahoma; font-size: 10pt;" class=""><div dir="ltr" id="yiv2230296969yui_3_16_0_1_1426141957505_31943" class="">I modified the line to:</div><div dir="ltr" id="yiv2230296969yui_3_16_0_1_1426141957505_35234" class="">if (!isCurrentlyAwaitingData()) {usleep(500);return;}<br clear="none" class=""></div><div dir="ltr" id="yiv2230296969yui_3_16_0_1_1426141957505_34947" class=""><br clear="none" class=""></div><div dir="ltr" id="yiv2230296969yui_3_16_0_1_1426141957505_34946" class="">And since then the CPU usage does not go up to 100% but stays around 1%! :)<br clear="none" class=""></div></div></div></blockquote><div><br class=""></div>Yes, of course your CPU usage drops to almost nothing if you’re spending almost all of your time blocked in “usleep()” (and are thus unavailable to do any real work).  Obviously that’s not a real solution to your problem.</div><br class=""><br class=""><div apple-content-edited="true" class="">
<span class="Apple-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-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;  "><span class="Apple-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-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;  ">Ross Finlayson<br class="">Live Networks, Inc.<br class=""><a href="http://www.live555.com/" class="">http://www.live555.com/</a></span></span>
</div>
<br class=""></body></html>