Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to read Dji tello frames on ubuntu 20.04 #220

Open
Vaibhav1196 opened this issue May 12, 2024 · 1 comment
Open

Not able to read Dji tello frames on ubuntu 20.04 #220

Vaibhav1196 opened this issue May 12, 2024 · 1 comment

Comments

@Vaibhav1196
Copy link

This is my code, I have also tried adding delays but tit never worked, I received the same result :

############################################################################################

import cv2
from djitellopy import Tello
import time

Initialize Tello and set up video stream

tello = Tello()
tello.connect()
tello.streamon()

time.sleep(5)

frame_read = tello.get_frame_read()

time.sleep(5)

Main loop to continuously read and display frames

while True:
# Attempt to get a new frame from the frame queue
frame = frame_read.frame

# Check if the frame is not None
if frame is not None:
    # Display the frame using OpenCV
    cv2.imshow("Tello Video", frame)

# Check for key press to exit the loop
if cv2.waitKey(1) & 0xFF == ord('q'):
    break

Clean up

cv2.destroyAllWindows()
tello.streamoff()
tello.end()

############################################################################################

I use Anaconda environment with :

opencv 4.9
djitellopy latest version

############################################################################################

ERROR :

[INFO] tello.py - 129 - Tello instance was initialized. Host: '192.168.10.1'. Port: '8889'.
[INFO] tello.py - 438 - Send command: 'command'
[INFO] tello.py - 462 - Response command: 'ok'
[INFO] tello.py - 438 - Send command: 'streamon'
[INFO] tello.py - 462 - Response streamon: 'ok'
Traceback (most recent call last):
File "/home/vaibhav/anaconda3/envs/tello/lib/python3.8/site-packages/djitellopy/tello.py", line 1049, in init
self.container = av.open(self.address, timeout=(Tello.FRAME_GRAB_TIMEOUT, None))
File "av/container/core.pyx", line 420, in av.container.core.open
File "av/container/core.pyx", line 266, in av.container.core.Container.cinit
File "av/container/core.pyx", line 286, in av.container.core.Container.err_check
File "av/error.pyx", line 328, in av.error.err_check
av.error.ExitError: [Errno 1414092869] Immediate exit requested: 'udp://@0.0.0.0:11111'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "./record_tello.py", line 46, in
frame_read = tello.get_frame_read()
File "/home/vaibhav/anaconda3/envs/tello/lib/python3.8/site-packages/djitellopy/enforce_types.py", line 54, in wrapper

@keecharles
Copy link

djitellopy 2.5.0 use pyav to decode the stream, pyav and opencv can output the frame well on windows, but has conflict on ubuntu 20.04.
Try pip install djitellopy==2.4.0 on ubuntu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants