Now that the server is running with parameters as Didikunz suggested, GPU rasterization is working. However, Iâm still facing a stuttering issue with the simple text animation in HTML template. The animations only run smoothly when I open the FPS meter in Developer Tools.
Hereâs the HTML code. Would you mind testing it?
First of all, thank you @knoepsche for your time and testing this HTML.
I tried to use Web Animations API, as you suggested, but noticed that if you slow down the animation speed, then this library is also stucking while scaling.
So, the main issue is something at the rendering side because when we enable the FPS meter or other options in the rendering tab in the developer tools or when we open the same file in the browser then animation is smooth and fine with any library.
Can we know what changes happen when we enable options in the Rendering tab?
I was testing this animation issue and found that OBS v30.2.3 plays the animation very smoothly, the same as in the Chrome browser. So after checking the chrome://gpu/ status, I noticed the difference between OBS and CasparCG is that in OBS, WebGPU is disabled.
Maybe WebGPU does indeed have performance issues compared to WebGL or WebGL2? However, I donât know how to disable WebGPU for testing animation in CasparCG. Does anyone here know how to do it?
Using the --disable-frame-rate-limit flag makes animation smooth but requires additional hardware resources, so I think the frame rate limit should be capped.
The CEF --disable-frame-rate-limit flag generally wonât increase the output frame rate of CasparCG. This attempts to remove any artificial limits on the frame rate at which CEF renders in html template. this allows CEF to render as fast as the hardware allows.
In this case, it is helping to render the animation smoothly, regardless of why the animation is stuttering, but this isnât a good approach because disabling the frame rate limit is leading to higher CPU and GPU usage.
I had troubles with HTML animations (crawls and rolls) in 2.3.0. too. But there were randomly drops one max two frames somtetimes. This problem disappeared with version 2.4, but a new one appeared, described above by gfurg - 250-500 ms freezing when gpu is enabled. The problem occurs repeatedly, always at exactly in the same point in the animation. For example, in the case of a crawl (roll), every time the last character (row) appears on the screen.
I have tested this simple example: Roll01.html (2.1 KB)
in both 2.3.0 and 2.4.2 now.
There is an irregular, occasional tiny twitch in the 2.3.0 while in 2.4.2 goes everything and everytime very smoothly BUT there is ONE BIG jump everytime, after the last row appears on the screen.
Could someone please try them on their device with version 2.4. (enable-gpu=true) and tell me whether the big stutter when the video stops (Webm01) or when the right edge of the red rectangle appears (Translate01) also appears or not? (notes on settings are marked with exclamation marks in the comments).
It looks like the HTML stuttering issue in CasparCG is getting some much-needed attention! Thereâs an open bug report on the CasparCG GitHub (#1583) that directly addresses this problem, specifically when the GPU is enabled. Weâre hopeful that Julusianâs work on this will lead to a fix in an upcoming release. Itâs very likely that the issues many of you are experiencing are related to this.
Interestingly, OBS faced a similar HTML stuttering problem in OBS v31.0. that was resolved in their latest version, v31.0.3. They used this Singular.live page for testing and identifying the stutter. This provides us with a great way to independently verify if your issue is the same.
To help diagnose if your particular stuttering is related to the GitHub issue, I recommend the following test:
Test your HTML sample file (or the Singular.live page linked above) in OBS v31.0. Note if you see the stuttering.
Then, test the same file or content in the latest OBS v31.0.3.
If your issue is present in OBS v31.0 but not in v31.0.3, then itâs a strong indicator that what youâre experiencing is indeed the same core problem being tracked in the CasparCG GitHub issue. This will help us confirm and prioritize the fix within CasparCG.
I can confirm that if I play the linked remote page on Singular.live on my CasparCG 2.4.2 with enable-gpu=true, the described problem occurs. With enable-gpu=false not.
Julusian wrote âMany people have been using 2.4 with its CEF117 with varying complexity of templates without issueâ on the GitHub, but I think it could be a very complex template where the problem wonât appear simply because specific conditions arenât met there and conversely, one sufficiently long div with css transformation will reliably invoke it - see my example Translate01.html above.
Iâm not skilled enough to imagine how difficult an edit similar to that in OBS would be in casparcg at least for testing.