'moving a camera while gstreamer pipeline is running

I have a camera I want to control the movement (PTZ) while gstreamer is handling a video stream.

My program has a gstreamer pipeline which works and some code using libuvc to move the camera (15 seconds after the program started). I tried the libuvc code independently and it works. The program does not need root privileges because I made udev change the permission of the camera when it's plugged.

When I run the program the pipeline display the camera feed on the screen and after 15 secondes the camera moves a bit as intended. Except the video stream stopped.

After that it is impossible to rerun the program. When I do I get Cannot identify /dev/video0 and the video stream does not start. But the camera is still able to move after the 15 seconds.

I checked the camera using:

ls /dev/video0

and

v4l2-ctl --list-devices

But once I run the program the camera disappear from the results

Unplugging and plugging back the camera does not fix the issue. I have to reboot the computer to make it work again

I guess opening the device using libuvc (which internally use libusb) is messing with v4l2. Am I doing things right or is there another way to control a camera which is comptabible with gstreamer?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source