Skip to content
Advertisement

Saving a video capture in python with openCV : empty video

I’m new in Python (2.7) and I try to work on video processing (with module openCv “cv2”). Starting with tutorials, I try to use the script of this tutorial : paragraph “Saving a video”. Everything works fine excepting that the video I’m saving is empty. I can find output.avi in my directory but its memory size is 0kb an, of course when I run it, no video is displayed.

After a few changes here is my code :

JavaScript

Does anyone know why it is not working properly ?

Thanks a lot. Edwin

Advertisement

Answer

I never worked with openCV, but I bet the problem is in

JavaScript

This is a C version of the VideoCapture method http://docs.opencv.org/modules/highgui/doc/reading_and_writing_images_and_video.html#videocapture

Maybe you can try to do the same. Something like

JavaScript

EDIT: just downloaded Python and OpenCV and discovered the problem was the codec. Try to change

JavaScript

for

JavaScript

and select the codec by hand.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement