Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Size(CAP_PROP_FRAME_WIDTH, CAP_PROP_FRAME_HEIGHT) -- that's for sure wrong, as it expands to Size(3,4) ;)

those constants are for the VideoCapture, and you don't even have one.

you need to choose the desired Video size, like:

Size frameSize(640, 480);
VideoWriter wrteri("C:\\Users\\Bla3\\Combined.avi", VideoWriter::fourcc('M', 'J', 'P', 'G'), 5, frameSize , true);

and in the loop, resize the images to that (since your images may have arbitrary sizes):

resize(img, img, fameSize);
writer.write(img);

Size(CAP_PROP_FRAME_WIDTH, CAP_PROP_FRAME_HEIGHT) -- that's for sure wrong, as it expands to Size(3,4) ;)

those constants are for the VideoCapture, and you don't even have one.

you need to choose the desired Video size, like:

Size frameSize(640, 480);
VideoWriter wrteri("C:\\Users\\Bla3\\Combined.avi", VideoWriter::fourcc('M', 'J', 'P', 'G'), 5, frameSize , true);

and in the loop, resize the images to that (since your images may have arbitrary sizes):

resize(img, img, fameSize);
frameSize);
writer.write(img);

Size(CAP_PROP_FRAME_WIDTH, CAP_PROP_FRAME_HEIGHT) -- that's for sure wrong, as it expands to Size(3,4) ;)

those constants are for the VideoCapture, and you don't even have one.

you need to choose the desired Video size, like:

Size frameSize(640, 480);
VideoWriter wrteri("C:\\Users\\Bla3\\Combined.avi", writer("C:\\Users\\Bla3\\Combined.avi", VideoWriter::fourcc('M', 'J', 'P', 'G'), 5, frameSize , true);

and in the loop, resize the images to that (since your images may have arbitrary sizes):

resize(img, img, frameSize);
writer.write(img);