Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML animations sometimes get stuck on the last frame #1454

Closed
oscarwcl opened this issue Dec 16, 2022 · 0 comments · Fixed by #1499
Closed

HTML animations sometimes get stuck on the last frame #1454

oscarwcl opened this issue Dec 16, 2022 · 0 comments · Fixed by #1499
Assignees

Comments

@oscarwcl
Copy link
Contributor

oscarwcl commented Dec 16, 2022

Expected behaviour

Animations always play to completion

Current behaviour

When playing an animation with the HTML producer, the animation will sometimes freeze on the final frame, which will stay on-screen until another update to the HTML page occurs. This only happens on Windows with enable-gpu set to true.

My best guess for what's happening is that when CEF calls OnAcceleratedPaint, sometimes the GPU hasn't yet executed the write to the shared texture, so caspar might end up reading an old frame when it goes to copy the frame into its queue. Because OnAcceleratedPaint is only called whenever the content changes, caspar stays on this old frame until there's another update to the HTML page.

I suspect that #1431 and #1441 are caused by the same root issue.

Steps to reproduce

  1. Create a HTML file with the following content:
index.html
<!DOCTYPE html>
<style>
@keyframes grow  {
    0%, 25% {
        transform: scale(0);
    }

    75%, 100% {
        transform: scale(1);
    }
}

.test {
    animation: grow 2s cubic-bezier(0, 1, 1, 0) infinite alternate;
    width: 500px;
    height: 500px;
    background-color: red;
}
</style>
<div class="test"></div>
  1. Start caspar with enable-gpu set to true on the HTML producer

  2. Play the above file: PLAY 1-1 [HTML] file:////path/to/index.html

  3. Observe that sometimes the red square will stop mid-animation. It seems highly variable how often this happens but should occur at least once within a couple of minutes.

Environment

  • Commit: abc3582
  • Server version: 2.3.3
  • Operating system: Windows 10 21H2 (19044.2251)

We have also reproduced this on the 2.3.3 stable release, but it seems more common on the above commit.


Screenshots

See 0:09 and 0:18 in the video:

caspar_animation_freezing.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants