Skip to main content
Stream video from webcams attached to the Lager Box for visual inspection, automated vision testing, and remote monitoring.

Import

Methods

Method Reference

Net.get(name, type=NetType.Webcam)

Get a webcam net by name.
Parameters: Returns: Webcam Net instance

start(box_ip)

Start a webcam video stream.
Parameters: Returns: dict with keys:
  • url - Full stream URL (e.g., http://<BOX_IP>:8086/)
  • port - Port number for the stream
  • already_running - Boolean indicating if stream was already active
Raises: RuntimeError if device is already in use or not found

stop()

Stop the webcam stream.
Returns: bool - True if stopped successfully, False if not running

get_info(box_ip)

Get information about the stream.
Parameters: Returns: dict or None - Stream info dict or None if not running. The dict has these keys:
  • url - Full stream URL
  • port - Port number for the stream
  • video_device - Video device path, such as /dev/video0
  • source - The tool that started the stream: 'api' for this Python API, 'cli' for lager webcam. None for a stream with no recorded origin.
  • started_by - The user that the starting tool named. None for a stream started from this Python API.

get_url(box_ip)

Get just the URL for the stream.
Parameters: Returns: str or None - Stream URL or None if not running

is_active()

Check if the stream is currently active.
Returns: bool - True if the stream is active, False otherwise
The Python API has no snapshot method. To save one frame from a running stream, use lager webcam NET snapshot from your computer.

Examples

Start Multiple Cameras

Stream Management

Visual Inspection Test

Camera Discovery and Testing

Already Running Detection

Web Interface

Each stream provides a web interface at its URL with:
  • Live MJPEG video stream
  • Zoom, focus, and brightness sliders, with an autofocus button
  • FPS display
  • Sidebar with links to other active streams

API Endpoints

Hardware Requirements

Notes

  • Webcam nets must be configured on the Lager Box with video device path
  • Streams run on ports starting from 8086
  • Each stream uses a separate port, automatically allocated
  • Streams persist until explicitly stopped or the process dies
  • Dead stream processes are automatically cleaned up
  • Only one stream can use a video device at a time
  • Default resolution is 640x480 at 30 FPS
  • JPEG quality is set to 80 for bandwidth/quality balance
  • Streams are reachable over HTTP at the Lager Box IP address. On an access-gated box, a request needs a sign-in token, and the url from start() carries none. Use lager webcam url for a link that carries your token
  • Zoom is digital (crop and scale), not optical