<< Video writing Video writing VideoWriter_isOpened >>

scicv >> Video > Video writing > VideoWriter

VideoWriter

Class for writing videos

Description

VideoWriter is the class to write video files.

A VideoWriter object is constructed with new_VideoWriter. The instance returned is used as argument of each of the VideoWriter functions, such as VideoWriter_read, etc. A VideoWriter object must be deleted with delete_VideoWriter.

Examples

scicv_Init();

img = imread(getSampleImage("lena.jpg"));

videoWriter = new_VideoWriter("video.avi", CV_FOURCC('M', 'P', '4', '2'), 4, size(img));

if ~VideoWriter_isOpened(videoWriter) then
    disp("Cannot create video file: " + filename);
end

for x=1:200
    VideoWriter_write(videoWriter, img);
end;

delete_VideoWriter(videoWriter);

See also


Report an issue
<< Video writing Video writing VideoWriter_isOpened >>