How to establish a link between /dev/video0 and lsusb entry in using BASH or Python

Hi all. I'm writing a small GUI to control systems for Linux in Python. There was a problem — in the management interface of the cameras display a list of installed cameras, which would be at least the path to the device in dev and the data from lsusb. But how to determine which /dev/videoX device which lsusb is? Of course, a script is BASH or Python (read required files or seized through subprocess output all the necessary commands and responsiv their contents). Or you can suggest how to do it. To be honest, I guess it can be done responsiv lsusb -v, but I yet have his wits about him so many lines to parse is not present. how to parse this volume ;'-( Even found the command udevadm info-q path-n /dev/video0, but I don't know how it would Pomaga, will smoke man udevadm.
October 3rd 19 at 04:11
1 answer
October 3rd 19 at 04:13
All naseel!
udevadm info-q all-n /dev/video0 displays all the information, including VID and PID. It remains only to parse it.
Question leave — suddenly come in handy.

Find more questions by tags LinuxUSBVideo