Why don't you check for errors? If it CreateVideoWriter()does not work, you will never know.
I think CreateVideoWriter returns NULL . Add the appropriate code to verify the return and make sure it is true.
If so, the problem is most likely CV_FOURCC()that the codec cannot find.
: AVI OpenCV
OpenCV ( , v2.2).
:
CreateVideoWriter:
import sys
from opencv.cv import *
from opencv.highgui import *
im1 = cvLoadImage("img1.jpg")
if not im1:
print "Could not load im1"
im2 = cvLoadImage("img2.jpg")
if not im2:
print "Could not load im2"
fps = 4.0
frame_size = cvGetSize(im1)
writer = cvCreateVideoWriter("out.avi", CV_FOURCC('F', 'L', 'V', '1'), fps, frame_size, True)
if not writer:
print "Error in creating video writer"
sys.exit(1)
else:
print cvWriteFrame(writer, im1)
print cvWriteFrame(writer, im2)
cvReleaseVideoWriter(writer)
, OpenCV/Linux/Python cvCreateVideoWriter(). , .