How to setup a Mission Planner HD-Video HUD using GStreamer and Mission Planner plugins

This blog is a continuation of my previous post.

How to build a High-Definition FPV UAV using a Rasperry PI with HD ...

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!

Views: 47470

Comment by RatFeet on November 22, 2014 at 10:08am

Hi Patrick,

I've been trying to run gstreamer for Windows and it keeps on failing. I've downloaded both 1.4.4 and 1.4.3 with no luck. I keep on getting same error upon running gst-launch-1.0.exe. 

"Gstreamer-Warning **: Failed to load plugin 'C:\gstreamer\1.0\x86\lib\gstreamer-1.0\libgstassrender.dll, libgstcairo.dll, libgstpango.dll and libgstrsvg.dll".

No matter what I change in the Environment Variable to force the path for \lib or \bin, I am getting same error message. Appreciate your help and rest of the guys.

Cheers.

Comment by Patrick Duffy on November 22, 2014 at 4:42pm

@RatFeet, try running gst-inspect to see what plugins are available. You can also run gst-inspect on a specific plugin to check it's status. gstreamer caches the plugin database so you may have to clear the cache to get it to work. 

Comment by RatFeet on November 23, 2014 at 10:09am

Patrick. These are screenshots of what I am getting. I have honestly installed and uninstalled several versions over 10 times and still getting SAME THING. Appreciate your help.

Comment by Patrick Duffy on November 23, 2014 at 5:20pm

@RatFeet,  it looks to me like you have an incompatible version of the C runtime somewhere on your system. What version of Windows are you running? Your path variable could be the cause of this issue. I would check to see if there is a library being loaded from another path besides GStreamer. You can use depends.exe on the library 'libgstpango.dll' and see if msvcrt.dll is being loaded from a weird path. Also it could be your version of windows is not supported. I don't think XP or VIsta is supported.

Comment by RatFeet on November 23, 2014 at 7:14pm

It is Windows XP!!!

Comment by Patrick Duffy on November 23, 2014 at 10:23pm

@RatFeet,  Do you have another machine with Win7 or 8?  Troubleshooting XP is probably not worth the effort.

Comment by RatFeet on November 24, 2014 at 5:57am

@Patrick Will try upgrading the OS. I've literally spent over three nights working on the video :( .. I avoid any OS other than XP due to drivers compatibility: (Mission Planner, TTL-Ethernet, UART, etc...). But now since I have no other choice unless I upgrade then I will do that. Hopefully tonight.

I've also wanted to test you other solution for embedding the Gstreamer onto the HUD of Mission Planner. Next, will proceed to SIM-SIM (4G/LTE).

Comment by RatFeet on November 29, 2014 at 1:33pm

Hi Patrick,

I've upgraded my laptop OS from XP to Windows 8 Pro and re-installed gstreamer. It runs now without any error, however, If I start the script on the Pi and then gstreamer on GCS (Windows 8), it does nothing. But if I start the GCS first and run the Pi, I get a Video Freeze, as if it only received one frame.

This is the same symptom I had earlier on Windows XP despite the errors.

Any clue?

Thanks.

Comment by Patrick Duffy on November 30, 2014 at 10:21am

@RatFeet, I would turn on GStreamer debugging and see if you get any error messages when the stream starts. 

Check out this link: http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/...

Set GST_DEBUG to something like 6 and watch the console window. 

Also, I would check that you have the latest version of the video driver for your system. Don't rely on windows update, go directly to the manufacturer's website.

Comment by RatFeet on November 30, 2014 at 10:36am

@Patrick, Will do that and update the blog. Much appreciated Patrick.

Comment

You need to be a member of DIY Drones to add comments!

Join DIY Drones

© 2019   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service