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
Hi Patrick, this fixed my troubles
I added this path to my User variable
GST_PLUGIN_PATH_1_0 = C:\gstreamer\1.0\x86\lib\gstreamer-1.0
Hi Patrick, starting from a fresh install, can you please list the steps necessary, i.e., which programs (and version) should be loaded into which directories (for example., is Program Files (x86) still needed for Mission Planner?), and what Environment Variables are needed to ensure the plugins have the right path, etc.
Not sure why, but I'm having trouble with missing dlls etc.I am using Windows 10.Thanks!
Working !!!!!!!!!! thanks again
@Paul. Try downloading again. Found a problem with the installer. I have uploaded a new version.
Thanks Patrick, going to give it a try. Paul, I had some dll errors on one of my PCs as well, I installed the latest gstreamer and copied the entire c:\gstreamer\1.0\x86\lib\gstreamer-1.0 into C:\Program Files (x86)\Mission Planner\Lib\gstreamer-1.0 and that seems to fix the errors.
Only my laptop it worked without any additional steps for some reason.
Hi Patrick, thanks again for sharing you knowledge and programs.
I am getting this error with your latest HUD: "boost_system-vc110-mt-1_61.dll is missing from"
FYI, there is a new version of the HUD on dropbox here:
https://www.dropbox.com/s/ssfxi5kwh93c0iu/GStreamerHUD.msi?dl=0
This version of the HUD supports the latest verson of GStreamer, and also has bug-fixes and enchancements, such as controlling the Sony QX10 (or any Sony camera supporting the API) remotely, for recording and zoom. More camera types are supported where the color tables in the previous version had issues for non-H264 streams. You can now run MJPEG and raw streams with correct color balances.
I'll be posting a blog about it soon.
@Hein, You can check for load errors by turning on the Mission Planner console output. I would suggest the stand-alone version of the HUD instead of the Mission-Planner integrated version. I am releasing a new version in a couple of days with many enhancements and bug-fixes. You probably have a path issue with dll loading. If you use the stand-alone version, the path issues don't usually happen because it ships with it's own instance of gstreamer.
Hi Patrick - I have gstreamer working to windows, but I don't see the "GStreamer HUD" on the Flight Data screen of MP? I've found "QtGstreamerHUD.dll" under "plugins" in the MP folder. I re-installed and restarted a few times. Any pointers would be great..
@Patrick Thanks mate. I suspected the problem, came from the bowels of Windows 10 directory. Did a reset (recovery/reinstall/refresh) of the OS and re-installed the applications. Mission Planner plugin is now working from within MP. GStreamer scripts run independently of MP still complain of libgstopen error; but that's not an issue for me. Stand-alone QtGstreamerHUD is working well fine and I may transition to that over time as well - still need to record telemetry logs and I haven't found a way to do that (yet) using the stand-alone app. Your work is much appreciated. Cheers.