Version: I'm currently using 76.0.3809.132
I did a diff between cefclient v76 and the latest v81 and didn't
see significant changes in the cefclient application that would
impact this functionality.
I am experiencing an issue with the CEF fps dropping from 60 fps
to 30 fps when a <video> element is included in the HTML AND the
video is playing. If I stop the video, then the fps goes back up
to 60 fps. If I start the video again, then the fps drops back down to
30 fps. If the <video> element is removed, then the fps is 60
as expected.
When the video is stopped, I am getting 1 OnPaint callback for every call
to SendExternalBeginFrame. When the video is playing, I'm getting
1 OnPaint callback for every 2 calls to SendExternalBeginFrame. The <video>
appears to be running at 60 fps, but the JS is only running at 30. This
is apparent with the counter values.
I am using OSR and external begin frame functionality.
CefSettings.windowless_rendering_enabled = 1
CefBrowserSettings.windowless_frame_rate = 60
CefWindowInfo.windowless_rendering_enabled = 1
CefWindowInfo.external_begin_frame_enabled = 1
I tried to recreate this with cefclient, but it appears that
cefclient does not truly support the external begin frame
functionality. I don't see the CefBrowserHost::SendExternalBeginFrame()
being called anywhere in the sample code. There are hints
of this functionality in the OsrRendererSettings class, but
these settings are not utilized.
This command line configures CEF fairly close to the way I am
using it (minus the external begin frame not working):
./cefclient (currently not using sandboxing)
--show-fps-counter
--url=http://10.10.55.149/GFX/gfx.dir/cef-webm/simple.html
--disable-gpu
--hide-controls
--off-screen-rendering-enabled
--off-screen-frame-rate=60
--transparent-painting-enabled
--external-begin-frame-enabled
--no-sandbox (DONE with cmake)
Here's the HTML that I am using. I can control the video playback
using the remote debugging:
var d = document.getElementById("video0");
d.play()
d.pause()
The counter is incremented every requestAnimationFrame cycle.
- Code: Select all
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>simple</title>
<style>
h1 {
color:white;
text-align: center;
font-size: 90px;
}
video {
margin-left: auto;
margin-right: auto;
display: block;
width: 480px;
height: 270px;
}
</style>
</head>
<body>
<h1>Simple Example</h1>
<h1 id="counter">0</h1>
<video id="video0" controls autoplay loop muted src="webm-in-html-480x270-30sec.webm"></video>
</body>
<script>
let count = 0;
let request;
const performAnimation = () => {
request = requestAnimationFrame(performAnimation);
document.getElementById("counter").innerHTML = count.toString();
count++;
}
requestAnimationFrame(performAnimation);
</script>
</html>
Has anyone experienced this same anomoly? I am definitely
not CPU bound. Using the DevTools performance, ticks are
only taking 6-7 ms when video is playing and I have verified
that I am calling SendExternalBeginFrame() every 16.66666 ms.
Thanks in advance,
Dan