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
Two more notes that might help Kevin figure out his issues.
1. Make sure you have a functional installation of Gstreamer on your RPi. I uninstalled all of mine, and reinstalled from the link on RoboGoby's blog.
2. Look into the configuration interval parameter. I notice patrick had "1" and RoboGoby had "5". This is related to Patrick's last comment.
I just set mine back up for UDP to do a packet capture. I fired up wireshark on the windows GCS and I can see the packets are going out on port 38136 and arriving at the destination GCS on port 5000. So I really think it is windows that is not firing up the display window and not a network issue.
@ Chris A, One thing I forgot to mention. See if you get the blank screen when you remove the 'config-interval' from the pipeline. For later versions of GStreamer, the pipe does not start unless you start GStreamer on the GCS first if you are missing the config-interval statement. If it works when you include it, then that's the difference.
ok got it working... something about the settings RoboGoby used for his submersible sub worked for me. http://robogoby.blogspot.com/2014/01/raspi-camera-gstreamer-10-w-wi...
just tried an older version of 32 bit gstreamer, i.e. 1.2.2... still no dice
Also, the windows machine and raspberry pi 2 can ping one another successfully...
Patrick,
Tried on a new windows machine. Same problem, the pop up window will not show. It just sits on "New clock: GstSystemClock"
Tried your pipeline setup and it made no difference. I opened up port 9000 for inbound and outbound, didn't help either. Shouldn't the pop up window show regardless of there being a functional connection, if no errors are being reported? Is this a Java issue? I am truly stumped and feel that I am wasting countless hours every night trying to trouble shoot this :(
@Chris A. The router should not matter. If you can ping the GCS from your Raspberry PI then sending a UDP packet should work as long as you have that port open on your GCS.
No i never was able to analyze the stream. I got a bit distracted by the hardware / range testing with TCP but do plan to give UDP a try as it is the most efficient protocol for this purpose.. I did try and move to an ad-hoc wired connection between client and server and i got the same result.
I am routed through an ethernet switch, could that be why? Both receiving and transmitting ends are on the same switch.