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
@Amit, So the string 'VideoTestSrc ! queue' works in the HUD?
@Patrick...Quick Update for you. I updated my video card drivers to the latest and the OpenGL related error messages all went away but the video still wont show in the HUD
videotestsrc! queue is still working fine.
Below are the new logs
QML Status: 1
file:///C:/Program Files (x86)/Mission Planner/plugins/qml/PrimaryFlightDisplayQ
ML.qml:53: Unable to assign [undefined] to double
HUD 1 hz drawtime 0 gl True
HUD 1 hz drawtime 0 gl True
QUrl( "file:plugins/qml/PrimaryFlightDisplayWithVideoQML.qml" )
QML Status: 0
GStreamer Pipeline String = ""
GStreamer Pipeline String = "udpsrc port=5001 ! application/x-rtp, payload=96 !
rtpjitterbuffer ! rtph264depay ! avdec_h264"
file:///C:/Program Files (x86)/Mission Planner/plugins/qml/PrimaryFlightDisplayW
ithVideoQML.qml:54: Unable to assign [undefined] to double
HUD 1 hz drawtime 0 gl True
HUD 1 hz drawtime 15 gl True
HUD 1 hz drawtime 0 gl True
HUD 1 hz drawtime 15 gl True
HUD 1 hz drawtime 15 gl True
HUD 1 hz drawtime 0 gl True
HUD 1 hz drawtime 0 gl True
HUD 1 hz drawtime 0 gl True
HUD 1 hz drawtime 0 gl True
HUD 1 hz drawtime 15 gl True
HUD 1 hz drawtime 0 gl True
HUD 1 hz drawtime 0 gl True
HUD 1 hz drawtime 0 gl True
HUD 1 hz drawtime 0 gl True
HUD 1 hz drawtime 1 gl True
HUD 1 hz drawtime 17 gl True
HUD 1 hz drawtime 0 gl True
HUD 1 hz drawtime 16 gl True
HUD 1 hz drawtime 0 gl True
HUD 1 hz drawtime 0 gl True
HUD 1 hz drawtime 16 gl True
HUD 1 hz drawtime 0 gl True
HUD 1 hz drawtime 16 gl True
HUD 1 hz drawtime 16 gl True
HUD 1 hz drawtime 15 gl True
HUD 1 hz drawtime 15 gl True
HUD 1 hz drawtime 16 gl True
HUD 1 hz drawtime 0 gl True
HUD 1 hz drawtime 0 gl True
@Patrick I noticed the OpenGL comments online as well and I have drivers for OpenGL2.1 on my Sony Vaio. Based on notes anything 2.0 and greater should be fine. I will try to see if I can fine a 3.0 update for the video card when I get home tonight
@Amit, that dll is not the problem so don't delete either of them. I did a quick investigation of those errors, and it looks like your video card driver has an issue with the OpenGL libraries and Qt. Check to see if you have the latest drivers for your video card, and that it supports Open GL 2.0 or greater.
@Patrick...Thanks for educating me..Here is what I found out. The QtGStreamerQuick2.dll exists in two locations
1. In the plugins folder of Mission Planner under qml/quick2/QtGStreamer
2. c:/Program Files (x86)/QtGStreamer/bin
Should I delete the QtGStreamer under program Files completely
Which one should I delete?
@Amit, Qt is actually a development library which also ships with runtime dlls, Apps that use Qt (like the HUD) also ship with Qt dlls, so it appears that you have another app or a Qt installation that is not compatible.
In the error messages, search for the name of one of the Dlls that fails to load and see if there is more than one copy on your system.
@Patrick...pardon my ignorance but by Qt do you mean quicktime. I have apple iTunes installed on the laptop which internally install quicktime
@Amit, from those error messages, it looks like a Qt issue, not gstreamer. Do you have a Qt installation on your machine?
@Patrick, I had originally installed gstreamer sdk version but removed it a while back. Currently the only gstreamer installation I have is the x86 1.3.91 release
Any suggestions on how I can isolate the cause?