OpenCV VideoWriter ffmpeg again and again

701 views Asked by At

I know this question was asked hundred of times, nevertheless I got problems.

I'm working on a new windows (2010 server) systen, installed Python 2.7.9 and OpenCV 2.4.10. I copied opencv_ffmpeg.dll to Python27\opencv_ffmpeg2410.dll. I also installed K-Lite video codecs. If I try to save a video with VideoWriter (MJPG), I get always a file with size 5682 bytes which is not playable. On my old system the same python code works, but over the years I installed several versions of drivers and ffmpeg and whatever. So is there a systematic way to get VideoWriter working if you are on a freshly installed system?

1

There are 1 answers

0
Michael Hecht On

Ok, it was my own fault. All the above steps were ok. I made the error to define cv2.VideoWriter(fname,fourcc,2,(w,h),1) with (w,h) different to the actual frame size (I thought it rescales automaticly). Unfortunately there is no appropriate error message.

So my problem is solved.