arrow-left

All pages
gitbookPowered by GitBook
1 of 3

Loading...

Loading...

Loading...

GStreamer

circle-check

There is an NXP community user guide for gstreamer available here: https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX-8-GStreamer-User-Guide/ta-p/1098942arrow-up-right

hashtag
Taking a picture

To take a picture on your NavQ using GStreamer, run the following command:

To take video, you can run the following pipeline:

$ gst-launch-1.0 -v v4l2src num-buffers=1 ! jpegenc ! filesink location=capture1.jpeg
$ gst-launch-1.0 v4l2src ! 'video/x-raw,width=1920,height=1080,framerate=30/1' ! vpuenc_h264 ! avimux ! filesink location='/home/navq/video.avi'

Streaming Video to QGroundControl using NavQ over WiFi

hashtag
Prerequisites

hashtag
Devices required

In this guide, we need a few things:

  1. NavQ Companion Computer mounted with Google Coral Camera attached

  2. Laptop/Phone with QGroundControl Installed

  3. Both NavQ and mobile device connected to the same WiFi network

hashtag
Setting up QGroundControl

In QGroundControl, click the Q logo in the top left, and configure the video section as seen in the image below:

This will set up your QGroundControl instance to receive the UDP video stream from the NavQ.

hashtag
Connecting your NavQ to your router and getting IPs

Follow the WiFi setup guide using connman in the Quick Start guide to connect your NavQ to the same router as your mobile device. You will need to use the serial console to do this. Once you have your NavQ connected, you can run ifconfig in the serial console to find the IP address of your NavQ.

You can SSH into the NavQ to run the GStreamer pipeline once you have the IP.

hashtag
Running the GStreamer pipeline

With your NavQ on, SSH into it by using the IP address you noted when connected to the serial console. Once you're successfully SSHed in, you should note the IP address that you logged in from as seen here:

This is the IP of your computer that you should be sending the video stream to.

To run the GStreamer pipeline, run the following command:

circle-info

Make sure to replace the 'xxx.xxx.xxx.xxx' with the IP you noted when first SSHing into the NavQ.

Once you run that command, you should be able to see the video stream from your NavQ on QGroundControl!

Your IP address should be next to 'inet' under 'wlan0' if connected over WiFi.
NavQ Streaming over UDP to QGroundControl

Ad-Hoc Streaming using Mobile Hotspot

hashtag
Configuring Windows

hashtag
Step 1 - Enable Mobile Hotspot

circle-info

You must have a WiFi adapter in your Laptop/PC to follow this guide.

To enable Mobile Hotspot on Windows, go to Settings->Network & Internet->Mobile Hotspot. Next, you'll want to edit your mobile hotspot settings to set a password and SSID. Once you've done this, you can enable Mobile Hotspot. You can see a full configuration in the screenshot below.

hashtag
Step 2 - Enable Port 5000/5600 in Firewall

By default, port 5000 or port 5600 is not open in the Windows firewall, so any UDP stream packets will be blocked. To enable this, go to your Windows search bar, and type "Firewall". Select "Windows Defender Firewall".

Once you open Windows Defender Firewall, you'll want to navigate to "Advanced Settings" from the menu on the left.

You will then be brought to a new window with Windows Firewall rules. To create a new rule for QGC streaming, you'll need to click "New Rule" on the right side.

You will be brought to a new window to add a rule. Select "Program" and click "Next".

At the next window, it will ask you to specify the program you are adding a rule for. Paste the following into that field and click "Next":

Once you've done this, you can click "Next" through the rest of the fields and you should be good to go.

circle-info

On the page that tells you to name your rule, just name it "QGroundControl".

hashtag
Step 3 - Connect NavQ to new Mobile Hotspot

To connect your NavQ to your new Mobile Hotspot, follow the connecting to WiFi guide in the Gitbook here:

hashtag
Step 4 - Stream to QGroundControl

Now you can stream to QGroundControl as you normally would. Follow the guide here:

hashtag
Configuring Ubuntu

hashtag
Step 1 - Enable Wifi Hotspot

To enable a WiFi hotspot in Ubuntu 20.04, you'll first need to go to Settings->WiFi. Then, at the top right, click the 3 dots button and select "Turn On Wi-Fi Hotspot...".

After you click that entry, this window will pop up. Enter a network name and password, and you should be good to go! Follow Steps 3 and 4 in the Windows section above to configure your NavQ.

$ sudo gst-launch-1.0 v4l2src ! video/x-raw,width=640,height=480,framerate=30/1 ! vpuenc_h264 bitrate=500 ! rtph264pay ! udpsink host=xxx.xxx.xxx.xxx port=5600 sync=false
Streaming Video to QGroundControl using NavQ over WiFichevron-right
Mobile Hotspot setup in Windows with imx8mmnavq connected
%ProgramFiles%\QGroundControl\QGroundControl.exe
Quick start Guide | NXP 8MMNAVQ: NavQ Companion Computernxp.gitbook.iochevron-right
Logo