Jump to content

[Support] Viseron v2 - Self-hosted, local only NVR and AI Computer Vision software


Recommended Posts

Posted (edited)

Application Name: Viseron - a self-hosted NVR with object and face detection

Application Site: https://viseron.netlify.app

Docker Hub: https://hub.docker.com/repository/docker/roflcoopter/viseron

Github: https://github.com/roflcoopter/viseron

 

Viseron
Viseron is a self-hosted NVR deployed via Docker, which utilizes machine learning to detect objects and start recordings.

 

v2.0.0 Has finally been release which features a lot of improvements, including a fresh new frontend interface

 

Check out the release notes:
https://github.com/roflcoopter/viseron/releases/tag/v2.0.0

 

Viserons features include, but not limited to the following:
- Object detection via:
  - YOLOv3, YOLOv4 and YOLOv7 Darknet using OpenCV
  - Tensorflow via Google Coral EdgeTPU
  - DeepStack
- Motion detection
- Face recognition via:
  - dlib
  - DeepStack
  - CompreFace
- Image Classification
- Responsive, mobile friendly Web UI written in TypeScript React
- MQTT support
- Home Assistant MQTT Discovery
- Lookback, buffers frames to record before the event actually happened
- Supports hardware acceleration on different platforms
  - CUDA for systems with a supported GPU
  - OpenCL
  - OpenMax and MMAL on the RaspberryPi 3B+
  - video4linux on the RaspberryPi 4
  - Intel QuickSync with VA-API
  - NVIDIA video4linux2 on Jetson Nano
- Multiplatform, should support any amd64, aarch64 or armhf machine running Linux.
  Specific images are built to support:
  - RaspberryPi 3B+
  - RaspberryPi 4
  - NVIDIA Jetson Nano
- Zones to limit detection to a particular area to reduce false positives
- Masks to limit where object and motion detection occurs
- Stop/start cameras on-demand over MQTT

 

 

I hope you'll find this useful!
Viseron is a project that is under active development and I appreciate any feedback or feature requests you have.

 

Viseron-screenshot-cameras.thumb.png.2b0292f5121660885c2bb51db66a7d8b.png

Viseron-screenshot-recordings.thumb.png.e07e63b4ffb9e7530fe7db14af0aab14.png

Viseron-screenshot-entities.thumb.png.ee09442c2db1ae405e0031145e90afba.png

Viseron-screenshot-configuration.thumb.png.c2f7f04db04519d479b91585234935e0.png

Edited by roflcoopter
v2.0.0
  • 2 weeks later...
Posted

Well right now there isnt much to show, videos are recorded when configured objects are detected.

A GUI will be implemented in the future where you can view cameras/recordings and maybe even edit the configuration

  • 1 month later...
Posted

Viseron will first try to load the EdgeTPU from USB, if it fails PCIe will be tried.
 

I think you need to mount the coral into the container like this but I am not sure 
 

--device /dev/apex_0:/dev/apex_0

  • 4 weeks later...
Posted
On 12/18/2020 at 10:13 PM, Mike-D said:

Does this app support Nvidia transcoding?

Viseron supports this with the roflcoopter/viseron-cuda container, however i am not sure how to incorporate that into this implementation.

I am not using Unraid myself so i dont know how to do that unfortunately.

Posted
On 12/20/2020 at 4:39 AM, roflcoopter said:

Viseron supports this with the roflcoopter/viseron-cuda container, however i am not sure how to incorporate that into this implementation.

I am not using Unraid myself so i dont know how to do that unfortunately.

Is '--runtime=nvidia' already set by default. The plex app has a variable you set to true to enable nvidia encoding.

  • 1 year later...
Posted

How about an example config file for dummies like me trying to set this up?  I get the basic concept but it would be nice to see a built example that's setup to do some motion detection with recognition.

Posted
19 hours ago, parish said:

How about an example config file for dummies like me trying to set this up?  I get the basic concept but it would be nice to see a built example that's setup to do some motion detection with recognition.

I suggest you check out this PR: https://github.com/roflcoopter/viseron/pull/306

I am currently rewriting Viseron in that PR, and it is almost done.

The documentation is the only part missing.

 

That PR has a small config example that you should be able to use.

You need to pull the Docker tag called `modularized` in order to get Viseron v2 however, not sure how you do that using Unraid 

  • roflcoopter changed the title to [Support] Viseron v2 - Self-hosted, local only NVR and AI Computer Vision software
Posted (edited)

@roflcoopter


Any chance for an updated listing in the Community Apps?

 

The only option currently is missing some fields in the template (like network ports, for example). It also wants the container to be privileged, which is the first time I'm even seeing this after using Unraid for like 7 years

Edited by jeremytodd1
Posted (edited)

According to docs privileged is only needed when passing through Edge TPU. Have you tired without this option enabled as Frigate works just fine if you pass usb device. I will be able to test it after xmas. Also port is missing and icon - any chance for fixes @roflcoopter? You're maintainer of the project right? 🙂

Edited by cpu
Posted

Absolutely, will try to fix.

 

However i do not use Unraid so i am not really sure what to change, the template was created for me by a user.

 

I can make some proposed changes to the git repo, would you be able to help review it?

Posted (edited)
3 hours ago, roflcoopter said:

Updated the template, but i think it is broken now.

Can anyone assist in reviewing the template here: https://github.com/roflcoopter/viseron-unraid-ca-template/blob/master/Viseron.xml and see whats wrong with it?

 

I just tried out the current listing for Viseron on Unraid's Community Apps and it looks like it successfully installed. I'm able to get to the Viseron's web ui at least. I haven't tried adding any cameras or anything yet.

 

EDIT:

 

I just tried putting in the camera sample configuration as well and it looks like the sample cameras are working correctly as well. Haven't done anything with recording yet though.

 

I did notice that the icon for Viseron in my docker containers page isn't there. It's just using the standard blank icon image. I don't know much about templates though so I can't assist much with helping you there.

Edited by jeremytodd1
Posted

One more thing I'll point out.

 

After testing it yesterday (installing from Community Apps and adding the sample camera configuration), I didn't touch it again.

25 hours later I noticed that the memory usage of the Viseron container was using up a bit over 3GB of ram. 

Screenshot for reference:

 1950313557_viseron_memoryusage.thumb.png.96e8ecb478e983495dda6f93382a0ca4.png

Is this expected?

Posted

@roflcoopter I'm very interested in your software, so hopefully you are able to explain some messages/errors I'm getting.

 

I'm running a server with an Intel iGPU and used your viseron docker, but also experimented with the amd64-viseron docker. Both fail to recognized the VA-API. OpenCL is available it says. I've passed the /dev/dri through as device both as path and as extra parameter (last method is the one linuxserver.io is using for their Plex dockers). The last method seems to give an actual load on my iGPU, but that could be just coincidence because it's not using the iGPU constantly. Both methods result in object detection successfully. I've changed PUID and GUID to 99/100. I don't think 0/0 is needed, and on Unraid most of the dockers run at 99/100.

 

ls /dev/dri also shows the igpu within the docker.

 

I've gotten object detection hits successfully, which are amazingly accurate. But I can't place the errors I get in the log below (mostly below), but it also shows OpenCL is available, but VA-API isn't.

Some things that I've noticed:

  • Playback of the recordings is not possible for me in my web browser. It says the format is not supported. Live view does open a mjepg stream in my browser. Recordings just don't play. The files on my server are working though. Maybe because of the error in the log below about mp4 not being supported?
  • All the recordings are placed within 1 folder with random namings together with a thumbnail of said recording (same name). For me it would be better to change this to date and timestamps with their own folder. I can have 100's of hits on a daily basis, so having them all in one big folder per camera will be difficult to go through. Especially when file dates get corrupted and there is no way to search through dates.

If you need any testing from me, please let me know! I think your software has incredible potential.

 

[2023-01-02 09:35:14] [INFO    ] [viseron.core] - -------------------------------------------
[2023-01-02 09:35:14] [INFO    ] [viseron.core] - Initializing Viseron
[2023-01-02 09:35:14] [INFO    ] [viseron.components] - Setting up component data_stream
[2023-01-02 09:35:14] [INFO    ] [viseron.components] - Setup of component data_stream took 0.0 seconds
[2023-01-02 09:35:14] [INFO    ] [viseron.components] - Setting up component webserver
[2023-01-02 09:35:14] [INFO    ] [viseron.components] - Setup of component webserver took 0.0 seconds
[2023-01-02 09:35:14] [INFO    ] [viseron.components] - Setting up component ffmpeg
[2023-01-02 09:35:14] [INFO    ] [viseron.components] - Setting up component darknet
[2023-01-02 09:35:14] [INFO    ] [viseron.components] - Setting up component nvr
[2023-01-02 09:35:14] [INFO    ] [viseron.components] - Setup of component nvr took 0.0 seconds
[2023-01-02 09:35:14] [INFO    ] [viseron.components] - Setup of component ffmpeg took 0.0 seconds
[2023-01-02 09:35:15] [INFO    ] [viseron.components] - Setup of component darknet took 0.3 seconds
[2023-01-02 09:35:15] [INFO    ] [viseron.components] - Setting up domain camera for component ffmpeg with identifier camera_1
[2023-01-02 09:35:15] [INFO    ] [viseron.components] - Setting up domain object_detector for component darknet with identifier camera_1
[2023-01-02 09:35:15] [INFO    ] [viseron.components] - Setting up domain nvr for component nvr with identifier camera_1
[2023-01-02 09:35:17] [WARNING ] [viseron.components.ffmpeg.stream.camera_1] - Container mp4 does not support pcm_alaw audio codec, using mkv instead. Consider changing extension in your config.
[2023-01-02 09:35:17] [INFO    ] [viseron.components] - Setup of domain camera for component ffmpeg with identifier camera_1 took 2.0 seconds
[2023-01-02 09:35:17] [INFO    ] [viseron.components] - Setup of domain object_detector for component darknet with identifier camera_1 took 0.0 seconds
[2023-01-02 09:35:17] [INFO    ] [viseron.components.nvr.nvr.camera_1] - Motion detector is disabled
[2023-01-02 09:35:17] [INFO    ] [viseron.components.nvr.nvr.camera_1] - NVR for camera Door initialized
[2023-01-02 09:35:17] [INFO    ] [viseron.components] - Setup of domain nvr for component nvr with identifier camera_1 took 0.0 seconds
[2023-01-02 09:35:17] [INFO    ] [viseron.core] - Viseron initialized in 3.1 seconds
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 10-adduser: executing... 
************************ UID/GID *************************
User uid:    0
User gid:    0
************************** Done **************************
[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 20-gid-video-device: executing... 
[cont-init.d] 20-gid-video-device: exited 0.
[cont-init.d] 30-edgetpu-permission: executing... 
************** Setting EdgeTPU permissions ***************
Coral Vendor IDs:
"1a6e"
"18d1"
No EdgeTPU USB device was found
************************** Done **************************
[cont-init.d] 30-edgetpu-permission: exited 0.
[cont-init.d] 40-set-env-vars: executing... 
****** Checking for hardware acceleration platforms ******
OpenCL is available!
VA-API cannot be used
CUDA cannot be used
*********************** Done *****************************
[cont-init.d] 40-set-env-vars: exited 0.
[cont-init.d] 50-check-if-rpi: executing... 
********** Checking if we are running on an RPi **********
Not running on any supported RPi
*********************** Done *****************************
[cont-init.d] 50-check-if-rpi: exited 0.
[cont-init.d] 55-check-if-jetson: executing... 
****** Checking if we are running on a Jetson Board ******
Not running on any supported Jetson board
*********************** Done *****************************
[cont-init.d] 55-check-if-jetson: exited 0.
[cont-init.d] 60-ffmpeg-path: executing... 
****************** Getting FFmpeg path *******************
FFmpeg path: /home/abc/bin/ffmpeg
*********************** Done *****************************
[cont-init.d] 60-ffmpeg-path: exited 0.
[cont-init.d] 70-gstreamer-path: executing... 
***************** Getting GStreamer path *****************
GStreamer path: /usr/bin/gst-launch-1.0
*********************** Done *****************************
[cont-init.d] 70-gstreamer-path: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[ WARN:[email protected]] global /tmp/opencv/modules/core/src/utils/filesystem.cpp (489) getCacheDirectory Using world accessible cache directory. This may be not secure: /var/tmp/
[2023-01-02 09:35:33] [ERROR   ] [viseron.components.nvr.nvr.camera_1] - Failed to retrieve result for object_detector, message repeated 4 times

 

Posted
On 1/2/2023 at 9:58 AM, Kaizac said:

@roflcoopter I'm very interested in your software, so hopefully you are able to explain some messages/errors I'm getting.

 

I'm running a server with an Intel iGPU and used your viseron docker, but also experimented with the amd64-viseron docker. Both fail to recognized the VA-API. OpenCL is available it says. I've passed the /dev/dri through as device both as path and as extra parameter (last method is the one linuxserver.io is using for their Plex dockers). The last method seems to give an actual load on my iGPU, but that could be just coincidence because it's not using the iGPU constantly. Both methods result in object detection successfully. I've changed PUID and GUID to 99/100. I don't think 0/0 is needed, and on Unraid most of the dockers run at 99/100.

 

ls /dev/dri also shows the igpu within the docker.

 

I've gotten object detection hits successfully, which are amazingly accurate. But I can't place the errors I get in the log below (mostly below), but it also shows OpenCL is available, but VA-API isn't.

Some things that I've noticed:

  • Playback of the recordings is not possible for me in my web browser. It says the format is not supported. Live view does open a mjepg stream in my browser. Recordings just don't play. The files on my server are working though. Maybe because of the error in the log below about mp4 not being supported?
  • All the recordings are placed within 1 folder with random namings together with a thumbnail of said recording (same name). For me it would be better to change this to date and timestamps with their own folder. I can have 100's of hits on a daily basis, so having them all in one big folder per camera will be difficult to go through. Especially when file dates get corrupted and there is no way to search through dates.

If you need any testing from me, please let me know! I think your software has incredible potential.

 

[2023-01-02 09:35:14] [INFO    ] [viseron.core] - -------------------------------------------
[2023-01-02 09:35:14] [INFO    ] [viseron.core] - Initializing Viseron
[2023-01-02 09:35:14] [INFO    ] [viseron.components] - Setting up component data_stream
[2023-01-02 09:35:14] [INFO    ] [viseron.components] - Setup of component data_stream took 0.0 seconds
[2023-01-02 09:35:14] [INFO    ] [viseron.components] - Setting up component webserver
[2023-01-02 09:35:14] [INFO    ] [viseron.components] - Setup of component webserver took 0.0 seconds
[2023-01-02 09:35:14] [INFO    ] [viseron.components] - Setting up component ffmpeg
[2023-01-02 09:35:14] [INFO    ] [viseron.components] - Setting up component darknet
[2023-01-02 09:35:14] [INFO    ] [viseron.components] - Setting up component nvr
[2023-01-02 09:35:14] [INFO    ] [viseron.components] - Setup of component nvr took 0.0 seconds
[2023-01-02 09:35:14] [INFO    ] [viseron.components] - Setup of component ffmpeg took 0.0 seconds
[2023-01-02 09:35:15] [INFO    ] [viseron.components] - Setup of component darknet took 0.3 seconds
[2023-01-02 09:35:15] [INFO    ] [viseron.components] - Setting up domain camera for component ffmpeg with identifier camera_1
[2023-01-02 09:35:15] [INFO    ] [viseron.components] - Setting up domain object_detector for component darknet with identifier camera_1
[2023-01-02 09:35:15] [INFO    ] [viseron.components] - Setting up domain nvr for component nvr with identifier camera_1
[2023-01-02 09:35:17] [WARNING ] [viseron.components.ffmpeg.stream.camera_1] - Container mp4 does not support pcm_alaw audio codec, using mkv instead. Consider changing extension in your config.
[2023-01-02 09:35:17] [INFO    ] [viseron.components] - Setup of domain camera for component ffmpeg with identifier camera_1 took 2.0 seconds
[2023-01-02 09:35:17] [INFO    ] [viseron.components] - Setup of domain object_detector for component darknet with identifier camera_1 took 0.0 seconds
[2023-01-02 09:35:17] [INFO    ] [viseron.components.nvr.nvr.camera_1] - Motion detector is disabled
[2023-01-02 09:35:17] [INFO    ] [viseron.components.nvr.nvr.camera_1] - NVR for camera Door initialized
[2023-01-02 09:35:17] [INFO    ] [viseron.components] - Setup of domain nvr for component nvr with identifier camera_1 took 0.0 seconds
[2023-01-02 09:35:17] [INFO    ] [viseron.core] - Viseron initialized in 3.1 seconds
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 10-adduser: executing... 
************************ UID/GID *************************
User uid:    0
User gid:    0
************************** Done **************************
[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 20-gid-video-device: executing... 
[cont-init.d] 20-gid-video-device: exited 0.
[cont-init.d] 30-edgetpu-permission: executing... 
************** Setting EdgeTPU permissions ***************
Coral Vendor IDs:
"1a6e"
"18d1"
No EdgeTPU USB device was found
************************** Done **************************
[cont-init.d] 30-edgetpu-permission: exited 0.
[cont-init.d] 40-set-env-vars: executing... 
****** Checking for hardware acceleration platforms ******
OpenCL is available!
VA-API cannot be used
CUDA cannot be used
*********************** Done *****************************
[cont-init.d] 40-set-env-vars: exited 0.
[cont-init.d] 50-check-if-rpi: executing... 
********** Checking if we are running on an RPi **********
Not running on any supported RPi
*********************** Done *****************************
[cont-init.d] 50-check-if-rpi: exited 0.
[cont-init.d] 55-check-if-jetson: executing... 
****** Checking if we are running on a Jetson Board ******
Not running on any supported Jetson board
*********************** Done *****************************
[cont-init.d] 55-check-if-jetson: exited 0.
[cont-init.d] 60-ffmpeg-path: executing... 
****************** Getting FFmpeg path *******************
FFmpeg path: /home/abc/bin/ffmpeg
*********************** Done *****************************
[cont-init.d] 60-ffmpeg-path: exited 0.
[cont-init.d] 70-gstreamer-path: executing... 
***************** Getting GStreamer path *****************
GStreamer path: /usr/bin/gst-launch-1.0
*********************** Done *****************************
[cont-init.d] 70-gstreamer-path: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[ WARN:[email protected]] global /tmp/opencv/modules/core/src/utils/filesystem.cpp (489) getCacheDirectory Using world accessible cache directory. This may be not secure: /var/tmp/
[2023-01-02 09:35:33] [ERROR   ] [viseron.components.nvr.nvr.camera_1] - Failed to retrieve result for object_detector, message repeated 4 times

 

VA-API not working often boils down to permission issues. Does it work if you run with PUID=0 and PGID=0 and/or privileged?

 

What do you mean by recordings are stored with random names? Could you show an example?

They should be stored in a separate folder per camera/date with a timestamped file.

 

The error in your log is simply the object detector which takes some time to initialize the first time, nothing to worry about!

  • 4 months later...
Posted (edited)

@roflcoopter

 

can you assist in connecting to a laview camera?  Does this support rstp streams?

This is what one of my streams looks like,

 

rtsp://user:[email protected]:554/streaming/channels/1

 

I have tried editing the config several ways but none of them seem to connect.

 

image.png.78c3e47d69f0480bc71b52ae4243a3ae.png

 

Thanks,

 

*** Edit

I was able to figure it out, had to add more parameters such height, width, fps.

here is an example for anyone else looking.

 

ffmpeg: # <-- component

  camera: # <-- domain

    camera_one: # <-- camera identifier

       name: Camera 1

       width: 1920

       height: 1080

       fps: 5

       host: 10.0.0.73

       port: 554

       username: user

       password: password

       path: /streaming/channels/1

Edited by parish99
Posted (edited)

@roflcoopter I installed a Coral usb accelerator, but it doesnt seem be using it?  Should there be something in the logs showing anything?

 

I am passing this through the extra parameters.  --device=/dev/bus/usb

 

The Coral is showing up, but the name seems wrong? 

Bus 002 Device 002 Port 2-10 ID 1a6e:089a Global Unichip Corp.

** edit after a reboot its coming up correct as Bus 002 Device 002 Port 2-10 ID 18d1:9302 Google Inc.

 

Syslog lists it as this.

May 24 19:41:40 uServer kernel: usb 2-10: new SuperSpeed USB device number 2 using xhci_hcd

 

I dont see any errors in the logs, but CPU usage did not drop at all after plugging in the coral.  Do I need to load anything into the Coral, or just plug it in and it should work?

 

** Also I believe the icon for docker container needs to be a link to .png verses the current .svg

 

Edited by parish99

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...