<< VideoWriter_isOpened | Video writing | delete_VideoWriter >>

scicv >> Video > Video writing > VideoWriter_write

# VideoWriter_write

Writes the next video frame.

### Syntax

    ret = VideoWriter_write(videoWriter, frame)

### Parameters

videoWriter

  Video writer object (VideoWriter).

frame

  The frame to write (Mat).

### Description

`VideoWriter_write` writes a frame to a video.

### 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

- new_VideoWriter

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