I am trying to do some simple video processing using OpenCV and Python (v2.7.3, running under FC18 64bit) but it looks like I am stuck at the very beginning... opening the video
I am using this very simple code:
import cv2
import cv2.cv as cv
filename = "/home/nico/Documents/test.avi"
vidFile = cv2.VideoCapture(filename)
nFrames = int(vidFile.get(cv.CV_CAP_PROP_FRAME_COUNT))
fps = vidFile.get(cv.CV_CAP_PROP_FPS)
print("Num. frames = ",nFrames)
print("Frame rate = ", fps, " fps")
This results in:
warning: GStreamer: Error opening bin
(/builddir/build/BUILD/opencv-2.4.5/modules/highgui/src/cap_gstreamer.cpp:354)
('Num. Frames = ', 0)
('Frame Rate = ', 0.0, ' fps')
The file exists and it is readable.
GStreamer seems to be properly installed (packages gstreamer, gstreamer-plugins-*, gstreamer-python) and up-to-date
If I convert the file into ogg and try to open it with the same code I get a different error
warning: GStreamer: unable to query position of stream (/builddir/build/BUILD/opencv-2.4.5/modules/highgui/src/cap_gstreamer.cpp:660)
Any idea how to resolve this problem?