VideoSink

class cscore.VideoSink

Bases: pybind11_object

A sink for video that accepts a sequence of frames.

class Kind(value: SupportsInt | SupportsIndex)

Bases: pybind11_object

Members:

UNKNOWN : Unknown sink type.

MJPEG : MJPEG video sink.

CV : CV video sink.

RAW : Raw video sink.

CV = <Kind.CV: 4>
MJPEG = <Kind.MJPEG: 2>
RAW = <Kind.RAW: 8>
UNKNOWN = <Kind.UNKNOWN: 0>
VideoSink.Kind.name -> str
property value
enumerate_properties() list[cscore._cscore.VideoProperty]

Enumerate all properties of this sink.

static enumerate_sinks() list[cscore._cscore.VideoSink]

Enumerate all existing sinks.

Returns:

Vector of sinks.

get_config_json() str

Get a JSON configuration string.

Returns:

JSON configuration string

get_config_json_object() wpiutil.json

Get a JSON configuration object.

Returns:

JSON configuration object

get_description() str

Get the sink description. This is sink-kind specific.

get_handle() int

Returns the VideoSink handle.

Returns:

The VideoSink handle.

get_kind() cscore._cscore.VideoSink.Kind

Get the kind of the sink.

get_last_status() int
get_name() str

Get the name of the sink. The name is an arbitrary identifier provided when the sink is created, and should be unique.

get_property(name: str) cscore._cscore.VideoProperty

Get a property of the sink.

Parameters:

name – Property name

Returns:

Property (kind Property::kNone if no property with the given name exists)

get_source() cscore._cscore.VideoSource

Get the connected source.

Returns:

Connected source (empty if none connected).

get_source_property(name: str) cscore._cscore.VideoProperty

Get a property of the associated source.

Parameters:

name – Property name

Returns:

Property (kind Property::kNone if no property with the given name exists or no source connected)

set_config_json(*args, **kwargs)

Overloaded function.

  1. set_config_json(self: cscore._cscore.VideoSink, config: str) -> bool

Set properties from a JSON configuration string.

The format of the JSON input is:

{
    "properties": [
        {
            "name": property name
            "value": property value
        }
    ]
}
Parameters:

config – configuration

Returns:

True if set successfully

  1. set_config_json(self: cscore._cscore.VideoSink, config: wpiutil.json) -> bool

Set properties from a JSON configuration object.

Parameters:

config – configuration

Returns:

True if set successfully

set_source(source: cscore._cscore.VideoSource) None

Configure which source should provide frames to this sink. Each sink can accept frames from only a single source, but a single source can provide frames to multiple clients.

Parameters:

source – Source