Hello Tello Pilot!
Join our DJI Tello community & remove this banner.
Sign up

Video feed from two drones on one PC

Petop

New member
Joined
Jan 27, 2021
Messages
3
Reaction score
1
Hello everyone,

A few weeks ago I started a project to control two drones on one PC.

After many attempts, I have now managed to establish the connection to the drones with two WLAN antennas and also to start them, etc.

If you want to know more about this, please let me know.

However, my biggest problem at the moment is that I cannot display the video stream of the drones without latency.

I am using an Ubuntu system and the following commands in the terminal:

sudo iptables -A INPUT -i wlan0 -p udp --dport 11111 -j ACCEPT
sudo iptables -A INPUT -i wlan0 -p udp --dport 11113 -j ACCEPT
sudo iptables -A PREROUTING -t nat -i wlan0 -p udp --dport 11111 -j REDIRECT --to-port 11113

This way I can separate the stream from the two drones and display each to myself, even though they are both sending their stream to the same port.

I do this in Python:

import cv2
...

cap_1=cv2.VideoCapture("udp://@0.0.0.0:11113")
cap_1.set (cv2.CAP_PROP_BUFFERSIZE,1)

cap_2=cv2.VideoCapture("udp://@0.0.0.0:11111")
cap_2.set (cv2.CAP_PROP_BUFFERSIZE,1)

while True:
ret, frame_1 = cap_1.read()
ret, frame_2 = cap_2.read()

cv2.imshow('frame_1', frame_1)
cv2.imshow('frame_2', frame_2)

if cv2.waitKey(1)&0XFF == ord('q'):
break

So now the question, how do I get rid of the latency?
Does anyone have any ideas? The latency is currently at 3-4 seconds. The system still has enough power, so that shouldn't be the reason for it.
My idea would be to switch off the buffer, if it exists at all?

Any ideas welcome :)

System:
Ubuntu 18.04
python 3.6.9
cv2 4.5
 
  • Like
Reactions: Fari
Hello Great work. Would like information on this project please send to [email protected]. Thank you. We are working on swarm drone flying, etc. We do fly two Autels one and two for some mission at the same time. The more, we know about this the better. We also fly the Tello's with Python scripts ( Thorny ) with Raspberry PI's and CrowPi.
 
  • Like
Reactions: AIDrone
Hello togehter, short update to my project. After one week without finding soloutions for the problem with the stream.
So I will switch to a solution with a a raspi for sending the stream to the host system (and the commands). @Dan, it's this near by your solution? can yoe report more over the latenc?

More Updates coming, but not fast (to lot of work :-( )
 
Another small update, after frustrating hours with a Raspi.... I surrender for now.

I can't get the forwarding from WLAN0 to ETH0 to work. So that I can not access the drone connected to the Raspi from the main system.

If someone knows how to do this, please post. If I find something, I will do that too.

See you
 
Hello everyone,

A few weeks ago I started a project to control two drones on one PC.

After many attempts, I have now managed to establish the connection to the drones with two WLAN antennas and also to start them, etc.

If you want to know more about this, please let me know.

However, my biggest problem at the moment is that I cannot display the video stream of the drones without latency.

I am using an Ubuntu system and the following commands in the terminal:



This way I can separate the stream from the two drones and display each to myself, even though they are both sending their stream to the same port.

I do this in Python:



So now the question, how do I get rid of the latency?
Does anyone have any ideas? The latency is currently at 3-4 seconds. The system still has enough power, so that shouldn't be the reason for it.
My idea would be to switch off the buffer, if it exists at all?

Any ideas welcome :)

System:
Ubuntu 18.04
python 3.6.9
cv2 4.5
I am trying to stream videos from two drones in one pc. Could you please send me the code and the details to [email protected]? Thanks.
 

Members online

No members online now.

Forum statistics

Threads
5,697
Messages
39,959
Members
17,056
Latest member
97bugsinthecode