Python + OpenCV reading a video (error opening file video)

asked 2014-11-30 13:14:26 -0600

Hello and Thanks everyone.

I want to read a video, using Python and OpenCV.

This is the code:

import numpy as np import cv2

cap = cv2.VideoCapture('MVI_0073.avi')

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()

When I running this code, it appears this error:

warning: GStreamer: Error opening bin (/builddir/build/BUILD/opencv-2.4.7/modules/highgui/src/cap_gstreamer.cpp:354)

I install all Codecs - gstreamer-plugins* - gstreamer-python - gstreamer

I use Fedora.

Any idea?

Thanks!!!

Txema

edit retag flag offensive close merge delete