Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

asked 2018-07-24 00:15:33 -0600

Nbb gravatar image

Python OpenCV - How to read AVI file

How can i read an avi file using python opencv ? The following code below does not work

import numpy as np
import cv2
import os

cap = cv2.VideoCapture('/home/ast/datasets/ewap/seq_eth/seq_eth.avi')

ret, frame = cap.read()
print(ret)
print(np.shape(frame))

I get output

False
()

Python OpenCV - How to read AVI file

How can i read an avi file using python opencv ? The following code below does not work

import numpy as np
import cv2
import os

cap = cv2.VideoCapture('/home/ast/datasets/ewap/seq_eth/seq_eth.avi')

ret, frame = cap.read()
print(ret)
print(np.shape(frame))

I get output

False
()

I have verified that the file /home/ast/datasets/ewap/seq_eth/seq_eth.avi does exist