v2026.4.1
All Bundles

VideoWriter

OpenCV VideoWriter for writing video files

Operations

FourCC

Computes a FourCC code from four characters. Example: FourCC('m', 'p', '4', 'v') for MP4V codec.

function : FourCC(c1:Char, c2:Char, c3:Char, c4:Char) ~ Int

Parameters

NameTypeDescription
c1Charfirst character
c2Charsecond character
c3Charthird character
c4Charfourth character

Return

TypeDescription
Intinteger FourCC code

IsOpen

Checks if the VideoWriter has been successfully opened.

method : public : IsOpen() ~ Bool

Return

TypeDescription
Booltrue if the writer is open, false otherwise

New

Creates a new VideoWriter.

New(filename:String, fourcc:Int, fps:Float, width:Int, height:Int)

Parameters

NameTypeDescription
filenameStringoutput video file path
fourccInt4-character codec code (use FourCC to compute)
fpsFloatframes per second
widthIntframe width
heightIntframe height

Release

Releases the VideoWriter and closes the file.

method : public : Release() ~ Nil

Write

Writes a frame to the video file.

method : public : Write(image:Image) ~ Nil

Parameters

NameTypeDescription
imageImagethe frame to write