video format not supported when opening the video created using videowriter
I am creating a video using an image series in a folder which are named as 'image0, image1,...'. But when I try to open the video file created, its not opening. I tried opening it with VLC, media player etc. Am i doing something wrong while creating the VideoWriter object?
//Write video
VideoWriter ovideoWriter("C:/Users/chandr_m/Desktop/KCF - Copy/MyVideo.avi",CV_FOURCC('M','J','P','G''), 30,
frameSize);
I take the images as given below:
Mat Image;
do
{
sequence>>Image;
if(Image.empty())
break;
printf("Write image to video \n");
Mat imageArr[] = { Image, Image, Image };
merge(imageArr, 3, imageGrey);
oVideoWriter.write(imageGrey);
}
while(!Image.empty());
that's not enough code, to validate your approach.
please also check the return value of
oVideoWriter.write
(did the framesize match ?)