Ask Your Question

VideoCapture & Python returns False trying to read a video file

asked 2015-02-03 03:46:25 -0500

Graf gravatar image

When i try to read some video files using VideoCapture, i only get False in return. I did try it on my Pi and Windows 8.1, using OpenCV 2.4.10 on both systems. Python 2.7.3 (Raspberry PI) and 2.7.5 on Windows. So far all needed codecs are installed, on the Pi ffmpeg. ffmpeg Works on the Pi. Did also try to read a mpg video using pygame and it works. I can successfully read images or directly from webcams but so far no videos from a file and i did try a lot of codecs so far.

Did try to run Python in verbose and also did try to find some logs who may help me find my mistake. So far without any luck.

edit retag flag offensive close merge delete


Thank you, works perfectly! :)

Graf gravatar imageGraf ( 2015-03-11 15:00:23 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2015-02-26 10:57:19 -0500

mikr gravatar image

For me on Windows 8.1 it helped:

  1. to use DLLs inside installation package: sources/3rdparty/ffmpeg (opencv_ffmpeg.dll and opencv, _ffmpeg_64.dll)
  2. copy them to c:\Python27 directory and rename them accordingly to openCV version used.

for openCV 2.4.10

  • opencv_ffmpeg2410.dll
  • opencv_ffmpeg2410_64.dll

for openCV 3.0.0 beta

  • opencv_ffmpeg300.dll
  • opencv_ffmpeg300_64.dll
edit flag offensive delete link more


Can you also give steps for Ubuntu 16

rock19 gravatar imagerock19 ( 2017-09-14 01:27:07 -0500 )edit

Question Tools



Asked: 2015-02-03 03:46:25 -0500

Seen: 9,297 times

Last updated: Mar 11 '15