Webcam button capture signal

I have a webcam and it has a button. On Windows, when I click this button, it captures a snapshot of the image. But now I'm on Linux, and I use VLC to watch video from the usb / dev / video0 webcam. I would like to use python to get the signal from this button after clicking - I mean just get this signal (without capturing the snapshot automatically). I tried to do it, but no luck. I do not want to use opencv or gstreamer to receive video in a new window, I just need to capture the signal when the button on the webcam is clicked. Any idea how to get this signal, please?

+2
source share
1 answer

with python-evdevyou can capture events triggered by input devices such as a mouse, keyboard, ..., as well as webcams

evdev - Linux, ​​ . , , , , , - . node /dev/input/event 0, , . node , node script. root, root .

http://who-t.blogspot.de/2016/09/understanding-evdev.html

- , /dev/input/

http://python-evdev.readthedocs.io/en/latest/tutorial.html, /dev/input -:

 import evdev

 devices = [evdev.InputDevice(fn) for fn in evdev.list_devices()]
 for device in devices:
     print(device.fn, device.name, device.phys)
+1

Source: https://habr.com/ru/post/1726144/


All Articles