hello i’m testing opencv with video. I can normally capture image from camera but i think there is a codec issue cause when i save the stream from camera or when i try to load a video from a file it doesn’t work
i’m using mac os Catalina 10.15.7, python 3.8.5, ffmpeg 4.3.1
this is my code
import cv2 import numpy as np vid = cv2.VideoCapture('trailer.mp4') while(vid.isOpened()): ret, frame = vid.read() cv2.imshow('frame',frame) k = cv2.waitKey(25) if k == 27: break vid.release() cv2.destroyAllWindows()
The error i get is OpenCV: Couldn’t read video stream from file
what’s the problem?? is it a codec error?