Im new here and building a ROV originally based on OpenROV but have since changed the direction of the project to use ArduSUB and QGC. I have a Logitech C920 webcam which has a great picture. I am fairly new to Rasp Pi and cant find any threads on forums on how to get it to work.
I have burnt the ardusub image to SD card and can log into Rasp Pi using a small monitor and keyboard. I understand that the build is using gstreamer. Any ideas where to look for how to test the picture? or configure the RPI to output the correct format?
From what I gather it is a H264 webcam and its powered through a USB powered hub to stop brownouts.
Is it worth/easier if I just buy a normal RPI cam?
You will need to construct a gstreamer pipeline to stream H264 encoded video to UDP port 5600 of your surface computer.
You will first need to find out which device on the RPi corresponds to the H264 video output of the webcam. Here is an example of how to do this on a laptop computer with a built in webcam (/dev/video0), and a connected USB webcam with two output formats (/dev/video1 and /dev/video2). The output shows that the device supporting H264 output that we want to read from is /dev/video2.
jack@jack-Q502LA:~$ ls /dev/video*
/dev/video0 /dev/video1 /dev/video2
jack@jack-Q502LA:~$ v4l2-ctl --list-formats --device 2
ioctl: VIDIOC_ENUM_FMT
Index : 0
Type : Video Capture
Pixel Format: 'H264' (compressed)
Name : H.264
jack@jack-Q502LA:~$ v4l2-ctl --list-formats --device 1
ioctl: VIDIOC_ENUM_FMT
Index : 0
Type : Video Capture
Pixel Format: 'MJPG' (compressed)
Name : MJPEG
Index : 1
Type : Video Capture
Pixel Format: 'YUYV'
Name : YUV 4:2:2 (YUYV)
Then you need to launch a gstreamer pipeline using the selected video device as input, it will look something like this, but you may need to change some things (particularly in the caps field, surrounded by double quotes) depending on your hardware:
Finally, once you have a video stream working to your satisfaction, you will need to modify the startup scripts to launch your modified pipeline instead of the default raspivid pipeline.
If doing this sort of thing or referring to the gstreamer API documentation is out of your comfort zone, then I would suggest buying a Raspberry Pi camera.
QGC only handles H264-encoded streams, so no mjpeg support. As far as I know, that webcam is capable of H264 output, it may take some probing to get it to play nice though.