3689624585?profile=original

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:

3689624376?profile=original

Select this menu item and the following screen should appear:

3689624624?profile=original

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!

E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones

Comments

  • @Erich,  

    You have the pipeline string: gst-launch-1.0 -v udpsrc address=192.168.42.11 port=5000 caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink sync=false

    You need to remove the the last two elements in the pipeline "videoconvert" and "autovideosink".   The HUD will add the correct sink to the pipeline and overlay the video.

    The way you can test this is to use your original pipeline (with sink specified) from the command line using gstreamer without the HUD.  If that works, try the HUD without the video sink specified. Let me know if this works for you.

  • @Patrick

    "Failed to create the pipeline" and click OK

    3702077208?profile=original

  • @Patrick

    Thank you for doing so much of the good stuff. Tried to launch the GStreamer HUD but ran into the issues as others, but into something bit different - please see the pictures.


    I can confirm that it possible to launch the video stream from the command line. Commands used to test the video from cmd:


    gst-launch-1.0 -v udpsrc address=192.168.42.11 port=5000 caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink sync=false


    raspivid -t 0 -w 720 -h 480 -b 5000000 -vf -n -o - | gst-launch-1.0 -v fdsrc ! h264parse ! rtph264pay config-interval=1 pt=96 ! udpsink port=5000 host=192.168.42.11


    I tried to test the behavior in the freshly installed system (VMware) but again the same error. OS used: Win7 Pro x64, old Fujitsu laptop

    videotest also produce the same error.

    If you click OK at the dialogue, you get whats on the second picture.

    Any clues? :-) And again, thank you for your effortsand time invested into this project.

    3702077263?profile=original

  • @Alp,  the HUD will try to fill the space of your monitor if you select full-screen mode, but if it does not match the input stream resolution, it will scale/stretch the image, which could cause your distorted issue. For 720p, I just set the monitor to 1280x720, and then full-screen and this seems to work ok on my setup.  I usually do not try full 1080p because the extra latency, and my FPV goggles are fixed at 720p. 

  • @Patrick
    Ok, I will try full-screen mode of HUD with 1920x1080 stream. Already my native monitor resolution is 1920x1080

    so, How can I set HUD windows size exactly1280x720 when Im using 1280x720 stream resolution on 1920x1080 monitor? I think HUD windows not resize automatic.

  • @Alp,  The HUD will resize to fit the window you are displaying video, but it should match your input resolution if you go full-screen and the monitor is set to 1920x1080.   Did you try full-screen mode?  

  • @Patrick
    Im using your stand-alone version of the HUD. I have some problem with video proportion and aspect ratio

    1920x1080 stream not showing correct proportion I mean circles looks like ellips. 

    Any idea about that?

  • @jon c,  I would try uninstalling the HUD, and download the latest version from dropbox and re-install. Also I would recommend you use the stand-alone version of the HUD instead of the Mission Planner plug-in. Either one should work, but the stand-alone version has no dependency on Mission Planner.

  • Has something changed in either the plugin or Mission Planner recently to break compatibility?  I had this working on a computer I just reformatted and I am no longer able to get the HUD to work.  Following the same installation instructions, I don't see a GStreamer HUD option in the Flight Data screen.  I've tried uninstalling and reinstalling a few times to no avail.

    What should I see in the Mission Planner/Plugins folder to know that it installed? 

  • @Kevin,  You can replace the stock dipoles with CP antennas, but the standard dipoles will also work. If you use a CP antenna on the ground you will end up with a 3db loss, but from my experiments, the range is only slightly affected. I would try the stock antennas first if you don't want to spend the money. The ones I use are made by Circular Wirless and are $40 each.   

    There is a blog that Circular Wireless posted on their website where a glider pilot was getting 70km range with an FPV setup using spirals, even without a dish. This was with standard video, not digital HD, but that is an amazing feat, but it shows what you can do with the right antennas.

This reply was deleted.