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

Can't able to get real time video streaming from tello

Witt77

New member
Joined
Apr 17, 2020
Messages
2
Reaction score
0
Hello everyone

I'm trying python script to control and streaming real-time video from Tello drone. Drone control is functional but I can't get video streaming. When I turn on camera on the GUI it will print errors in the console.I work in Linux(Ubuntu).

Can anyone please suggest me a solution?

Exception in thread Thread -2:
Traceback (most recent call last):
File "/usr/lib/python2,7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "main.py", line 32, in camStream
cv2.imshow('cap', frame)
error: OpenCV(4.2.0) /io/opencv/modules/highgui/src/window.cpp:376: error: (-21 5: Assertion failed) size.width>0 && size.height>0 in function 'imshow'
 
Hello

I am dong a lot of work on livestreaming videos from drones of all kinds. I am not a programming, but a sophisticated user. I have some programming skills at a beginner to intermediate level in a few languages. With the Tello, the best solution that I have found, comes from Dennis Baldwin site on Github.He also has some good videos on Youtube and some courses on DroneBlocks.. It uses many plugin, that I do not know how to program, but his program works. i.e. nodeJ, Flask, CV2, etc. He is trying to shortne the complex programmiong, but with cut and paste and your modifications, it does work. Another one that just came up yesterday on this site from Italy, is doing the same, but the goal is tracking up to ten objects. I hope this helps some. You might have to move to python 3.7 ( not 3.9 ) fro these to work.
 
Hello thank you for response

I tried Python-Tello script but I have a problem everything installed correctly but if I run a script the streamon is receive but no video show up. I use sudo ufw allow 11111 to open UDP port but videostream can't show.
 
Hi,

perhaps you can checkout my python script at Bitbucket -> Bitbucket

steps:
1. open terminal #1 -> execute tello-command.py, ex: python tello-command.py
2. send "command" command, ex: "command" without quote
3. send "streamon" command, ex: "streamon" without quote
then:
4. open terminal #2 -> execute tello-stream.py, ex: python tello-stream.py
5. you should able to view the camera feed from Tello

Regards,
Bazli
 
  • Like
Reactions: tello-ajd
Hi there, I tried your code from bitbucket as I am trying to do a similar thing and I'm getting the error OpenCV: Couldn't read video stream from file "udp://@0.0.0.0:11111". Have you ever gotten this error before? I have tried many other codes to try and accomplish getting the video stream from my Tello and encounter this error every time.
 
Last edited:
I have the same issues with the Tello. I am following the "drone programming with python course" from Murtaza.
The script is quite easy according to the course namely:

from djitellopy import tello
import cv2

me = tello.Tello()
me.connect()
print(me.get_battery())

me.streamon()

while True:
img = me.get_frame_read().frame

cv2.imshow ("Image", img)

cv2.waitKey(1)

But the Tello is not sending a video. Python gives an error namely:

Send command: streamon
Response: b'ok'
Traceback (most recent call last):
File "C:/Users/johan/PycharmProjects/Tello_Course/imageCapture.py", line 13, in <module>
cv2.imshow ("Image", img)
cv2.error: OpenCV(4.5.1) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-oduouqig\opencv\modules\highgui\src\window.cpp:376: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow'

Can someone help me with this.

johan
 
I have the same issues with the Tello. I am following the "drone programming with python course" from Murtaza.
The script is quite easy according to the course namely:

from djitellopy import tello
import cv2

me = tello.Tello()
me.connect()
print(me.get_battery())

me.streamon()

while True:
img = me.get_frame_read().frame

cv2.imshow ("Image", img)

cv2.waitKey(1)

But the Tello is not sending a video. Python gives an error namely:

Send command: streamon
Response: b'ok'
Traceback (most recent call last):
File "C:/Users/johan/PycharmProjects/Tello_Course/imageCapture.py", line 13, in <module>
cv2.imshow ("Image", img)
cv2.error: OpenCV(4.5.1) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-oduouqig\opencv\modules\highgui\src\window.cpp:376: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow'

Can someone help me with this.

johan
Hi, I have a similar problem, I'm try do the same course but my window with image tello cam don`t show.
this window open and close fastly. I'm make the ejercice with pycharm ide.

if someone could help me too.

Thank you.
Jose.
 
Hi, I have a similar problem, I'm try do the same course but my window with image tello cam don`t show.
this window open and close fastly. I'm make the ejercice with pycharm ide.

if someone could help me too.

Thank you.
Jose.
Have you figure out a fix?
 
I have the same issues with the Tello. I am following the "drone programming with python course" from Murtaza.
The script is quite easy according to the course namely:

from djitellopy import tello
import cv2

me = tello.Tello()
me.connect()
print(me.get_battery())

me.streamon()

while True:
img = me.get_frame_read().frame

cv2.imshow ("Image", img)

cv2.waitKey(1)

But the Tello is not sending a video. Python gives an error namely:

Send command: streamon
Response: b'ok'
Traceback (most recent call last):
File "C:/Users/johan/PycharmProjects/Tello_Course/imageCapture.py", line 13, in <module>
cv2.imshow ("Image", img)
cv2.error: OpenCV(4.5.1) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-oduouqig\opencv\modules\highgui\src\window.cpp:376: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow'

Can someone help me with this.

johan
Hi, I have also been trying to follow this video for a couple of weekends but unfortunately I still can't manage to get any video at all :S
 
I have the same issues with the Tello. I am following the "drone programming with python course" from Murtaza.
The script is quite easy according to the course namely:

from djitellopy import tello
import cv2

me = tello.Tello()
me.connect()
print(me.get_battery())

me.streamon()

while True:
img = me.get_frame_read().frame

cv2.imshow ("Image", img)

cv2.waitKey(1)

But the Tello is not sending a video. Python gives an error namely:

Send command: streamon
Response: b'ok'
Traceback (most recent call last):
File "C:/Users/johan/PycharmProjects/Tello_Course/imageCapture.py", line 13, in <module>
cv2.imshow ("Image", img)
cv2.error: OpenCV(4.5.1) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-oduouqig\opencv\modules\highgui\src\window.cpp:376: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow'

Can someone help me with this.

johan
I have the same issue as you
 
Does anyone know how to fix this problem? Currently, im having trouble with real time streaming with object detection. With only the streaming the delay I am getting is around 0.5 seconds but with the object detection code implemented, i am getting roughly 10 to 20 seconds delay. thanks
 
I have the same issues with the Tello. I am following the "drone programming with python course" from Murtaza.
The script is quite easy according to the course namely:

from djitellopy import tello
import cv2

me = tello.Tello()
me.connect()
print(me.get_battery())

me.streamon()

while True:
img = me.get_frame_read().frame

cv2.imshow ("Image", img)

cv2.waitKey(1)

But the Tello is not sending a video. Python gives an error namely:

Send command: streamon
Response: b'ok'
Traceback (most recent call last):
File "C:/Users/johan/PycharmProjects/Tello_Course/imageCapture.py", line 13, in <module>
cv2.imshow ("Image", img)
cv2.error: OpenCV(4.5.1) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-oduouqig\opencv\modules\highgui\src\window.cpp:376: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow'

Can someone help me with this.

johan
Did you get the video. I was facing the same problem and I was following Murtaza
 
I have the same issues with the Tello. I am following the "drone programming with python course" from Murtaza.
The script is quite easy according to the course namely:

from djitellopy import tello
import cv2

me = tello.Tello()
me.connect()
print(me.get_battery())

me.streamon()

while True:
img = me.get_frame_read().frame

cv2.imshow ("Image", img)

cv2.waitKey(1)

But the Tello is not sending a video. Python gives an error namely:

Send command: streamon
Response: b'ok'
Traceback (most recent call last):
File "C:/Users/johan/PycharmProjects/Tello_Course/imageCapture.py", line 13, in <module>
cv2.imshow ("Image", img)
cv2.error: OpenCV(4.5.1) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-oduouqig\opencv\modules\highgui\src\window.cpp:376: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow'

Can someone help me with this.

johan
Your problem seems to resemble this issue on DJITelloPY Github repo. According to the maintainer's responses, you should try updating your djitellopy library or try installing djitellopy2 library.

For your easy reference:
1. pip uninstall djitellopy
2. pip install https://github.com/damiafuentes/DJITelloPy/archive/master.zip

This will install the latest version of the djitellopy library.

Also, check your firewall rules, if by chance, incoming connection on UDP port 11111 is blocked. If it is blocked, add an exception and allow the incoming connection for the port.
Hope this helps.



I've made a software using Python, JS and the DJITelloPy Library, for Tello drone. It enhances your drone's ability by adding on some of the most sought AI features, like Object Detection, Human Pose Estimation and Voice Commands, to your Tello Drone. You can check it out at www.aidronesoftware.com.
You can download the software for free (limited time offer) using this LINK, after signing up.

Thank you.
 
I don't think you have to worry about it so much and put so much effort. I believe writing a code for streaming is something unuseful as nowadays we have so many libraries online that have already done that job for you. I'm talking about the streaming services we have. Some of them work better, some worse, but if you learn how to use them correctly, everything will be alright and easier for you. I suggest you use Android RTMP Live Streaming SDK Library | OpenSDK by Streamaxia, but your option you can also take online. It was the best for me, and if you try it, you'll see why. Good luck to you, and try not to put so much effort into such minuscule things.
 
Last edited:

New Posts

Members online

No members online now.

Forum statistics

Threads
5,676
Messages
39,895
Members
16,943
Latest member
muertesilencio147@outlook

New Posts