Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I'm trying to use open cv (2.4.9) video support from within C++. However, when I try to open a video file with cv::VideoCapture I get

warning: Error opening file (/tmp/opencv-mLsrDm/opencv-2.4.9/modules/highgui/src/cap_ffmpeg_impl.hpp:545)
WARNING: Couldn't read movie file 11:28:39.mp4

Using cv2.VideoCapture from within python on the same file works. The python wrappers are from the same build of opencv so I'm a bit perplexed.

Mac os 10.9.4. OpenCV is built with ffmpeg (but no quicktime) via homebrew.

I'm linking against all the libraries that the the python cv2.so is linked against.

Any ideas? Thanks.

share|improve this question

1 Answer 1

It turned out that ffmpeg doesn't like file names like 11:28:39.mp4. Renaming the file to test.mp4 makes things work.

share|improve this answer
    
It is not working for me? could some body help me to debug the issue. I am trying to capture video from file but it is giving the following error.Command: cap = cv2.VideoCapture('test.mp4') Error: "WARNING: Couldn't read movie file test.mp4" –  anil kumar Nov 14 '14 at 9:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.