Skip to main content

UPort USB UVC Camera Video Streaming

Prerequisite:

  • A USB camera that supports the UVC protocol is connected to UPort. Most USB cameras support UVC.

Stream Video from a USB Camera

Open the Camera page in the web interface. In most cases, two video devices are detected. Select the first one, video0.

Then click Start streaming. UPort streams image data captured by the camera over HTTP. When you are not using video streaming, turn it off to avoid occupying CPU and bandwidth.

info

Because the chip used by UPort does not include an H264 hardware encoder, USB camera video streaming directly transmits MJPEG image data. Resolution and frame rate are limited by bandwidth. We recommend 640x480@15fps, which uses about 1 MB/s of bandwidth. Higher resolutions or frame rates may cause dropped frames.

Example Python Code

The video stream URL is displayed below. It looks like http://192.168.123.1/api/v1/camera/stream. Use the following code to retrieve image data:

import cv2

url = "http://192.168.123.1/api/v1/camera/stream"
cap = cv2.VideoCapture(url)
ok, frame = cap.read()
cap.release()

if ok:
cv2.imwrite("camera_snapshot.jpg", frame)