buffolander
buffolander

Reputation: 102

OpenCV can't use VideoCapture with url

I'm trying to open a video from a Google Cloud Storage url and process it in a cloud function - the file is publicly available. But v.read() returns None.

Sample video url: https://storage.googleapis.com/dev-brdu1976/268.mov

v = cv2.VideoCapture(request.json['Source_Storage_Path'])
    print(v)
    frameNum = -1
    while (True):
        ret_value,frame = v.read()
        if ret_value == False or frame is None:
            print('Frame is None')
            break
        frameNum += 1
        #do stuff

Upvotes: 1

Views: 1096

Answers (1)

buffolander
buffolander

Reputation: 102

I figured out how to make it work but I didn't dig into the specifics. Requesting the video via https doesn't open - it did work when I changed the url protocol to http instead.

Upvotes: 2

Related Questions