Ask Your Question

Revision history [back]

Video Capture Error A.R Drone 2.0

The following code is trying to stream a video from an A.R Drone using python. When I run the code, I receive error error reading video feed. I am using 3.3.0. Is there a way to fix this. I have talked to other people. Am I running the code on the command prompt correctly. I put drone.py in the command prompt. I also ran the code on Python shell and it does not work. It just reads my else statement.

import cv2
cam = cv2.VideoCapture('tcp://192.168.1.1:5555')
running = True
while running:
    # get current frame of video
    running, frame = cam.read()
    if running:
        cv2.imshow('frame', frame)
        if cv2.waitKey(1) & 0xFF == 27: 
            # escape key pressed
            running = False
    else:
        # error reading frame
        print 'error reading video feed'
cam.release()
cv2.destroyAllWindows()