Closed hcao720 closed 1 year ago
This better belongs on StackOverflow, but I'll answer the question anyways.
In order to run a python loop at a certain FPS, you can delay based on the time taken for a process.
import time
MAX_FPS=60
MIN_FRAME_TIME=1/MAX_FPS
while True:
start = time.time()
# screen capture
time.sleep(max(0, MIN_FRAME_TIME - (time.time() - start)))
Hope this helps :)
Thanks!!!☺️
在 2020年10月22日,10:41,Sagar Patil notifications@github.com 写道:
This better belongs on StackOverflow, but I'll answer the question anyways.
In order to run a python loop at a certain FPS, you can delay based on the time taken for a process.
import time MAX_FPS=60 MIN_FRAME_TIME=1/MAX_FPS
while True: start = time.time()
time.sleep(max(0, MIN_FRAME_TIME - (time.time() - start)))
Hope this helps :)
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/BoboTiG/python-mss/issues/181#issuecomment-714184895, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AMY3RA3NXH4XAJOTNG7FVRTSL6LWDANCNFSM4QAZVOZA.
Is there any way to capture the screen with a specific fps by applying mss?