tags:

views:

23

answers:

0

Hi, I want to write some 1 channel gray images as videos. Here is the code I use:

cv::VideoWriter video("file.avi",CV_FOURCC('X','V','I','D'),25,cv::Size(image.cols,image.rows),0);
//....
video<<image;

I get the following error:

highgui/cvcap_ffmpeg.cpp:1065: virtual bool CvVideoWriter_FFMPEG::writeFrame(const IplImage*): Assertion `image->imageSize == avpicture_get_size( input_pix_fmt, image->width, image->height )' failed.

If I convert image to a 3 channel image, and create video with the last parameter 1 (instead of 0) everything is OK, but can't success with 1 channel image. Any help?