All chapters

Cameras

Any camera that offers an RTSP stream can be watched live in the browser and archived as a series of pictures, with no plug-in and nothing to install on the viewer's machine. Add object detection and clips on top of the same stream (see Object detection).

Adding a camera#

Add a sensor of type Live Camera to a place and enter its RTSP URL in the settings. Only rtsp:// and rtsps:// addresses are accepted; credentials may be part of the URL: rtsp://user:password@192.168.1.20:554/stream.

Camera credentialsThe server stores the RTSP URL, credentials included, in its database (the camera's settings page shows it only to editors), and sends it to an edge when the camera is served by one. Use a camera account with viewing rights only, and protect the data directory.

Live view#

Huntress runs one ffmpeg process and one RTSP session per camera on the machine that reaches the camera: the server, or a Huntress Edge. ffmpeg is built into Huntress; nothing needs to be installed on the host. The video is copied, not re-encoded, wrapped as MPEG-TS and sent over a WebSocket to the browser, which plays it with a built-in player. A new viewer joins at the next keyframe.

  • Codec. The browser must be able to play what the camera sends. H.264 is the safe choice; configure the camera's secondary stream to H.264 if its main stream is H.265. (Video clips can store H.265, but only some browsers play it back.)
  • On demand. ffmpeg starts when the first viewer opens the camera and stops 30 seconds after the last one leaves, unless snapshots, detection or clips keep it running.
  • Latency. The player stays within a few seconds of live; the exact figure depends on the camera's keyframe interval, so a short interval (about 2 seconds) is recommended.
  • Status. The player shows Connecting, then Live at the first picture, Reconnecting after an error and No signal only after waiting (15 seconds without a first picture, 10 seconds of a stalled one). A camera that answers 401 Unauthorized is retried slowly and the log names the cause; saving a corrected URL restarts it at once.

Snapshots and the archive#

Set a snapshot interval in the camera's settings (1 second to 1 hour). Huntress takes pictures from the stream's keyframes, so the real rate is the lower of your interval and the camera's keyframe rate. Pictures are scaled to 1280 pixels wide by default.

  • Live picture. Every snapshot updates the near-live picture on screen, held in memory.
  • Archive. A picture is stored for the timeline only every Snapshots:ArchiveIntervalSeconds (30 seconds by default, 0 = every picture; each camera can override it). Archiving every second costs roughly 86,000 pictures, about 10 GB, per camera per day.
  • Retention. Archived pictures are deleted after Retention:ImageDays (30 days by default).
  • Timeline. On the place page a camera card shows a bar per hour of pictures; an hour with detections carries a dot in the colour of the most telling group, and opening an hour shows a tick per picture. The camera's own page has the same strip.

Playback#

Archived pictures play back in a stepper (“Frame N of M”) over the place page, with the detection boxes switchable. It is a slideshow of snapshots, not continuous video; continuous recording is not part of Huntress. Use video clips around detections for moving pictures (see Object detection).

Pictures from other sources#

Any sensor can attach a picture to a reading, and any camera sensor can receive pictures instead of a stream: post a JPEG or PNG to the Hunt API, e-mail it as an attachment, or publish it over MQTT. See Sending data. Images are limited to 10 MB, scaled to at most 1920 pixels wide and stored as JPEG.

Cameras behind NAT#

A camera on a private network that the server cannot reach is served by a Huntress Edge: a small computer on that network that runs the same program with --edge, pulls the RTSP stream locally and relays only the video and pictures to the server over an outbound connection. See Deployment.

Connection lost
Attempting to reconnect…