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'
 

Dan

Well-known member
Joined
Feb 20, 2020
Messages
103
Reaction score
41
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.
 

Witt77

New member
Joined
Apr 17, 2020
Messages
2
Reaction score
0
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.
 

mbazli

Active member
Joined
Apr 11, 2020
Messages
26
Reaction score
35
Location
Malaysia
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

tello-ajd

Member
Joined
Jun 19, 2020
Messages
8
Reaction score
0
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:

spekkie

New member
Joined
Jan 28, 2021
Messages
2
Reaction score
0
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
 

Jose A

New member
Joined
Mar 31, 2021
Messages
1
Reaction score
0
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.
 

lolprostac

New member
Joined
May 6, 2021
Messages
1
Reaction score
0
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?
 

jfrojas

New member
Joined
May 9, 2021
Messages
1
Reaction score
0
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
 

Saify

New member
Joined
May 10, 2021
Messages
1
Reaction score
0
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
 

bouso

New member
Joined
May 6, 2021
Messages
1
Reaction score
0
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
 

Supriya katragadda

New member
Joined
Jun 6, 2021
Messages
1
Reaction score
0
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
 

New Threads

Members online

Forum statistics

Threads
5,064
Messages
36,657
Members
13,617
Latest member
Wazidtello