

If cam.child_window(title="Switch to Video mode", auto_id="CaptureButton_1", control_type="Button").exists():Ĭam.child_window(title="Switch to Video mode", auto_id="CaptureButton_1", control_type="Button").click()Ĭam.child_window(title="Take Video", auto_id="CaptureButton_1", control_type="Button").click()Ĭam.child_window(title="Stop taking Video", auto_id="CaptureButton_1", control_type="Button").click() # take control of camera window to take videoĭesktop = pywinauto.Desktop(backend="uia") # handle = _windows(title=t, class_name=c) # t, c = 'Camera', 'ApplicationFrameWindow' # subprocess call opens camera and gets focus, but this provides alternate way # focus window by getting handle using title and class name Action screen recorder brings the ultimate experience for PRO gamers with Logitech G13/G15 or G19 multimedia keyboards. n('start :', shell=True) # open camera app The last bit of the script does some error-checking to confirm the video successfully recorded by checking the timestamp of the name of the video. However, it will only work on Windows because it uses pywinauto and the built-in Windows Camera app.

I came up with a new solution that records much more reliably and with much higher quality.

The keyboard is for some reason sending 'Super (flag) key + Shift + O' instead of a. Open Logi Option + Keys Choose the camera button, which is F7 Scroll down and choose screen capture.
Logitech screen recorder install#
Another issue is that openCV does not capture video frames at a reliable rate and ffmpeg would distort the video when re-encoding. The only option to get PrtScn functionality back, is to install the proprietary Logitech Options Software, and remap this specific Key to actually to a PrtScn. I used it for a while on a project however, I noticed that sometimes the threads would hang and it would cause the program to crash. As mentioned above, there is a solution from JRodrigoF that uses openCV to record video and pyaudio to record audio.
