On Debian Linux (using ffmpeg):
int width = 640; int height = 480; bool isColor = true; string outFName = "out.avi"; Size frameSize = Size(width, height); int fourcc = VideoWriter::fourcc('p', 'n', 'g', ' '); outputVideo.open(outFName, fourcc, cap.get(CAP_PROP_FPS), frameSize, isColor));
source share