[問題] opencv Couldn't read movie file

作者: diesnow (0 0)   2014-12-15 00:28:29
環境如下:
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到的方法還是不行
感謝
作者: dritchie (卍~邁斯納效應~卍)   2014-12-16 22:20:00
作者: zcxcxc20002 (凌晨是我)   2014-12-22 16:32:00
最近我也遇到無法讀檔,我要讀avi,一直失敗,後來直接改成mp4就可以了@@“

Links booklink

Contact Us: admin [ a t ] ucptt.com