Skip to content

Server video analytics

In server video analytics the detectors run on the server, not in the camera: a camera's analytics is executed by a separate cluster machine — a streamer with the Inference role. Optic keeps the analytics settings in the camera config and shows them in the Video analytics section of the camera card; detector triggers are saved as episodes. Unlike camera analytics, where the camera stores and runs the rules itself, server analytics works with any camera that delivers video over RTSP.

The superadmin and admin roles can configure analytics.

Prerequisites

Analytics needs:

  • A working Optic — an Optic instance answers, the console opens.
  • A camera — the camera is added in Optic and connected over RTSP, see Adding a camera.
  • Thumbnails — the region editor shows the camera frame from them. A thumbnail is added on the Process tab in the Thumbnails block with the Stream keyframe source. The editor also works without thumbnails, see Detection regions.
  • Episode retention — detector triggers are saved as episodes; their retention is set in the DVR settings, see episode retention.

Connecting a streamer with the Inference role

Analytics runs on a separate machine with the vision-inference service. Join the machine into the cluster and change its role:

  1. Install vision-inference on a separate machine — from a package or the flussonic/vision-inference Docker image.
  2. In the Optic console, open Cluster → Streamers and click Permit join. Copy the join token from the window that opens; for more about the join window, see Joining streamers.
  3. On the analytics machine, set the Optic address and the obtained token. In a package installation, put them into the credentials file /etc/optic/secrets.env with owner-only access:
CENTRAL_URL=http://optic.example.com
JOIN_TOKEN=join-token

In Docker, the same values are passed to the container as environment variables. 4. Restart the service: systemctl restart vision-inference (in Docker, recreate the container). 5. Wait for registration: the streamer appears in Cluster → Streamers. 6. Open the streamer's card, the Cluster tab, and select Inference in the Role field.

The join window stays open for one hour. The join token in the window is masked: the eye button reveals it long enough to copy.

The join window with the join token

The role means that Optic assigns cameras with analytics enabled to this streamer. A machine with the Inference role does not receive ordinary cameras — they are placed on machines with the Streamer role. The streamer with the Inference role takes the camera's video over RTSP from the streamer that ingests the camera: source streamers need no manual configuration.

The Cluster tab of the streamer card: selecting the Inference role

Enabling analytics on a camera

  1. Open the camera card and the Process tab.
  2. In the Video analytics section, turn on the types you need.
  3. Click Save.
Type What it finds Details
Faces Faces in the frame Faces
Humans People in the frame Persons
Vehicles Vehicles in the frame Vehicles
Motion Motion in the frame Motion events

The Video analytics section with the switches of the four types

A type missing from the license is shown dimmed with a note about it; it cannot be enabled. An enabled type analyzes the whole frame by default; the search area is set in detection regions.

Detection regions

Detector types are laid out in a single table: on the left, the type switch with its color mark; to its right, the regions of that type, one row per region. A disabled type occupies a single empty row; a type stays enabled while it has regions.

Each region is a separate detector of that type: two vehicle regions are two independent detectors, one per parking lot, for example. A region row consists of a name and a mode:

  • Name — tells regions of one type apart. The name of a new region is suggested automatically: default, then region-2, region-3, and on by the number of regions. The name can be changed and cannot stay empty.
  • Mode — Whole frame or Polygon: in the first case the detector searches the whole frame, in the second the region is bounded by a polygon.

The Add button sits at the end of the last region row of a type. Adding a region immediately places a polygon in the frame center — a rectangle that is then edited by its vertices. Vertices are edited with the mouse:

  • dragging moves a vertex;
  • double-clicking an edge adds a vertex;
  • right-clicking a vertex removes it.

A polygon never keeps fewer than three vertices: a vertex of a three-vertex polygon cannot be removed.

All polygon regions of all enabled types are shown on the frame at once, each type in its own color. The active region is highlighted with a fill and its vertices; the others are shown as outlines. A region becomes active by clicking its shape on the frame or its row in the table.

The region list and the camera frame with the polygons of all types

Deleting a region deletes its detector. Deleting the last region of a type turns the type off — its switch goes off.

The editor also works without thumbnails: until the frame loads, regions are edited by coordinates on a dark backdrop with a standard frame aspect ratio.

If saving fails

A refused save of the analytics settings:

  • Empty region name — the name cannot be empty. The error is shown in the name field, no request is sent to the server.
  • The server rejected a value — the region with the invalid value is highlighted in the list and shows the message on its row.

When analytics is enabled but episodes do not appear, the possible causes:

  • Analytics is not licensed — the type is shown dimmed and cannot be enabled.
  • The streamer with the Inference role cannot reach the RTSP source — the streamer cannot take the video from the streamer that ingests the camera. Check that the stream is running and plays back.
  • The stream is not assigned to any analytics streamer — the cluster has no machine with the Inference role, or it is unreachable. Check the role and the connectivity of the machines.

Verification

The result of the analytics is episodes: the Episodes tab of the camera card, see Stream episodes in Optic. Each episode is a detector trigger: a tile with a frame preview and the event time; for vehicles, the recognized plate when it was readable. The episode card shows the video from the archive around the trigger, with the start and end times.

The Episodes tab with detector triggers