Unsolved Use symlink for camera deviceId
-
Hi all,
usually I write:
camera.deviceId = "/dev/video1"
Now I created some symlinks in my Linux.
Is it possible to use these symlinks for the camera deviceId?camera.deviceId = "/dev/camera_usbport2"
Because every time I try to use these symlinks camera.deviceId is set to "/dev/video0" and not to the symlink or the correct device "/device/video1".
Kind regards,
MHermann -
@MHermann I don't understand your problem description.
You created a symlink /dev/camera_usbport2 pointing to /dev/video1, is that correct?
You assignedcamera.deviceId = "/dev/camera_usbport2"
right?
Then what does this mean "Because every time I try to use these symlinks camera.deviceId is set to "/dev/video0""? Where is it set wrongly? -
@jsulm : Yes, I created a symlink "/dev/camera_usbport2" that points to "/dev/video1".
Then I try to assign this symlink to the camera:camera.deviceId = "/dev/camera_usbport2"
But that does not work.
If I am looking into camera.deviceId after this line, camera.deviceId is always "/dev/video0".I searched for "/dev/video0". I have no line in my code where I assign "/dev/video0" to camera.deviceId.
Maybe it is using the default camera in case the deviceId is not valid? -
Hi,
The enumeration is done through GStreamer so it might not care about your symlink at all. If you want to change the name of the device used by the system you may have to modify your device manager in order to change the name used globally.
-
@SGaist : It's not because of changing the name of the device.
I defined a .rule, so that each USB port has a fix name.
I want to avoid that one time a camera is video0 and the next time it is video1. -
Or is there an other way to make sure, that a camera, that is connected to USB port 1 has always the same device name?
-
@MHermann said in Use symlink for camera deviceId:
Or is there an other way to make sure, that a camera, that is connected to USB port 1 has always the same device name?
Not using Qt, it's an OS thing
-
-
Likely because an additional symlink doesn't make it an id.