DJI Mavic, Air and Mini Drones
Friendly, Helpful & Knowledgeable Community
Join Us Now

RTMP Streaming Server

TonyPHX

Chuck Norris's drones don't crash.
Premium Pilot
Joined
Oct 30, 2021
Messages
615
Reactions
666
Location
Phoenix, Arizona
Hello all,

Question for anyone that has any thoughts on the matter of RTMP streaming. Does anyone have any suggestions for opensource RTMP Server software for Windows/Linux or Mac? My goal is to run my own RTMP Server for streaming purposes to be able to livestream to a server. I do not want to use Youtube or other paid subscription services. Any experiences setting this up would be appreciated (if any exist).
 
Ok, sorry all, never mind. I got it all figured out and although I know many people will think this is ridiculous and unecessary, I wanted to see if I could make this work.

My original intention was to be able to livestream back to a server in my home office from the DJI Fly app. This way I could have a "black box" record of all video my drone has ever taken as it is happening live, complete with audio from the controller app. As I was setting this up, it also helped me realize that this is a great solution for pushing RTMP to multiple sources, Youtube, Facebook etc and all at the same time. (No, I do not have an audience for it, but just wanted to see how it would be done.)

Alternatively, anyone with a RTSP player from their mobile device could also receive the stream as well. Anyways, turns out it is pretty easy to set-up.

I have an extra windows host that I use to run Flight reader and a few other windows only apps so I did this one on Windows, but should work same way on Linux.

Downloaded nginx 1.7.11.3 gryphon - this is the version for Windows that includes the RTSP module.

In the nginx.conf file, updated the rtmp section to include:

rtmp {
server {
listen 1935;
chunk_size 4096;

application live {
live on;

record all;
record_unique on;
#record all;
record_path d:/nginx/recordings;

# To push to multiple locations, uncomment lines below and substitute in your RTMP URI and stream key
# push rtmp://server/path/streamkey;
# push rtmp://server/path/streamkey;

# HLS options below
#hls on;
#hls_path /http/directory/;
#hls_fragment 3;
#hls_playlist_length 60;
#hls_continuous on;
}
}

After that, and verified that nginx starts ok, and could write to the recordings directory I pointed it to, I had to set some port forwarding. RTSP is tcp port 1935 so pointed that to the windows box running nginx.

And finally, configure the transmission section on the DJI Fly app with your URL.
rtmp://youraddress_or_ip/live/streamname
control.png

I like the idea that should I want to stream live it's going to a server and storage I control.
 
And just added the HLS settings so it appears pretty easy to allow a person with just a browser to see literally exactly what my drone is showing them in near real time. Sorry if this is redundant and others have done this already, I just never really made time to dig into RTMP before and well, this is just awesome to me.
 
  • Like
Reactions: Aairon
I like the idea of a "black box" recording, unfortunately all my equipment is Mac so I'll have to put my streaming server Mac guru on this.
 
  • Like
Reactions: TonyPHX
I like the idea of a "black box" recording, unfortunately all my equipment is Mac so I'll have to put my streaming server Mac guru on this.
nginx runs great on mac! I am a mac guy also. The windows host is my "exception" and is mostly idle so I put this project there. I think homebrew even has a nginx formula for install.
 
  • Like
Reactions: MavicAir2Marc
I like the idea of a "black box" recording, unfortunately all my equipment is Mac so I'll have to put my streaming server Mac guru on this.
@MavicAir2Marc, in addition to "black box" I was also thinking about how helpful it would be to allow a client to see exactly what I am seeing as I am seeing it. For example:

1. During real-estate shoot, showing debris or things on property that aren't going to look good, to encourage agent to get the client to clean up the yard.
2. Showing a customer what I am seeing to ask how they want it shot.
3. Showing a customer the cloud cover or traffic conditions and deciding if they want to pay for reschedule, or go forward with shoot. (Avoid challenges post-shooting)
 
Real Time Messaging Protocol.

Queston for people that do this (including the original poster): I've done this via Youtube before, but my question is how does this affect the controller/phone/drone, interference wise? Is it simply a matter of phone cpu usage or is there any affect on the RC/drone connection? I have the Mavic Mini by the way.
 
Real Time Messaging Protocol.

Queston for people that do this (including the original poster): I've done this via Youtube before, but my question is how does this affect the controller/phone/drone, interference wise? Is it simply a matter of phone cpu usage or is there any affect on the RC/drone connection? I have the Mavic Mini by the way.
Since the streaming is all taking place via 4G/5G, it should have nothing to do with the controller to drone connection, but I am not expert in this, and may not be aware of the intracacies involved. The tablet I am using is a Tripltek 8 which has been more than able to do multiple things at once without contention. (unlike the smart controller which was miserable underpowered for me)
 
Since the streaming is all taking place via 4G/5G, it should have nothing to do with the controller to drone connection, but I am not expert in this, and may not be aware of the intracacies involved. The tablet I am using is a Tripltek 8 which has been more than able to do multiple things at once without contention. (unlike the smart controller which was miserable underpowered for me)
In you video you posted I'm assuming because you are in your house you actually are using a wifi connection to stream instead of 4g/5g
 
In you video you posted I'm assuming because you are in your house you actually are using a wifi connection to stream instead of 4g/5g
I have done it both ways. My tablet has 4g sim in it. Works great and dns resolves to my server. Easy peasy!
 
In you video you posted I'm assuming because you are in your house you actually are using a wifi connection to stream instead of 4g/5g
I will do a short test this evening with a Mini2 while waiting on my kids basketball practice and share some of the resulting video files. I expect we will see some pixellation or periodic freezes etc. But I would expect it is always going to be a case of your mileage may vary.
 
@SJGMoney Here are two .flv files that were generated from the RTMP using only the cellular connection of my tablet. I tested both in 1080P 5Mbps, as well as 720P and 3Mbps, but I am too lazy to check file properties to see which is which. Both came out fine to my eye for the purposes of just having a backup.

Also, while looking at it, I should mention, this was a Mini2 which of course does not have the best camera. And it was at twilight as I was losing light, so I really think the quality via RTMP is acceptable.
 
Last edited:
Hi Tony, thankx for sharing the idea and showing us how to realize it! Might be useful!
 
  • Like
Reactions: TonyPHX
@SJGMoney I posted a third stream in the same folder as above. Literally taken out in the middle of nowhere. I had 1 bar of 4G service but absolutely no effect on the video.
 
  • Like
Reactions: SJGMoney
Lycus Tech Mavic Air 3 Case

DJI Drone Deals

New Threads

Members online

Forum statistics

Threads
131,128
Messages
1,560,123
Members
160,099
Latest member
tflys78