Skip to content

v2.0.0 - Viseron rewrite

Compare
Choose a tag to compare
@roflcoopter roflcoopter released this 19 Dec 11:28
· 238 commits to master since this release
8e2edd9

This release features a massive rewrite that I have been working on for the past year.

It focuses on decoupling all parts of Viseron, making it more modularized. This allows for easier integration of new functionality.

The config.yaml file will change completely so there is some work that has to be done by each user to port over to the new version.
The general config format is a component which implements one or more domains.
Each camera has a unique camera identifier which flows through the entire configuration.

The nvr component then ties all these different domains together and provides the full functionality.

The big benefit of this new format is that you can mix and match components more freely.
For instance, you could use different object detectors for different cameras, you are not tied into just one.

Config example
ffmpeg: # <-- component
  camera: # <-- domain
    camera_one: # <-- camera identifier
       name: Camera 1
       host: 192.168.10.10
       username: test
       password: test
    camera_two: # <-- camera identifier
       name: Camera 2
       host: 192.168.10.11
       username: test
       password: test
       ....

darknet: # <-- component
  object_detector: # <-- domain
    model: /my_custom_model/model.weights
    cameras:
      camera_one: # <-- camera identifier
        fps: 5

deepstack:  # <-- component
  host: deepstack # <-- component config option
  port: 5000 # <-- component config option
  object_detector: # <-- domain
    cameras:
      camera_two:  # <-- camera identifier
        fps: 1
        labels:
          - label: person
            confidence: 0.75
            trigger_recorder: false
  face_recognition: # <-- domain
    cameras:
      camera_one:
      camera_two:
    labels:
      - person

background_subtractor: # <-- component
  motion_detector: # <-- domain
    cameras:
      camera_one: # <-- camera identifier
        fps: 1
        mask:
          - coordinates:
              - x: 400
                y: 200
              - x: 1000
                y: 200
              - x: 1000
                y: 750
              - x: 400
                y: 750

nvr: # <-- component
  camera_one: # <-- camera identifier
  camera_two: # <-- camera identifier
Config example with publicly available cameras (used in the screenshots)
ffmpeg:
  camera:
    viseron_camera:
      name: Camera 1
      host: 195.196.36.242
      path: /mjpg/video.mjpg
      port: 80
      stream_format: mjpeg
      fps: 6
      recorder:
        idle_timeout: 1
        codec: h264
    viseron_camera2:
      name: Camera 2
      host: storatorg.halmstad.se
      path: /mjpg/video.mjpg
      stream_format: mjpeg
      port: 443
      fps: 2
      protocol: https
      recorder:
        idle_timeout: 1
        codec: h264
    viseron_camera3:
      name: Camera 3
      host: 195.196.36.242
      path: /mjpg/video.mjpg
      port: 80
      stream_format: mjpeg
      fps: 6
      recorder:
        idle_timeout: 1
        codec: h264

mog2:
  motion_detector:
    cameras:
      viseron_camera:
        fps: 1
      viseron_camera2:
        fps: 1

background_subtractor:
  motion_detector:
    cameras:
      viseron_camera3:
        fps: 1
        mask:
          - coordinates:
              - x: 400
                y: 200
              - x: 1000
                y: 200
              - x: 1000
                y: 750
              - x: 400
                y: 750

darknet:
  object_detector:
    cameras:
      viseron_camera:
        fps: 1
        scan_on_motion_only: false
        labels:
          - label: person
            confidence: 0.8
            trigger_recorder: true
      viseron_camera2:
        fps: 1
        labels:
          - label: person
            confidence: 0.8
            trigger_recorder: true
      viseron_camera3:
        fps: 1
        labels:
          - label: person
            confidence: 0.8
            trigger_recorder: true

nvr:
  viseron_camera:
  viseron_camera2:
  viseron_camera3:

webserver:

mqtt:
  broker: mqtt_broker.lan
  port: 1883
  username: !secret mqtt_username
  password: !secret mqtt_password
  home_assistant:

logger:
  default_level: debug

Frontend

There is now a UI included in Viseron, written in React TypeScript.
It is enabled by default and can be reached on port 8888 inside the container by default.

Currently it features functionality like viewing cameras, recordings and editing the configuration.
It will be expanded upon in the future.

Some screenshots of the UI

Cameras:
Viseron-screenshot-cameras

Recordings:
Viseron-screenshot-recordings

Configuration:
Viseron-screenshot-configuration

Entities:
Viseron-screenshot-entities

Jetson Nano support

This release also features better Jetson Nano support through the gstreamer component.
This means that you can utilize your Nano for hardware accelerated camera decoding and object detection.

CompreFace face recognition

Face recognition using CompreFace is now available

Image classification

A new post processor is available, image_classification.
This allows you to get more granular results from a detected object.
As an example, you could detect a specific kind of dog breed, or a specific kind of bird.

Multiprocessing

darknet and edgetpu object detectos utilize multiprocessing which spreads the load between multiple processes.
This allows for better performance, but also makes it easier to analyze and fine tune the load on your system.

Documentation site

The documentation has moved over from being in a README format to a dedicated site.
Hopefully it will help you use Viseron better.
I need your help on how it can be improved, writing good docs is always hard.

I am especially proud of the components page, which is mostly generated from the config schema used.
This means that the documentation and schema will always match, yay!

The documentation is hosted here: https://viseron.netlify.app/

Breaking changes

  • ALL kinds of inheritance in the config has been removed.
    This means that you have to explicitly configure your object detector and motion detector settings for each camera.

  • interval has been removed from object_detection and motion_detection
    A new config option fps will be used instead.
    This change was made since it was quite confusing, both in the code and for the users because interval was specified in seconds.

  • logging has been removed in all shapes and forms and has been replaced with the new component logger
    Please see the updated documentation

  • cameras config section has been removed. Camera config is now specified under a component.

  • Each object detector has been split up into individual components.
    See the documentation for each detector.

  • Each motion detector has been split up into individual components.
    See the documentation for each detector.

  • recorder can no longer be configured on a global level.
    It now has to be present under each camera configuration.

  • timeout under recorder is now called idle_timeout

  • static_mjpeg_streams are now called mjpeg_streams

  • enable under object_detection is no more. To disable object detection you simply dont configure it for a camera
    Same goes for motion_detector

  • timeout for motion_detector is now called recorder_keepalive

  • max_timeout for motion_detector is now called max_recorder_keepalive

  • Recordings are now stored in the folder structure /recordings/<camera name>/<date>/<timestamp>.mp4

  • Images are no longer streamed to MQTT/Home Assistant, with the exception of thumbnails.
    This is because MQTT is not really suited for this and it impacts performance a lot.
    If you still want to have the cameras in Home Assistant you can point Home Assistant to an MJPEG stream in Viseron.

  • filter_args removed for camera and recorder.
    For camera, use video_filters instead.
    For recorder, you can use both video_filters and audio_filters

    Short config example to rotate video 180 degrees:
    ffmpeg:
      camera:
        camera_1:
        ....
          video_filters:   # These filters rotate the images processed by Viseron
            - transpose=2
            - transpose=2
          recorder:
            video_filters:   # These filters rotate the recorded video
              - transpose=2
              - transpose=2

What's Changed

New Contributors

Full Changelog: v1.10.2...v2.0.0