-
Notifications
You must be signed in to change notification settings - Fork 271
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
Consumer shows countdown clock *skipping* times in the output #1441
Comments
Have experienced this issue too when displaying a count up timer with Lottie. I had been pulling my hair out over this! Temporary workaround is to re-render every 200ms instead of every 1 second, not ideal but better than missing a number completely! Windows 10, casparcg-server-v2.3.1-lts-stable |
Thank you for confirming! Good at least, to see it's not just me! I've seen some other examples where css animations to make things either fully opaque or transparent do not complete fully too, which is even more problematic in some ways, which I suspect may be rooted in the same problem. Would be really good if this issue can be fixed properly. Regardless of whether the underlying issue is CasparCG or CEF, it's eating into the reliability reputation (and therefore usability) of CasparCG, unfortunately! |
If I understand correctly, CEF is also used by OBS, so it might be interesting to see if the issue shows up in OBS. If you're interested in doing that, there's a small tweak to make regarding making the clock immediately start playing. Edit the .html file (in the zip), and in the I'm giving this a test locally, and so far, it seems that OBS (latest 27.x.x) is managing to show the clock without skipping times, but it would be good to have this confirmed by others. Of course, if this is confirmed, then it would suggest that something is up regarding how CasparCG is using CEF. |
It's possible #1431 is another manifestation of the same issue, as, it seems, in both cases, the updates being asked for are somewhat infrequent, and somehow, the expected result is not appearing in the output. |
If the timer is refreshed/sampled only each 1s, I would expect this behaviour, but not so much to be a problem. Visual explanation of skipping 1:
|
I agree that some things can be done to help mitigate the issue that CasparCG seems to be having. But, have you tried using OBS to do the same job? I did some testing, and it appears that OBS does not have the issue we're talking about. Since OBS and CasparCG are conceptually doing similar, and both using the Chromium embedded browser to do it, I have to wonder if there's something else in CasparCG that's causing the issue, or, perhaps a configuration issue that's causing this errant behavior in CasparCG's use of Chromium embedded browser? Give OBS a try with something that causes issues in CasparCG and see how it goes, and report back. It would be good to have confirmation of what I've observed, and this might help point to something that CasparCG is doing different, and can be fixed. |
I think we have finally been seeing this issue and I have an idea of the cause. I think (do not know how to verify) this is caused by the changes OBS made, to output a single texture. They are issuing an async copy to this texture, then CEF tells us about the new frame without waiting for this to complete. In theory the answer is simple, rebuild CEF without those OBS patches and hopefully we will go back to the previous behaviour. |
Hey Julian, What you've described sounds very reasonable ways that CasparCG might be getting into a situation of not seeing all rendered frames. Have you had a chance to try out your possible solution? I'm very keen to see this issue fixed. |
I have tried but have not had any luck producing a build of CEF that works. This is taking a while as a full compile of CEF takes about an hour on my i9-10920x, which needs to be done when switching between version branches. I am considering attempting an even newer version of CEF, but the shared-texture patch we use needs completely rewriting for this, which may not be a viable route to go for now I will be continuing on this during the week |
Hey Julian, I saw the update you provided a handful of hours after you made it. Thank you for the update! I appreciate the effort involved in fixing this problem. Any additional news to add? I did have a bit of a tinker with the CEF project, trying out their sample project, and managing to get their bare-bones client to work, seemingly, with the off-screen-rendering. I was reading about some switches, and the ability to use D3D on windows, but OpenGL on other platforms, regarding doing the buffer copies when rendering off-screen. I'm guessing you're fully aware of that sample though... I saw some info that suggested that on Windows, the D3D copy buffer was faster than the equivalent OpenGL way of doing it, but, I really don't know much about that. Makes sense that on a windows system that using their own API would be faster, but whether it's a significant difference or not, well, that's another story. And, I guess you need a platform-agnostic way to do it anyhow. |
any progress? |
Not much has progressed on this. The core of the issue is that the upstream cef builds have a broken shared texture implementation, so we are using some oba builds of CEF which has fixed it. The bigger problem is that the patches obs are using are incompatible with any newer versions of chromium. Chromium has finished migrating drawing subsystems, so the whole approach to shring textures needs rewriting from scratch. This is a very big and complex task. Maybe we could get something working with the current cef builds, so far I have not had any success. Alternatively, I am considering if using qtwebengine instead of CEF is a better approach, as they seem to have this all figured out. This could introduce new system requirements, and is looking to require other internal changes to let qt play well with the rest of caspar. This is something I am playing with, but don't have anything to share yet. |
I have a PR which updates CEF and makes some changes to how frames move between CEF and caspar. I used this issue as a test case and I believe it no longer occurs. |
I created an html template that uses three.js to produce a countdown clock that has 3d text.
The template code has been created so that rather than re-rendering on every frame, the rendering only happens when the time changes (ie: once per second) as a way of reducing the GPU load.
Problem is: the clock output appears to be skipping some times entirely in the output!
Expected behaviour
Every second of the countdown should appear in the output
Current behaviour
Some seconds of the countdown output are not shown in the consumer output
Steps to reproduce
Environment
Note: this is not a new problem introduced with the above commit, but, since the CEF has been updated, I figured I'd mention that I've tested it with the above version too, and find it's skipping the output too.
Also, I've seen this behavior happen where the template is much simpler, and it's just doing 2D text output.
Screenshots
Screen recording of a web browser (top), then the screen consumer (bottom) and the CasparCG log in the background,
showing that it's not skipping over any times, but, watch long enough, and you'll see when the CasparCG output does not appear, and the time sticks for an extra second.
Check out the clock at 00:07 of the recording, and you'll see what I'm talking about!
Screen.Recording.2022-10-23.at.09.39.36.73.PM.mp4
The text was updated successfully, but these errors were encountered: