You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using wpewebkit 2.22.3 with the cog launcher with the following options the mjpg-streamer jpeg image stream flashes rapidly as new images are received:
I tried a number of options and for some reason using this prevents the flashing and shows the proper stream without flickering(there are grid overlay lines present when doing so however):
Any idea why setting --draw-compositing-indicators=true prevents the stream from flickering rapidly and how I might get it to stop flickering without the compositing indicator grid?
Thanks for pointing out the setting for the draw-compositing-indicators setting, which helps narrowing down the cause. Most likely the additional painting done to have the compositing indicators drawn (inside WebKit) is doing something that somehow better synchronizes the frames, or maybe it prevents a blank frame from being painted. I think @magomez and/or @zdobersek may have some idea on how to further investigate the issue.
@jameshilliard Could you please indicate which options are you using when running mjpg-streamer? I would like to use the same settings as you to check whether the issue is also present in upstream WebKit.
The bug happens with both the <img src="./?action=stream" />multipart/x-mixed-replace mjpeg stream and the javascript version that works by replacing the image individually from the /?action=snapshot endpoint.
I would like to use the same settings as you to check whether the issue is also present in upstream WebKit.
I did check using the latest safari, chrome and firefox and none had this bug.
So I did manage to fix the flicker for the javascript stream with this change. This doesn't seem to effect the multipart/x-mixed-replace flicker bug however.
I'm launching wpewebkit with this option for the javascript stream:
My guess would be that this bug has something to do with the images from mjpeg-streamer coming in faster than wpewebkit is capable of rendering them which is causing the background to flash white.
I came up with another hack to workaround the bug using HTML5 canvas with the multipart/x-mixed-replace stream. Hopefully this helps narrow down the root cause.
I can confirm the flickering issue running WPE WebKit v2.24.3 with wpebackend-fdo 1.2.3 and libwpe 1.2.x. I can also confirm both workarounds that @jameshilliard posted do resolve the issue (though the draw-compositing-indicators isn't really an option for production).
I just tested with the latest WPE 2.26.x | libwpe 1.4.x | backend-fdo 1.4.x | cog 0.4.x and the flicker issue still occurs across all tested MJPEG streams. Appreciate any pointer where to start debugging @magomez / @zdobersek 😊
@tobias-grasse did you make any progress on this issue? I've ran into the same issue of wpe not being able to handle the amount of frames I'm sending from the rtmp stream.
@urothis unfortunately not; but most streams are working flicker-free with the canvas workaround. It's significant overhead compared to just <img src="">, but my use case requires some JS logic to control the stream anyway. Note I'm still testing against WPE 2.26.4 though; 2.28.x fails to build on armhf architecture snapcraft builders. Will update here if that version bump changes anything w.r.t. this issue.
Activity
aperezdc commentedon Jan 27, 2019
Thanks for pointing out the setting for the
draw-compositing-indicatorssetting, which helps narrowing down the cause. Most likely the additional painting done to have the compositing indicators drawn (inside WebKit) is doing something that somehow better synchronizes the frames, or maybe it prevents a blank frame from being painted. I think @magomez and/or @zdobersek may have some idea on how to further investigate the issue.@jameshilliard Could you please indicate which options are you using when running
mjpg-streamer? I would like to use the same settings as you to check whether the issue is also present in upstream WebKit.jameshilliard commentedon Jan 27, 2019
I'm running mjpg-streamer with these options:
The bug happens with both the
<img src="./?action=stream" />multipart/x-mixed-replacemjpeg stream and the javascript version that works by replacing the image individually from the/?action=snapshotendpoint.I did check using the latest safari, chrome and firefox and none had this bug.
jameshilliard commentedon Jan 28, 2019
So I did manage to fix the flicker for the javascript stream with this change. This doesn't seem to effect the multipart/x-mixed-replace flicker bug however.
I'm launching wpewebkit with this option for the javascript stream:
My guess would be that this bug has something to do with the images from mjpeg-streamer coming in faster than wpewebkit is capable of rendering them which is causing the background to flash white.
jameshilliard commentedon Feb 1, 2019
I came up with another hack to workaround the bug using HTML5 canvas with the
multipart/x-mixed-replacestream. Hopefully this helps narrow down the root cause.tobias-bischoff commentedon Jan 10, 2020
I can confirm the flickering issue running WPE WebKit v2.24.3 with wpebackend-fdo 1.2.3 and libwpe 1.2.x. I can also confirm both workarounds that @jameshilliard posted do resolve the issue (though the
draw-compositing-indicatorsisn't really an option for production).I don't have a local MJPEG stream, but testing with this public cam showed the same behavior:
http://217.7.233.140/cgi-bin/faststream.jpg?stream=full
It also has the
multipart/x-mixed-replacecontent type.Another cam at http://194.103.218.15/mjpg/video.mjpg which has just
image/jpegalso flickered on WPE, which was resolved with @jameshilliard 's canvas workaround.Will update to the latest stable WPE + libs next week and check if the issue persists.
[Edited since I referenced the wrong WPE versions initially]
tobias-bischoff commentedon Jan 13, 2020
I just tested with the latest WPE 2.26.x | libwpe 1.4.x | backend-fdo 1.4.x | cog 0.4.x and the flicker issue still occurs across all tested MJPEG streams. Appreciate any pointer where to start debugging @magomez / @zdobersek 😊
urothis commentedon Aug 18, 2020
@tobias-grasse did you make any progress on this issue? I've ran into the same issue of wpe not being able to handle the amount of frames I'm sending from the rtmp stream.
tobias-bischoff commentedon Sep 1, 2020
@urothis unfortunately not; but most streams are working flicker-free with the canvas workaround. It's significant overhead compared to just
<img src="">, but my use case requires some JS logic to control the stream anyway. Note I'm still testing against WPE 2.26.4 though; 2.28.x fails to build on armhf architecture snapcraft builders. Will update here if that version bump changes anything w.r.t. this issue.tobias-bischoff commentedon Feb 26, 2021
Unfortunately, this is still an issue with WPE 2.30.5 / cog 0.8.1 and libwpe/wpebackend-fdo 1.8.0.
gruvin commentedon Mar 28, 2022
Easy workaround; Turning off Chrome's Settings => Advanced => System => "Use hardware acceleration when available" fixed this for me. ymmv
kamk commentedon Jan 6, 2023
I have tried to continuously reload image frame by frame with this code:
This doesn't resolve the problem with flickering so it can be something with
<img>tag rendering.Snaps used: