Import
Methods
Method Reference
Net.get(name, type=NetType.Webcam)
Get a webcam net by name.
Returns: Webcam Net instance
start(box_ip)
Start a webcam video stream.
Returns:
dict with keys:
url- Full stream URL (e.g.,http://<BOX_IP>:8086/)port- Port number for the streamalready_running- Boolean indicating if stream was already active
RuntimeError if device is already in use or not found
stop()
Stop the webcam stream.
bool - True if stopped successfully, False if not running
get_info(box_ip)
Get information about the stream.
Returns:
dict or None - Stream info dict or None if not running. The dict
has these keys:
url- Full stream URLport- Port number for the streamvideo_device- Video device path, such as/dev/video0source- The tool that started the stream:'api'for this Python API,'cli'forlager webcam.Nonefor a stream with no recorded origin.started_by- The user that the starting tool named.Nonefor a stream started from this Python API.
get_url(box_ip)
Get just the URL for the stream.
Returns:
str or None - Stream URL or None if not running
is_active()
Check if the stream is currently active.
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 serves a viewer page at its URL. It uses the same layout and colors as the oscilloscope page (lager scope NET stream web):
-
A header. Its Net picker moves to another stream on the box. It shows the
camera’s model and device, and the frame rate, size and zoom. Its status is
LIVE,STALLED(no frame for 3 seconds),WAITING(no frame yet) orOFFLINE(the stream does not answer) - The live picture, with a clock and the zoom level over it. When zoomed in, drag the picture or use the arrow keys to pan. Double-click a point to zoom in on it, or once zoomed, to centre on it
-
A sidebar with:
- Resolution: the size and frame rate, from the modes the camera offers. If the camera cannot stream the size you pick, it keeps the old one, and the page says why. Too little USB bandwidth is one cause
- View: zoom (slider, Out, Reset, In), Centre for the pan, Rotate (0, 90, 180 or 270 degrees) and Flip (left-right, top-bottom)
- Focus: Auto or Manual with a distance slider
- Image: exposure (Auto exposure or Manual with a slider), gain and brightness. Exposure and gain show only on a camera that has them. While auto exposure is on, the camera sets the gain itself
- Full screen shows the picture alone
-
Snapshot, which saves one frame as
<net>-<timestamp>.jpg - At the foot of the sidebar, who started the stream, its device and its port
SIGNED OUT and tells you to run lager webcam url for a new link.
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
urlfromstart()carries none. Uselager webcam urlfor a link that carries your token - Zoom is digital (crop and scale), not optical

