环境如下:
IDE:Pycharm
python 2.7
ffmpeg v.2.5
OS: OSX 10.10.1
import numpy as np
import cv2
cap = cv2.VideoCapture('/Users/../test.mkv') <=这边是用绝对路径
while(cap.isOpened()):
ret, frame = cap.read()
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
cv2.imshow('frame',gray)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()
========================================================
但是run下去结果是WARNING: Couldn't read movie file
请问要怎么改善Orz
尝试了很多种GOOGLE到的方法还是不行
感谢