Zend certified PHP/Magento developer

Linux camera device tree numbering

I am trying to identify a /dev/video camera by the USB vendor:product IDs and I learned that the sysfs has that information, e.g.:

cat /sys/class/video4linux/video0/device/input/input17/id/vendor
cat /sys/class/video4linux/video0/device/input/input17/id/product

However, as you can see, in my example I have the child .../input/input17/... and that number seems to be different for all the cameras I have. There seems to be exactly one directory within input.

But can I rely on that, so that I can just use the pattern input/input*/...? Where can I learn more about the structure?