You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The watchdog is a crucial component in the operation of POE (Power over Ethernet) devices with DepthAI. When DepthAI disconnects from a POE device, the watchdog mechanism is the first to respond, initiating a reset of the camera. This reset is followed by a complete system reboot, which includes the loading of the DepthAI bootloader and the initialization of the entire networking stack.
66
+
67
+
.. note::
68
+
This process is necessary to make the camera available for reconnection and typically takes about 10 seconds, which means the fastest possible reconnection time is 10 seconds.
69
+
70
+
71
+
Customizing the Watchdog Timeout
72
+
--------------------------------
73
+
74
+
.. tabs::
75
+
76
+
.. tab:: **Linux/MacOS**
77
+
78
+
Set the environment variables `DEPTHAI_WATCHDOG_INITIAL_DELAY` and `DEPTHAI_BOOTUP_TIMEOUT` to your desired timeout values (in milliseconds) as follows:
The DepthAI UVC (`USB Video Class <https://en.wikipedia.org/wiki/USB_video_device_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.
5
+
6
+
What is UVC?
7
+
############
8
+
9
+
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.
10
+
11
+
How Does the UVC Node Work?
12
+
###########################
13
+
14
+
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.
15
+
16
+
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.
17
+
18
+
.. note::
19
+
20
+
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 :ref:`ImageManip` node. It's important to note that streams incompatible with NV12 conversion, like depth streams, are not supported by the UVC node.
21
+
22
+
Examples of UVC Node Usage
23
+
##########################
24
+
25
+
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.
26
+
27
+
.. code-block:: bash
28
+
29
+
python3 depthai_demo.py --app uvc
30
+
31
+
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:
32
+
33
+
- :ref:`UVC & Color Camera`
34
+
- :ref:`UVC & Mono Camera`
35
+
- :ref:`UVC & Disparity`
36
+
37
+
38
+
3. **OBS Forwarding**: For applications where direct UVC node usage is not possible, OBS Studio can be used to forward the UVC stream.
This example demonstrates the capabilities of the :ref:`FeatureTracker` combined with motion estimation. It detects and tracks features between consecutive frames using optical flow.
5
+
Each feature is assigned a unique ID. The motion of the camera is estimated based on the tracked features, and the estimated motion (e.g., Up, Down, Left, Right, Rotating) is displayed on screen.
6
+
7
+
The :ref:`Feature Detector` example only detects features without estimating motion.
This example demonstrates how to use your OAK device as a UVC webcam. The UVC feature allows you to use your OAK device as a regular webcam in applications like OpenCV's :code:`cv2.VideoCapture()`, native camera apps, and more.
5
+
6
+
.. rubric:: How It Works:
7
+
8
+
The :ref:`StereoDepth` node outputs image data in the UINT8 format. However, the :ref:`UVC` node expects the data in NV12 format. To bridge this gap, an intermediary :ref:`ImageManip` node is used to convert the GRAY8 output from the MonoCamera node to NV12 format, which is then passed to the UVC node for streaming.
9
+
This doesn't work with stereo depth output, since depth is UINT16 which we cannot convert to NV12.
10
+
11
+
This example won't work if we enable the subpixel disparity feature, since that outputs UINT16 as well.
12
+
13
+
.. rubric:: Similar samples:
14
+
15
+
- :ref:`UVC & Color Camera`
16
+
- :ref:`UVC & Mono Camera`
17
+
18
+
19
+
Setup
20
+
#####
21
+
22
+
.. include:: /includes/install_from_pypi.rst
23
+
24
+
Code used for testing
25
+
#####################
26
+
27
+
.. code-block:: python
28
+
29
+
import cv2
30
+
31
+
# Initialize the VideoCapture object to use the default camera (camera index 0 is webcam)
32
+
cap = cv2.VideoCapture(1)
33
+
34
+
# Check if the camera opened successfully
35
+
ifnot cap.isOpened():
36
+
print("Error: Could not open camera.")
37
+
exit()
38
+
39
+
# Loop to continuously get frames from the camera
40
+
whileTrue:
41
+
ret, frame = cap.read()
42
+
43
+
ifnot ret:
44
+
print("Error: Could not read frame.")
45
+
break
46
+
47
+
cv2.imshow('Video Feed', frame)
48
+
49
+
if cv2.waitKey(1) &0xFF==ord('q'):
50
+
break
51
+
52
+
cap.release()
53
+
cv2.destroyAllWindows()
54
+
55
+
56
+
Source code
57
+
###########
58
+
59
+
.. tabs::
60
+
61
+
.. tab:: Python
62
+
63
+
Also `available on GitHub <https://github.com/luxonis/depthai-python/blob/main/examples/UVC/uvc_disparity.py>`__
This example demonstrates how to use a mono camera on your OAK device to function as a webcam. The UVC feature allows you to use your OAK device as a regular webcam in applications like OpenCV's :code:`cv2.VideoCapture()`, native camera apps, and more.
5
+
6
+
.. rubric:: How It Works:
7
+
8
+
The :ref:`MonoCamera` node outputs image data in the GRAY8 format. However, the :ref:`UVC` node expects the data in NV12 format. To bridge this gap, an intermediary :ref:`ImageManip` node is used to convert the GRAY8 output from the MonoCamera node to NV12 format, which is then passed to the UVC node for streaming.
9
+
10
+
11
+
.. rubric:: Similar samples:
12
+
13
+
- :ref:`UVC & Color Camera`
14
+
- :ref:`UVC & Disparity`
15
+
16
+
17
+
Setup
18
+
#####
19
+
20
+
.. include:: /includes/install_from_pypi.rst
21
+
22
+
Code used for testing
23
+
#####################
24
+
25
+
.. code-block:: python
26
+
27
+
import cv2
28
+
29
+
# Initialize the VideoCapture object to use the default camera (camera index 0 is webcam)
30
+
cap = cv2.VideoCapture(1)
31
+
32
+
# Check if the camera opened successfully
33
+
ifnot cap.isOpened():
34
+
print("Error: Could not open camera.")
35
+
exit()
36
+
37
+
# Loop to continuously get frames from the camera
38
+
whileTrue:
39
+
ret, frame = cap.read()
40
+
41
+
ifnot ret:
42
+
print("Error: Could not read frame.")
43
+
break
44
+
45
+
cv2.imshow('Video Feed', frame)
46
+
47
+
if cv2.waitKey(1) &0xFF==ord('q'):
48
+
break
49
+
50
+
cap.release()
51
+
cv2.destroyAllWindows()
52
+
53
+
54
+
55
+
Source code
56
+
###########
57
+
58
+
.. tabs::
59
+
60
+
.. tab:: Python
61
+
62
+
Also `available on GitHub <https://github.com/luxonis/depthai-python/blob/main/examples/UVC/uvc_mono.py>`__
0 commit comments