<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>I just checked the CPU frequency with lscpu and indeed when
running my code with the additional sleep, the clock stays at 800
MHz whereas without sleeps it bursts up to 4.7 GHz. I disabled the
clock stepdown and now the code runs with constant runtime
regardless of an additional sleep.<br>
</p>
<p>So, you guys were perfectly right!! Thanks a lot for the hint.
This saved me from dumping this project as a dead end.<br>
</p>
<p>My actual application does not use a sleep of course, but instead
captures multiple streams within different threads which wait on a
condition variable. But the problem and solution are the same.</p>
<p>Best Regards,</p>
<p>Lukas<br>
</p>
<p><br>
</p>
<div class="moz-cite-prefix">On 3/6/19 2:59 PM, Omar Álvarez wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAKrV3-=Mc_WEd9V=gg0MHptAiHmEca_8QMj_gVfdhBONhFOHQw@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">It is probably related to how turbo boost works.
You need to tune your OS for CPU latency (governor performance
on Debian/Ubuntu), it has to do with the delay changing between
low power states and performance states. When you sleep
continuously, you cannot reach peak CPU clock speed. When you
don't use the sleep, you are using peak clock speed all the
time.
<div><br>
</div>
<div>Cheers,</div>
<div><br>
</div>
<div>Omar. </div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">El sáb., 1 jun. 2019 a las
19:33, Paul Sanderson (<<a
href="mailto:nannapie@hotmail.co.uk" moz-do-not-send="true">nannapie@hotmail.co.uk</a>>)
escribió:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="auto">
I think Carl’s point is interesting. It could be something
funky with sleep which if I remember right is a Linux/
Debian based call. Maybe try a different method of making
your program hang and see if the problem persists.
<div><br>
</div>
<div>All my best,</div>
<div><br>
</div>
<div>Paul <br>
<br>
<div id="gmail-m_1335320627791674332AppleMailSignature"
dir="ltr">Sent from the top a castle using a moderately
sized European swallow </div>
<div dir="ltr"><br>
On 1 Jun 2019, at 16:17, Lukas Bommes <<a
href="mailto:lukas.bommes@gmx.de" target="_blank"
moz-do-not-send="true">lukas.bommes@gmx.de</a>>
wrote:<br>
<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div dir="auto">
<div>I'm just buffled because OpenCV uses the same
code <span style="font-family:sans-serif"> (in
fact I copied the retrieveFrame funtion from the
videoio module 1:1)</span> and it does not show
this weird behaviour. There, the runtime of
sws_scale is constant regardless of the calling
frequency and retrieving one frame takes always
around 1.3 ms.</div>
<div dir="auto">However, my OpenCV build (version
4.1) uses FFMPEG 3.4.6, not 4.1. So, I'm gonna try
building my code with FFMPEG 3.4.6 and see if the
problem persists. </div>
<div dir="auto">Alternatively, I add a function to
the OpenCV videoio module which retrieves frame +
motion vectors. However, altering the OpenCV API
brings a lot of other challenges.</div>
<div dir="auto"><br>
</div>
<div dir="auto">But maybe someone else has noticed a
similar issue with sws_scale in FFMPEG 4.1 before.</div>
<div dir="auto"><br>
<div class="gmail_extra" dir="auto">Lukas</div>
<div class="gmail_extra" dir="auto"><br>
</div>
<div class="gmail_extra" dir="auto"><br>
<div class="gmail_quote">On 1 Jun 2019 7:04 pm,
Carl Eugen Hoyos <<a
href="mailto:ceffmpeg@gmail.com"
target="_blank" moz-do-not-send="true">ceffmpeg@gmail.com</a>>
wrote:<br type="attribution">
<blockquote
class="gmail-m_1335320627791674332quote"
style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<p dir="ltr">Am Do., 30. Mai 2019 um 11:59
Uhr schrieb lukas <<a
href="mailto:lukas.bommes@gmx.de"
target="_blank" moz-do-not-send="true">lukas.bommes@gmx.de</a>>:</p>
<p dir="ltr">> I wrote a program which
extracts motion vectors from a video
stream and<br>
> encountered the problem that the
runtime of sws_scale changes depending<br>
> on whether I put a sleep command in
the main loop of the caller.</p>
<p dir="ltr">Shouldn't you ask this your CPU
provider?</p>
<p dir="ltr">Carl Eugen<br>
_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org"
target="_blank" moz-do-not-send="true">Libav-user@ffmpeg.org</a><br>
<a
href="https://ffmpeg.org/mailman/listinfo/libav-user"
target="_blank" moz-do-not-send="true">https://ffmpeg.org/mailman/listinfo/libav-user</a></p>
<p dir="ltr">To unsubscribe, visit link
above, or email<br>
<a
href="mailto:libav-user-request@ffmpeg.org"
target="_blank" moz-do-not-send="true">libav-user-request@ffmpeg.org</a>
with subject "unsubscribe".</p>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</blockquote>
<blockquote type="cite">
<div dir="ltr"><span>_______________________________________________</span><br>
<span>Libav-user mailing list</span><br>
<span><a href="mailto:Libav-user@ffmpeg.org"
target="_blank" moz-do-not-send="true">Libav-user@ffmpeg.org</a></span><br>
<span><a
href="https://ffmpeg.org/mailman/listinfo/libav-user"
target="_blank" moz-do-not-send="true">https://ffmpeg.org/mailman/listinfo/libav-user</a></span><br>
<span></span><br>
<span>To unsubscribe, visit link above, or email</span><br>
<span><a href="mailto:libav-user-request@ffmpeg.org"
target="_blank" moz-do-not-send="true">libav-user-request@ffmpeg.org</a>
with subject "unsubscribe".</span></div>
</blockquote>
</div>
</div>
_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org" target="_blank"
moz-do-not-send="true">Libav-user@ffmpeg.org</a><br>
<a href="https://ffmpeg.org/mailman/listinfo/libav-user"
rel="noreferrer" target="_blank" moz-do-not-send="true">https://ffmpeg.org/mailman/listinfo/libav-user</a><br>
<br>
To unsubscribe, visit link above, or email<br>
<a href="mailto:libav-user-request@ffmpeg.org" target="_blank"
moz-do-not-send="true">libav-user-request@ffmpeg.org</a>
with subject "unsubscribe".</blockquote>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Libav-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a>
<a class="moz-txt-link-freetext" href="https://ffmpeg.org/mailman/listinfo/libav-user">https://ffmpeg.org/mailman/listinfo/libav-user</a>
To unsubscribe, visit link above, or email
<a class="moz-txt-link-abbreviated" href="mailto:libav-user-request@ffmpeg.org">libav-user-request@ffmpeg.org</a> with subject "unsubscribe".</pre>
</blockquote>
</body>
</html>