UVC

The DepthAI UVC (USB Video Class) node allows OAK devices to function as standard webcams. This feature is particularly useful for integrating OAK devices into applications that require video input, such as video conferencing tools or custom video processing applications.

What is UVC?

UVC refers to the USB Video Class standard, which is a USB device class that describes devices capable of streaming video. This standard allows video devices to interface with computers and other devices without needing specific drivers, making them immediately compatible with a wide range of systems and software.

How Does the UVC Node Work?

The UVC node in DepthAI leverages this standard to stream video from OAK devices. When the UVC node is enabled, the OAK device is recognized as a standard webcam by the host system. This allows the device to be used in any application that supports webcam input, such as Zoom, Skype, or custom video processing software.

The UVC node streams video data over a USB connection. It is important to use a USB3 cable for this purpose, as USB2 may not provide the necessary bandwidth for stable video streaming.

Note

The UVC node can currently handle NV12 video streams from OAK devices. For streams in other formats, conversion to NV12 is necessary, which can be achieved using the ImageManip node. It’s important to note that streams incompatible with NV12 conversion, like depth streams, are not supported by the UVC node.

Examples of UVC Node Usage

  1. DepthAI Demo Script: The DepthAI demo script includes a UVC application that can be run to enable the UVC node on an OAK device.

    python3 depthai_demo.py --app uvc
    
  2. Custom Python Script: A custom Python script can be written to enable the UVC node and configure the video stream parameters. Here are some pre-written examples:

  3. OBS Forwarding: For applications where direct UVC node usage is not possible, OBS Studio can be used to forward the UVC stream.

Reference

class depthai.node.UVC
class Id

Node identificator. Unique for every node on a single Pipeline

getAssetManager(*args, **kwargs)

Overloaded function.

  1. getAssetManager(self: depthai.Node) -> depthai.AssetManager

  2. getAssetManager(self: depthai.Node) -> depthai.AssetManager

getInputRefs(*args, **kwargs)

Overloaded function.

  1. getInputRefs(self: depthai.Node) -> List[depthai.Node.Input]

  2. getInputRefs(self: depthai.Node) -> List[depthai.Node.Input]

getInputs(self: depthai.Node) → List[depthai.Node.Input]
getName(self: depthai.Node)str
getOutputRefs(*args, **kwargs)

Overloaded function.

  1. getOutputRefs(self: depthai.Node) -> List[depthai.Node.Output]

  2. getOutputRefs(self: depthai.Node) -> List[depthai.Node.Output]

getOutputs(self: depthai.Node) → List[depthai.Node.Output]
getParentPipeline(*args, **kwargs)

Overloaded function.

  1. getParentPipeline(self: depthai.Node) -> depthai.Pipeline

  2. getParentPipeline(self: depthai.Node) -> depthai.Pipeline

setGpiosOnInit(self: depthai.node.UVC, list: Dict[int, int])None
setGpiosOnStreamOff(self: depthai.node.UVC, list: Dict[int, int])None
setGpiosOnStreamOn(self: depthai.node.UVC, list: Dict[int, int])None
class dai::node::UVC : public dai::NodeCRTP<Node, UVC, UVCProperties>

UVC (USB Video Class) node.

Public Functions

UVC(const std::shared_ptr<PipelineImpl> &par, int64_t nodeId)
UVC(const std::shared_ptr<PipelineImpl> &par, int64_t nodeId, std::unique_ptr<Properties> props)
void setGpiosOnInit(std::unordered_map<int, int> list)

Set GPIO list <gpio_number, value> for GPIOs to set (on/off) at init.

void setGpiosOnStreamOn(std::unordered_map<int, int> list)

Set GPIO list <gpio_number, value> for GPIOs to set when streaming is enabled.

void setGpiosOnStreamOff(std::unordered_map<int, int> list)

Set GPIO list <gpio_number, value> for GPIOs to set when streaming is disabled.

Public Members

Input input = {*this, "in", Input::Type::SReceiver, true, 8, true, {{DatatypeEnum::Buffer, true}}}

Input for image frames to be streamed over UVC

Default queue is blocking with size 8

Public Static Attributes

static constexpr const char *NAME = "UVC"

Got questions?

Head over to Discussion Forum for technical support or any other questions you might have.