A
A
Arseniy2013-08-29 12:27:49
linux
Arseniy, 2013-08-29 12:27:49

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

Hello. I'm writing a small GUI for managing server systems under Linux in Python. The task was to display a list of installed cameras in the camera management interface, which would contain at least the path to the device in dev and data from lsusb. But how do you determine which device in /dev/videoX belongs to which device in lsusb? Naturally, the script is BASH or Python (by reading the necessary files or capturing the output of all the commands necessary for this with subprocess and parsing their contents). Well, or you can tell how to do it. To be honest, I guess that this can be done by parsing lsusb -v, but I have not gone off the rails so many lines to parseI don't show yet. how to parse such a volume ;'-( I also found the udevadm info -q path -n /dev/video0 command, but I don’t know how long it would be, I’ll smoke man udevadm.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Arseniy, 2013-08-29
@CRImier

All found!
udevadm info -q all -n /dev/video0 displays all information, including VID and PID. It remains only to parse.
I'll leave the question - suddenly come in handy.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question