← Changelog

Video and thermal cameras

Stream cameras and thermal sensors next to your data, and record video.

Video streaming

Stream cameras from a device with the Python SDK and watch them live in Plexus, next to the telemetry from the same device.

Why

A chart says the motor current spiked. The camera says why: the arm hit something. When video and telemetry live in separate tools, someone has to line them up by hand. Sending both through the same connection keeps them together.

How it works

Frames travel over the same WebSocket as the device's telemetry, each with a camera_id and a timestamp. The SDK sends JPEG frames in a compact binary format and never blocks your capture loop: if the network falls behind, it drops frames instead of stalling. Frames too big for the gateway's 1 MB limit are re-encoded at lower quality.

In the app, cameras appear on the device's Live tab with a Preview button, and you can add a video panel to any dashboard beside your charts. Anyone with an API key can also read frames from the Data API's video stream.

Using it

Install the video extra. Use send_video_frame() when your code owns the capture loop:

# pip install "plexus-python[video]"
import cv2
from plexus import Plexus

px = Plexus(source_id="rover-02")
cap = cv2.VideoCapture(0)
while True:
    ok, frame = cap.read()
    if ok:
        px.send_video_frame(frame, camera_id="front")

From an RTSP camera or file

stream_camera() runs FFmpeg for you in a background thread and returns an event you set to stop. It sends 15 frames a second by default.

stop = px.stream_camera("rtsp://192.168.1.10/stream", camera_id="front")
# ... other work ...
stop.set()

Limits

  • Video needs a paid plan. The Free plan doesn't include the live WebSocket.
  • Live frames are relayed, not stored. To keep footage, record it (see Record video).
  • stream_camera() needs FFmpeg on the device's PATH.
  • Use a different camera_id for each camera on a device.

Thermal camera streaming

Stream an MLX90640 or MLX90641 thermal sensor from a Raspberry Pi with the Python SDK. Experimental.

How it works

ThermalSource.open() opens the sensor you name. Each read_frame() returns a grid of temperatures in °C. send_thermal_frame() turns it into a colour image, scales small sensors up so they are readable, and sends it over the same WebSocket as your telemetry. Each frame also carries the lowest and highest temperature in view. For sensors up to 4,096 pixels, which covers both MLX parts, the full temperature grid travels with the frame too.

The frame shows up in Plexus like any other camera, next to your charts.

Using it

Install the video extra. The I2C sensors also need their board driver on the device, such as adafruit-circuitpython-mlx90640.

# pip install "plexus-python[video]"
from plexus import Plexus
from plexus.cameras.thermal import ThermalSource

px = Plexus(source_id="pod-7")
cam = ThermalSource.open("mlx90640")   # or "mlx90641", or "sim"

while True:
    px.send_thermal_frame(cam.read_frame(), camera_id="thermal")

Limits

  • Experimental. The API may change.
  • Thermal feeds are live only. Plexus doesn't record them.
  • Needs a paid plan, because frames go over the live WebSocket.
  • You have to name the sensor. Plexus can't tell a USB thermal camera from a webcam, so there is no auto-detect.
  • Use "sim" to test the whole path with no hardware attached.

Record video

Press Record on any camera and Plexus saves up to 4 hours of video, which you can watch back beside the telemetry from the same window. Paid plans.

How it works

Press Record on a camera, on the device's Live tab or on a dashboard video panel, and pick 15m, 1h, 2h or 4h. A Plexus recorder joins the camera's live stream and writes it to an MP4 file (H.264, 15 frames a second), which is saved to cloud storage. You can stop early. The device doesn't do anything different: it keeps streaming as before.

When the recording finishes, press Watch on the video panel to play it. If a dashboard is set to a fixed time window that a recording covers, its video panel plays that footage from the start of the window, so the video lines up with the charts beside it.

Using it

  • Stream a camera from the device with send_video_frame() or stream_camera().
  • Open the device's Live tab, or a dashboard with a video panel for that camera. On a dashboard panel, turn on recording controls in the panel settings.
  • Press Record and choose how long.
  • Afterwards, set the dashboard to the window you care about to replay video and telemetry together.

Limits

  • Paid plans only. The Free plan has no video.
  • One recording lasts at most 4 hours.
  • The Founding 50 plan includes 20 recorded hours a month. A recording that would go past it is refused, and the count resets at the start of the month.
  • Viewers can watch but can't start a recording.
  • Thermal cameras are not recorded.