damiafuentes / DJITelloPy

DJI Tello drone python interface using the official Tello SDK. Feel free to contribute!
MIT License
1.24k stars 490 forks source link

no accelerated colorspace conversion found from yuv420p to rgb24. #211

Open anishgoel1 opened 10 months ago

anishgoel1 commented 10 months ago

I'm currently running a very simple test case for image capture, but the resulting image is always black with the message that "no accelerated colorspace conversion found from yuv420p to rgb24." and "no frame". I thought this initially was because of my cv2 build, but after trying multiple times over again, I can't get it to fully work. I'm using the most recent versions of cv2 and DJITelloPy. Here is a sample test case that is producing this:

from djitellopy import tello
import cv2

drone = tello.Tello()
drone.connect()

drone.streamon()
img = drone.get_frame_read().frame
img = cv2.resize(img, (340, 260))
cv2.imwrite("picture.png", img)
drone.streamoff()

upon running this, picture.png is entirely black and the messages no accelerated colorspace conversion found from yuv420p to rgb24 and no frame appear._ I'm running this on a Mac M2 air.

Screenshot 2023-11-30 at 1 29 21 AM
raulperezalejo commented 4 months ago

I can confirm the same result with the same code in a Apple M1 Pro, should be relates with not having graphic acceleration?

cynthia2006 commented 4 months ago

This is not an issue of OpenCV, but of FFmpeg, more specifically of libswrescale. This is because aside from x86, hardware accelarate conversion of YUV 4:2:0 to RGB colorspace is not implemented.