環境如下:
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到的方法還是不行
感謝