Ask Your Question

badwolf1210's profile - activity

2015-01-07 06:42:30 -0600 received badge  Self-Learner (source)
2015-01-07 05:45:38 -0600 received badge  Editor (source)
2014-12-30 13:54:56 -0600 answered a question Video not recording. No errors

[SOLVED]

Apparently I made some mistake in the installation or something. This problem was solved by using this script to (re-)install OpenCV:

https://github.com/jayrambhia/Install...

I guess I had some dependencies missing or something (even though I got no errors when installing). Anyway, thank you very much for the help!

2014-12-26 13:23:02 -0600 asked a question Video not recording. No errors

Hi! I am new in this forum and also pretty new with opencv. I am trying to make some image processing codes, and I found a problem when trying to record video from my webcam. My code is supposed to display the webcam and record the images in a file. When I run it I don't get any errors, and the webcam is displayed correctly, but no file is created.

This is the minimum code:

import cv2
cap = cv2.VideoCapture(0)
## Define the codec and create VideoWriter object
fourcc = cv2.cv.CV_FOURCC(*'XVID')
out_writer = cv2.VideoWriter('output.avi',fourcc, 25, (640,480),isColor=True)
a = True
while a:
    a, frame = cap.read()
    out_writer.write(frame)
    cv2.imshow('Video',frame)
    # Break if <Esc> key
    k = cv2.waitKey(5) & 0xFF
    if k == 27:
      a = False
## Release everything if job is finished
cap.release()
out_writer.release()
cv2.destroyAllWindows()

When I run it I only get:

$ python save_video.py 
init done 
opengl support available

And no "output.avi" file is created.

Any idea of what I am doing wrong??!! Thanks for any help you can give me!!