Open vision34 opened 6 years ago
Hello,
If you remove all stuff non related to MSS, do you still see the lag?
Yes (i have used webcam as the source and it works fluently), it looks like when screen is captured, it freeze display for a little time...
of course webcam is much worse solution, in case of wrong color recognition...
I reproduced but this is because MSS is too good :)
Your best option is to reduce the number of screenshots. A time.sleep(0.01)
or time.sleep(0.05)
.
The thing is to reduce the number of screenshots to the minimum required, e.g. the eye can get only 24 images per seconds. So if you can take only 24 screenshots by seconds, the whole thing will seem more fluid.
Thank you very much, but using gtx 1080 and 4k resolution even 0.5 s time.sleep makes it laggy...
https://github.com/vision34/AmbiPy/blob/master/AmbientLedProcessor.py here is my simple code
@vision34 I seem to experience the same issue. When I resize windows or drag windows or play games, the animation seems laggy. I'm also using gtx 1080, and capturing the screenshot every 0.4 s.
General informations:
What i have done? Own implementation diy ambilight using mss screengrab
Description of the warning/error
Threaded screen capture is very laggy while gaming
Full message
When i create a threaded class to capture the screen as fast as possible, it is makes my screen resposiveness very laggy... I can not play well. After making a sleep : Time.sleep(0.5), it does not slow down gaming, but reaction time for leds is too slow...
Pseudo code:
Upvote & Fund