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

OSError: [WinError 6] #207

Open
CodeLancerA opened this issue Nov 5, 2023 · 1 comment
Open

OSError: [WinError 6] #207

CodeLancerA opened this issue Nov 5, 2023 · 1 comment

Comments

@CodeLancerA
Copy link

Bro,I am working with a Tello drone, utilizing the DJITelloPy library to control it. However, I'm encountering an error when attempting to close the video stream and destroy the Tello instance. The error message I receive is OSError: [WinError 6] The handle is invalid. Additionally, during the video streaming, I am facing issues with video decoding displaying errors like non-existing PPS 0 referenced and decode_slice_header error. I am not able to capture images during this process. I've successfully initialized the Tello instance and sent commands like streamon, takeoff, and land which were acknowledged without issue.
This is the code i run:
import cv2
from djitellopy import Tello

tello = Tello()
tello.connect()

tello.streamon()
frame_read = tello.get_frame_read()

tello.takeoff()
cv2.imwrite("picture.png", frame_read.frame)

tello.land()

@Bitahsni
Copy link

Hi, I had the same issue. When capturing the image, cv2.imshow() shows a black window!I assume this problem refers to your PC! because when I run the script on another PC, it works as well.
But I don't know what the problem is. Have you solved this problem?

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