VideoCapture from file [closed]

asked 2013-10-29 04:44:50 -0600

eran gravatar image

updated 2013-10-29 05:22:43 -0600

Hi,

I'm kinda new to opencv, and cant figure out what i'm doing wrong while opening a video file with VideoCapture functionality.

I only use this simple code:

import cv2
cap = cv2.VideoCapture()
cap.open("Field.avi")
print cap.isOpened()

I tried installing k-lite's most updated codec pack, and several more. Still, I get 'False'. Needless to say, the video is in the same folder as the py file.

The video works on the media player.

Thanks!

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by sturkmen
close date 2020-11-14 15:24:04.522820

Comments

1

Are your path variables set correctly? If the python code isn't able to find the ffmpeg library which is in the provided library structure, then it will never execute correctly...

StevenPuttemans gravatar imageStevenPuttemans ( 2013-10-29 05:27:30 -0600 )edit

I've copied opencv_ffmpeg.dll to the Python27 folder. Is that what you mean?

eran gravatar imageeran ( 2013-10-29 05:31:44 -0600 )edit

I have no experience with python but when using the C++ interface on Windows, I have to define the location of all additional libraries and include folders. The PATH variable is used to define where the dll's for those libraries are found. I guess you need to do something equal in python?

StevenPuttemans gravatar imageStevenPuttemans ( 2013-10-29 05:44:54 -0600 )edit

The Python27 folder is written in PATH variable

eran gravatar imageeran ( 2013-10-29 06:03:52 -0600 )edit