To receive videostream from the drone (here: Mavic Mini), you need 3 things.
- a server application, that can receive rtmp (here: nginx)
- a viewer (here: vlc)
- the right configuration.
Ok, let’s start with the server. I am using debian/bullseye 64-bit, but should run on Ubuntu or other linux distros, too. Even on Raspberry pie.
- Ok, on your linux system you need to install nginx and a plugin for nginx, to enable rtmp.
command as root:
apt-get update && apt-get install nginx libnginx-mod-rtmp vlc
- Edit /etc/nginx/nginx.conf and add these lines at the bottom of this file:
rtmp {
server {
listen 1935;
chunk_size 4096;
application live {
live on;
record off;
}
}
}
The port with the listen command 1935 can be chosen free to any other free port. I chose 1935 because it is the same port, youtube is using.
- Start or restart nginx:
/etc/init.d/nginx start
- To check, if rtmp is listening, you can use a portscanner like nmap:
nmap -sT localhost
Looks this way:
Starting Nmap 7.80 ( https://nmap.org ) at 2022-02-07 18:48 CET
Nmap scan report for localhost (127.0.0.1)
Host is up (0.00032s latency).
Not shown: 985 closed ports
PORT STATE SERVICE
22/tcp open ssh
…
…
1935/tcp open rtmp
…
24800/tcp open unknown
Nmap done: 1 IP address (1 host up) scanned in 0.20 seconds
- Start VLC and start network stream. The syntax is like this:
rtmp://192.168.178.102:1935/live
Explanation: The first is the protocol (rtmp://), then the ip-address where vlc is running (here mine is 192.168.178.102), then followed by a colon the port (:1935) and last followed by a slash the word live (/live).
(The word live must be added, but here I am stuck, why. I believe, it is the name of a temporary file, that is created. You can choose any other, but “live” worked)
- Well, now in Litchi go to RTMP and add the line as above, too:
rtmp://192.168.178.102:1935/live
- After some seconds you will see the video in VLC!
Notes: I noted, that the video is fluently on my notebook, but there is a almost 3-5 second delay compared to the video in the mobile phone. Note, that I am running 2,4GHz on my router, my notebook is old (2x2,2GHz, 4GB RAM, connection with wlan). Newer and faster network connections might be faster on the computer.
Second note: I saw some desciptions of linux and windows, using OBS Studio (a free and open source video software). Sadly I managed not to get video in there, and it is not clear for me, why it is used at all. However, maybe it is necessary in Windows (who cares of Windows!), but I did not need it in Linux.
Still testing other software, as VLC is consuming much process power, it is not the best choice for this one (although the easiest). SMPLAYER is a much smoother software and need very few ressources. However, still I was not able to get network stream running in smplayer.
For the windows users: There are some good tutorials in youtube related to RTMP + drone. As thwere are not much, I do not post the link. There are only 5 or 6, they should be easily found.
And as I do not use windows since decades, this tutorial aimed to linux users.
Have fun!
Best
Hans