v2026.6.4
All Bundles
Bundle OpenCV computer vision library. Image supports loading, saving, resizing, color conversion, blurring, edge detection, cropping, and drawing. VideoCapture reads from files or camera streams. Compile with -lib opencv.

VideoWriter

OpenCV VideoWriter for writing video files

Operations

FourCC # function

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

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