Route camera video to ubuntu VM (192.168.2.3)

How do I route the video stream to an ubuntu virtual machine running on my windows laptop?

I have a custom QGC running on the ubuntu VM. The raspberry pi is running Companion Version 0.0.31. I have changed the gstreamer options on the webpage 192.168.2.2:2770/camera to point to

  udpsink host=192.168.2.3 port 5600

The VM ip = 192.168.2.3

and doing a ps -ef | grep udpsink I see that ip beign used instead of 192.168.2.1 but still no video. All the other communication between the pi/pixhawk/QGC works fine.

Any help would be appreciated.

Hi @Tautala,

The line should be

! udpsink host=192.168.2.3 port=5600

Yours is missing the exclamation mark at the start, and the = for the port.

You’ll also need to make sure the VM has shared / bridged access to the laptop’s network, or direct access to the ethernet connection, otherwise it won’t be able to connect. I assume that’s not the issue though, or the telemetry to QGC wouldn’t be able to get through.

There’s also some possibility you have a firewall or some other network setup that’s preventing external access to the 5600 port, although that’s unexpected if you haven’t set that up yourself.

The exclamation mark is in the actual line, I missed it during cut and paste.

Here is the output of ps -ef

pi@raspberrypi:~ $ ps -ef | grep udpsink
pi 978 973 6 Oct05 pts/5 01:32:12 gst-launch-1.0 -v -e alsasrc device=hw:1,0 ! audioconvert ! rtpL16pay ! udpsink host=192.168.2.1 port=5601
pi 1239 943 0 Oct05 pts/1 00:00:00 bash -c export LD_LIBRARY_PATH=/usr/local/lib/ && gst-launch-1.0 -v v4l2src device=/dev/video1 do-timestamp=true ! video/x-h264, width=1920, height=1080, framerate=30/1 ! h264parse ! queue ! rtph264pay config-interval=10 pt=96 ! udpsink host=192.168.2.3 port=5600
pi 1242 1239 6 Oct05 pts/1 01:26:53 gst-launch-1.0 -v v4l2src device=/dev/video1 do-timestamp=true ! video/x-h264, width=1920, height=1080, framerate=30/1 ! h264parse ! queue ! rtph264pay config-interval=10 pt=96 ! udpsink host=192.168.2.3 port=5600
pi 16748 7492 0 18:17 pts/13 00:00:00 grep --color=auto udpsink

It looks like the video should be getting there. I will check firewall and stuff. It is a bridged adapter with Promiscuous Mode = Allow All.

I notice the audio didn’t change IP but that isn’t a problem for me.

Thanks
Wayne

1 Like

Ok, fair enough.

Alrighty then. Curious as to why you’ve chosen to run in an Ubuntu VM - is that primarily because you prefer a Linux development environment? Have you tried the normal Companion setup with non-custom QGC in the base Windows os to confirm whether the video is working at all? There could also be a hardware issue with the camera, cable, or USB port.

Yeah, needing to change hardcoded IP addresses in code files is a known inconvenience in the Companion Software, but it didn’t get fixed before development switched over to BlueOS.

Building ArduSub seemed to be easier on an Ubuntu machine and I’m not a huge fan of windows for development. I tried to build on a windows machine but got a gajillion error messages that I didn’t have the desire to deal with.

Video work on the windows host with the current release QGroundControl.

Is there a startup script for the audio that I can edit? It’s not a problem now so no rush on that.

I appreciate your help Eliot

Fair enough, you’re certainly not alone in that :stuck_out_tongue:

Building QGC should be reasonably straightforward if the instructions are followed exactly. It’s possible the ArduSub build process has some issues on Windows at the moment though - I’m not certain.

Good to have confirmed, thanks :slight_smile:

In that case I’m not sure what could be the case beyond network configuration, be that IP setup, the bridging not working as expected, or some kind of firewall.

Yep, should work to just change the IP at companion/scripts/start_audio.sh.