Ask Your Question

Revision history [back]

Writing raw video using VideoWriter

I want to write a video file as a raw AVI and have not been successful using VideoWriter. I can write a video file using

fourcc = cv::VideoWriter::fourcc('3', 'I', 'V', 'D')

I've tried other fourcc codes for raw video from the list at ff_codec_movvideo_tags I've also tried setting fourcc and fps to 0, but that caused an error.

VideoWriter video;
fourcc = 0;
fps=0;
if (!video.open(rec, fourcc, fps, Size(w, h)))
    return -1;

The open returns o and the program ends with return -1. I would appreciate any help in the code I need to write a raw file. I'm using OpenCV 4.1.1