Camera connection with Raspberry pi 4B

Hi.

Qgroundcontrol version: 4.2.4
Pixhawk 2.4.8
Raspberry pi 4 Model B
Elp 170 USB Camera

I connected USB Camera to Raspberry pi. Pixhawk connected with USB to Raspberry pi. Pi connected topside computer(Windows) with ethernet.

The problem is, i cant see any video in qgroundcontrol. When i connect the camera to my Windows, i can see clear video without any problem. Pi can see the camera but i cant get any video from it.
I cant get any video but, i can get some weird white dot running around on black screen.

I add source from the video menu: udp://192.168.2.1:5600 and H264.

Pleaase find attached files. Any help would be grateful…




image-2

Hello @enseri, it seems to be just a configuration issue:

  1. Remove the “Fake” stream, that’s the “weird white dot running around on black screen”, which is a test video being generated (and encoded) in the raspberry pi. This is particularly useful to test the vehicle setup when lacking cameras, but it uses a lot of CPU power, so if you need to use it for some test, please prefer to use 240p instead of 1080p, and delete it after use, otherwise, the system can become less responsive.
  2. Create your H264 1080p stream from your “HD USB” Camera (it’s the first column in your second image) with the same endpoint udp://192.168.2.1:5600.

If H264 is not an option for your particular camera, you can select MJPG or YUYV and add an RTSP endpoint instead of UDP: rtsp://blueos.local:8554/HD_USB.

Hope it helps, thanks!

Hi @joaoantoniocardoso , thank you for replying.
Unfortunately, when i try to select MJPG or YUVY in HD Camera section, the site says “Only H264 encode is supported now, used: MJPG” . And, the camera cant added. It happens in any size settings(1080p,720p or lowest setting).

In addition that, I cant see USB camera from the blueos video page. I can only see it when i enter avaliable services, and mavlink camera manager.

I was being suspicious about the raspberry and software. I changed pi, deleted completely and re-upload BlueOS software. But nothing changed.

Sorry for my ignorance. I dont really understand the comminication and mavlink about my pc and pi. I dont understand the gst-streamer, v4l2-ctl tools as I looked in other topics. Should I download gst-streamer or v4l2 to my pi? Which tools should I download my pc and pi? Maybe this is because I didnt add bridges for comminication? I think I stucked in the mud.


Sorry, my mistake here - your BlueOS version is older than I though. MJPG is only available in more recent beta versions, can you upgrade it to the latest beta version (1.1.0-beta.15)? To do so you need to go to the version chooser page and click “DOWNLOAD AND APPLY” for 1.1.0-beta.15.

After upgrading to 1.1.0-beta.15, you will be able to configure your camera with MJPG encoding just as shown in this other post.

Since you mentioned communication, specifically about the streams, on the latest BlueOs, the Video configuration page should automatically suggest the right IP, but just to mention:

  • for UDP endpoints, the IP needs to be the local network IP of the computer running QGC;
  • for RTSP endpoints, the IP needs to be the local network IP of the ROV (blueos.local can be used here).

Let me know if you need more guidance, thanks!

2 Likes

Thank you for replying.
I upgraded the version and the settings are changed. First, there is not a H264 option. Only MJPG and YUVY. I selected MJPG first, but the video didnt open. It gives me these errors:

resim
resim

Then, I switched MJPG to YUVY. Sometimes it says non-video device avaliable even the camera is plugged in. Sometimes it gives me errors as i mantioned in the MJPG.

After getting a lot of errors and stuff, it worked!! In 480p resolution with 5 fps. But after I switced to 720p, it closed and the settings are gone. I cant set the camera again because of these errors. How can I solve them?

Okay, that’s a known error that is being tracked here. I’ll raise its priority, but until it’s solved, you would need to keep with BlueOS version 1.1.0-beta.12. I’ll reply here as soon as we solve the bug.

Let me know if that works for you, thanks

1 Like

Thank you for replying.

After I changed version beta.15 to beta.12 , the camera finally works! I can get 1080p, 30fps with MJPG and RSTP. From Qgrouncontrol too.

Sometimes it gives me “no video stream acessibe for your device error” , but it disappears 1-2 seconds later.

Can I add 2 cameras instead of 1 with this method? Thank you so much for your support.

resim

1 Like

BlueOS can stream multiple cameras, but QGroundControl can only receive one stream at a time (although you can set up a joystick button function to toggle between the available streams if that’s desirable).

There are some additional video receiving options mentioned here, if you’re wanting to display and/or record multiple streams simultaneously.

2 Likes

3 posts were split to a new topic: Handling custom camera feeds (without MAVLink?)



hello, I also get the same problem, but in version 1.3.1 stable, I can not play the rtsp video in Pootplayer or other software, Is there someting wrong?

Could you try creating this stream with the same RTSP but no authentication?

rtsp://192.168.2.2:8554/video0

Thanks!

I tried this address, but it failed, and I also disconnect the device to Internet, and it just work on a static address(192.168.2.2), but it also failed. I have no idea to solve this problem now

It’s possible to be a network issue, like low bandwidth, wrong route, or any firewall blocking the packets.

  1. Which operating system are you using on the topside?
  2. Is this 192.168.2.x a direct connection from the topside to the vehicle via tether cable, or is there a router or switch in the middle?

To check bandwidth, could you go to the network page (http://192.168.2.2/tools/network-test) and run a local network test?

Thanks

I connect the devices with router, and I use win10 laptop as controller, Rasberry Pi 4B as topside, and local network test is Ok, I am able to get the usb video(h.264 format) with udp address. And I found the version(1.3.1 stable) is different from yours, I plan to change it to do a testing.

Could you post the local network test results?

You probably need around 100Mbps for a 1080p60fps mjpg stream. If your camera has h264 encoded video, a 1080p60fps stream would need less than 20 Mbps, which is easy to achieve with tether.

Try configuring it as something that demands low bandwidth, like a 320p30fps (~3Mbps).

hi, thank you for your help! found it that this is related to the local network speed, if I chose the 720p/60fps, it works. And in the local network testing, my router spedd is download 20Mb/s, upload 130mb/s.Should I change my router, get a better one? I want to get 2K 60fps MJPG video.

Good to know, right, if you want a 2K 60fps MJPG stream, you need a gigabit network infrastructure. The native ethernet port of the Raspberry Pi 4 (and Pi 5, too) is gigabit, so you need to ensure the rest: use cat5 (or better) cabling, and that the router has enough gigabit ports (and that your devices are all connected on gigabit ports).

Thanks!