Using udev to make sure my webcam always has the same device name
On ubuntu, I added a new file /etc/udev/rules.d/50-webcam.rules
SUBSYSTEM=="video4linux" ATTR{name}=="OV511 USB Camera" SYMLINK+="ov511_webcam"
As you would find after reading this helpful udev guide the above rule causes udev to match any devices in the video4linux subsystem that have a name attribute set to “OV511 USB Camera” and create a symlink /dev/ov511_webcam pointing to the real device whatever that might be. I could have also forced it to name the device /dev/video1 using the NAME= command instead of SYMLINK.
Thanks to Florian Kulzer and Nigel Henry on this debian support thread for the help.
