CVVideoCapture - matt-s-clark/godot-gdextension-opencv GitHub Wiki

Used to read video files and camera streams. More information here.

get

Prototype: float get(int propId)

Returns the value of an specific property. See CVConsts.VideoCaptureProperties.

getBackendName

Prototype: String getBackendName()

Returns used backend API name.

getExceptionMode

Prototype: bool getExceptionMode()

Returns true if exception mode is active.

grab

Prototype: bool grab()

Grabs the next frame from video capture device, returns true in case of success. You can use retrieve to get the mat.

is_opened

Prototype: bool is_opened()

Returns true if video capturing has been initialized correctly.

open

Prototype: void open(Variant source, int api_preference, Variant parameters)

Opens a video file or a capturing device or an IP video stream for video capturing if a string is passed or a camera if it's integer index is passed. Parameters should be either null or an array of integers. Parameters are sent as pairs of numbers according to this.

read

Prototype: CVMat read()

Returns the current frame of the video capture as a mat.

release

Prototype: void release()

Closes video file or capturing device.

retrieve

Prototype: CVMat retrieve(Dictionary additional_parameters)

Returns the grabbed video frame, should be used in conjunction with grab.

  • Additional parameters: flag : Int

set

Prototype: bool set(int propId, float value)

Sets the value of an specific property. See CVConsts.VideoCaptureProperties.

setExceptionMode

Prototype: void setExceptionMode(bool enable)

Switches exceptions mode.