Bebop2, Python, OpenCV

Product: [Bebop/Bebop2]
Product version: [X.X.X]
SDK version: [4.2.0]
Use of libARController: [YES/NO] (Only for ARSDK)
SDK platform: [iOS/Android/Unix/Python…]
Reproductible with the official app: [YES/NO/Not tried]

Hi, Guys.

I want to video streaming using python and OpenCV.

I tried to http://cvdrone.de/stream-bebop-video-with-python-opencv.html , but I failed.
(I used ubuntu 16.04)

Is anyone success?

If you are successful, please let me know in detail.

Thanks

was able to solve opening a Parrot Anafi stream with OpenCV (built with FFMPEG) in Python by setting the following environment variable:

export OPENCV_FFMPEG_CAPTURE_OPTIONS="rtsp_transport;udp"

FFMPEG defaults to TCP transport, but the feed from the drone is UDP so this sets the correct mode for FFMPEG.

Then use:

cv2.VideoCapture(<stream URI>, cv2.CAP_FFMPEG)

ret, frame = cap.read()

while ret:
    cv2.imshow('frame', frame)
    # do other processing on frame...

    ret, frame = cap.read()
    if (cv2.waitKey(1) & 0xFF == ord('q')):
        break

cap.release()
cv2.destroyAllWindows()

as usual.

This should also work with a Parrot Bebop, but I don’t have one to test it.

1 Like

What Stream URI are you using, and what version of OpenCV?

Did you have to start streaming with the Olympe SDK?

Thanks!!

Never mind, works with a fresh OpenCV 4.1 build!! Thanks for your example!!

For the URIs use: rtsp://192.168.53.1/live for the sky controller or rtsp://192.168.42.1/live for the drone directly.

I’m using OpenCV 4.1.

For this method you don’t need to use Olympe SDK at all.