This blog is a continuation of my previous post.
How to build a High-Definition FPV UAV using a Rasperry PI with HD camera, using a high speed WiFi link
This post will discuss how to use GStreamer and Mission Planner together to display the HD video with a HUD (Head-Up-Display).
Note: I have only tested this feature on Windows so the instructions given here are for Windows only.
To give proper credit, the HUD created here was borrowed from APM Planner, a Qt-Based app similar to Mission Planner. The HUD part was created from the Qt codebase QML HUD created by Bill Bonney who is on the APM Planner development team. To make the HUD work with the background video, I used a GStreamer library called "QtGStreamer" which integrates GStreamer plugins with painting on a Qt widget. This library is available on the GStreamer website.
The end-result is dynamically added to Mission Planner using the plug-in architecture.
In the previous posts I discussed used a Raspberry PI and a High-speed WiFi link using GStreamer on the PI and the ground station PC. To get the HUD to work, you need to already have a successful link with the video on your ground station.
Here are the steps to follow to install the plugin:
1) Install Mission Planner.
2) Download and install GStreamer from this link. Use the x86 version, the x86_64 version will NOT work. (Use the default path 'C:\GStreamer' when installing). When installing GStreamer, select 'Custom' install and select ALL plugins to be installed.
3) Follow the steps in the previous blog noted above to get your video stream working.
4) Download and the MSI installer from this link. and run the installer.
If all went well, you should have the plugin installed.
Open Mission Planner and navigate to the "Flight Data" page and right-click on the map. You should see a menu item called "GStreamer HUD" as shown below:
Select this menu item and the following screen should appear:
In the upper-left corner is a context menu. Here is where you enter your GStreamer Pipeline string. If you had the video displaying without the HUD using a valid pipeline, enter it here.
Note: The GStreamer Pipeline string should be exactly the same as the string you used before, but WITHOUT the final video sink element. The video sink is the QtGStreamer element which will be added automatically by the plugin. The GStreamer pipe should therefore be the same, except remove the last element for the video sink.
Here is an example string I used on my setup:
udpsrc port=9000 buffer-size=60000 ! application/x-rtp,encoding-name=H264,payload=96 ! rtph264depay ! h264parse ! queue ! avdec_h264
If all is well, you can connect to your UAV and see the HUD elements moving. To change the HUD, right click on the display and select which elements you want to display. The default is to display everything shown here.
If anybody has problems, please post back and I'll update the blog in case I missed something, and you cannot get it to work.
Happy Flying!
Comments
Great thanks Patrick.
I also downloaded your standalone HUD application on windows. I think ihave a issue with my configuration because i can get video streaming with low latency, but as soon as i connect power to the pixhawk and it starts to stream mavdata into the RPI my video goes very slow.
Have you seen a similar issue with video having high latency when mavlink is streaming?
Can i ask for your pipeline that you run on your RPI? I saw something about using 48fps but would like to try a well tested pipeline.
Ill have another play with the android app later, ill see if i can connect a usb keyboard and make it easier to input the correct string. If I find any issues I will let you know.
Is the ubiquiti rocket m5 & ubiquiti nano m5 the way to go?
Thanks Paul
@Paul, I am working on the copy/paste. This is a really early version, so keep sending me feedback.
The top box is for the GStreamer Pipeline for the video.
The 'Connect String' is for the MavLink, which is optional. For UDP, you don't need to do anything but send the data to your device on port 14550 (default UDP port for MavLink). If you want a different port, use a string like this: "UDP:5000", and press the 'connect' button. Otherwise, just leave the 'Connect String' blank.
If you want to split the stream to multiple computers, download the 'MavProxy' command line utility, With MavProxy you can split the stream to as many clients as you want. You can get it from the ArduPilot website.
For the video stream, I am using this pipeline: "udpsrc port=9000 buffer-size=60000 ! application/x-rtp,encoding-name=H264,payload=96 ! rtph264depay ! h264parse ! queue ! avdec_h264"
With my B+ PI and ground station PC, I am getting about 120ms latency. With the android phone it's more like 250ms.
Please let me know if you have issues, I am sure there will be bugs as this is an early release, and the community is the 'beta tester'.
Hi Patrick,
I have just installed your android app. I am testing on a Samsung Galaxy S5.
I tap and hold to bring up the copy and paste menu but it doesnt show, it looks like you have to type in the whole string manually. I tried to type in the string but nothing happens, the buttons do not do anything. I dont know if i have put the string in correctly or if its a bug. What should go in the top box? The bottom box is asking for the connect string but isnt that usually in the pipeline?
Also how would it work if i use UDP, can i have the android and the computer receiving the streams together or do i need to choose one only?
I have set up the pi at home, video streaming is working and mavlink from Pixhawk is working too.
What are the tried and tested best settings for low latency video?
Also is the NanoStation M5 and rocket M5 still the best to use?
Many thanks for your input on the community.
Paul
Here's the link to the beta Android version. https://www.dropbox.com/s/wojitcqjgm6n0oi/QtApp-debug.apk?dl=0
This works on my Nexus 6 phone, but on a tablet the scaling is incorrect, so if you try it on an Android tablet, it will probably have issues. I am working on fixing this, I would appreciate any feedback or bug reports.
Thank you :) Works great now
FYI, I have posted an update to the Mission Planner version and the stand-alone version so they can reside on the same machine. You must uninstall the old Mission Planner version, and then re-download from the dropbox. You can then install one or the other, or both, if you still want to use the HUD with Mission Planner.
I am uploading the Android version now, I'll send a link as soon as it's visible on dropbox.
10 4 :)
@Tommy, Sorry, I still need to upload the the next version. I'll post it later after I get the android version released.
@Tommy, Try downloading the installer again. I changed it to allow for both to exist at the same time. If you want to uninstall the old one, it should be under 'Mission Planner HUD' in the 'Add or Remove Programs' control panel item.
-
19
-
20
-
21
-
22
-
23
of 34 Next