Viseron v3.0.0b1 - Self-hosted, local only NVR and AI Computer Vision software

“docker”

~ $ docker run
-bash: docker: command not found

But definitely some docker is running inside HAOS, I thought you have run it with HAOS since I’ve found this topic on this forum, what I have available is a Portrainer, however I’m unsure how to manually add your package.

I’m really interested to set up a good NVR, unfortunately Frigate (the one with nice features and HAOS integration) has horrible performance. MontionEye has good performance but very limited features, thus I have high hopes in yours :slight_smile:

1 Like

Install the ssh & web terminal addon.

Turn off protection mode in that addon.

Now you can run docker.

3 Likes

Unfortunately Object detection with Coral Edge TPU (USB) doesn’t work.
During container deployment I used the recommended parameter:
-v /dev/bus/usb:/dev/bus/usb --privileged \

and in Object detection config:

object_detection:
  type: edgetpu

Motion gets detected, but objects - not.
In case I remove

  type: edgetpu

Objects are detected as usually.

I must say that Coral device is functioning properly, as I use Frigate too. But Viseron is much better due to lower resources usage & more accurate object detection, thus I wanted to optimize it with EdgeTPU (but didn’t succeed). Any advice is appreciated.
Thanks!

Are you running viseron and frigate at the same time?
Both can’t be using 1 coral at the same time.

Surely no. Frigate is stopped.
Is there any way of checking the correct connection of Coral with Viseron?

I presume if passing through to the docker, you should be able to login to the docker itself and check for ls /dev

another thing to consider is that you need to run the docker in privileged mode.

Hi, I’m a newbie developer trying to set up NVR environment for the new project.
I’m wondering if it’s possible to connect to a camera on Android phone or Android robot using Viseron from Ubuntu OS, or if it only supports certain type of CCTV cameras? I’m trying to use another app called DroidCam on Android phone to connect to Viseron. (The Android and Viseron are on the same local network)

Below is my command for running Viseron:

sudo docker run --rm -v /video-data/recordings:/recordings -v /video-data/config:/config -v /etc/localtime:/etc/localtime:ro --name viseron roflcoopter/viseron:latest

below is the config.yaml file. I tried testing with and without leaving the ‘width’, ‘height’, ‘fps’ section empty.

# See the README for the full list of configuration options.
cameras:
  - name: samsung galaxy note8
    host: 192.168.0.183
    port: 4747
    username: myusername
    password: mypassword
    path: http://192.168.0.183:4747/
    width: 1920
    height: 1080
    fps: 30

# MQTT is optional
#mqtt:
#  broker: <ip address or hostname of broker>
#  port: <port the broker listens on>
#  username: <if auth is enabled>
#  password: <if auth is enabled>

my run logs

[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 cannot be used
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: /usr/local/bin/ffmpeg
*********************** Done *****************************
[cont-init.d] 60-ffmpeg-path: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[2021-09-13 14:15:57] [INFO    ] [viseron                 ] - -------------------------------------------
[2021-09-13 14:15:57] [INFO    ] [viseron                 ] - Initializing...
[2021-09-13 14:15:57] [INFO    ] [viseron                 ] - Initializing NVR threads
[2021-09-13 14:15:57] [ERROR   ] [viseron.camera.stream.samsung_galaxy_note8] - rtsp://*****:*****@192.168.0.183:4747http://192.168.0.183:4747/: Invalid data found when processing input
[2021-09-13 14:15:57] [ERROR   ] [viseron                 ] - Failed to initialize camera samsung galaxy note8: FFprobe could not connect to stream. Output: {'error': {'code': -1094995529, 'string': 'Invalid data found when processing input'}}, Command: ffprobe -hide_banner -loglevel error -print_format json -show_error -show_streams rtsp://peter:[email protected]:4747http://192.168.0.183:4747/
[2021-09-13 14:15:57] [INFO    ] [viseron                 ] - Initialization complete
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.

I’ll keep trying to find out what’s wrong!

I’ve tried running the container in Privileged mode, but nothing changed in

ls /dev

result. Here it is:

autofs           i2c-1         loop7             nvme0n1p1  sdb       tty10  tty27  tty43  tty6    ttyS18  ttyS6       vcs4   vga_arbiter
bsg              i2c-2         loop8             nvme0n1p2  sdb1      tty11  tty28  tty44  tty60   ttyS19  ttyS7       vcs5   vhci
btrfs-control    i2c-3         loop9             nvme0n1p3  sdc       tty12  tty29  tty45  tty61   ttyS2   ttyS8       vcs6   vhost-net
bus              i2c-4         mapper            nvme0n1p4  sg0       tty13  tty3   tty46  tty62   ttyS20  ttyS9       vcsa   vhost-vsock
core             input         mcelog            nvme0n1p5  sg1       tty14  tty30  tty47  tty63   ttyS21  ttyprintk   vcsa1  zero
cpu              kmsg          mei0              nvram      sg2       tty15  tty31  tty48  tty7    ttyS22  udmabuf     vcsa2  zfs
cpu_dma_latency  kvm           mem               port       sg3       tty16  tty32  tty49  tty8    ttyS23  uhid        vcsa3
cuse             lightnvm      mqueue            ppp        shm       tty17  tty33  tty5   tty9    ttyS24  uinput      vcsa4
dma_heap         loop-control  net               psaux      snapshot  tty18  tty34  tty50  ttyS0   ttyS25  urandom     vcsa5
dri              loop0         null              ptmx       snd       tty19  tty35  tty51  ttyS1   ttyS26  userio      vcsa6
ecryptfs         loop1         nvidia-caps       ptp0       sr0       tty2   tty36  tty52  ttyS10  ttyS27  vboxdrv     vcsu
fb0              loop10        nvidia-modeset    pts        stderr    tty20  tty37  tty53  ttyS11  ttyS28  vboxdrvu    vcsu1
fd               loop11        nvidia-uvm        random     stdin     tty21  tty38  tty54  ttyS12  ttyS29  vboxnetctl  vcsu2
full             loop2         nvidia-uvm-tools  rfkill     stdout    tty22  tty39  tty55  ttyS13  ttyS3   vboxusb     vcsu3
fuse             loop3         nvidia0           rtc0       tpm0      tty23  tty4   tty56  ttyS14  ttyS30  vcs         vcsu4
hpet             loop4         nvidiactl         sda        tty       tty24  tty40  tty57  ttyS15  ttyS31  vcs1        vcsu5
hwrng            loop5         nvme0             sda1       tty0      tty25  tty41  tty58  ttyS16  ttyS4   vcs2        vcsu6
i2c-0            loop6         nvme0n1           sda2       tty1      tty26  tty42  tty59  ttyS17  ttyS5   vcs3        vfio

And here’s how I run docker:

docker run -d  --restart unless-stopped --privileged \
-v /usr/share/hassio/media/viseron:/recordings \
-v /dev/bus/usb:/dev/bus/usb --privileged \
-v /usr/share/hassio/homeassistant/viseron:/config \
-v /etc/localtime:/etc/localtime:ro \
--name viseron \
--runtime=nvidia \
roflcoopter/amd64-cuda-viseron

so can you see the coral in /dev/bus ? if you cant see it try ls -al to see what permissions it has.
It needs to have full access.

Here it is:

drwxr-xr-x  3 root root  4096 sep 30 22:56 coral

that seems ok. so im currently using zoneminder with mlapi (machine learning api). I use a pcie based coral and i can see it in the mlapi docker as such:

crwxrwxrwx 1 root root 120, 0 Aug 28 15:46 apex_0

try in the viseron docker >> chmod 777 /dev/bus/usb to give full permission then restart viseron

It seems that generally, Coral works with Viseron, though Object detection accuracy is very poor.
I managed to make it work using the same config (confidence, sensitivity, other parameters) only in 1 camera out of 4, the rest shows motion detection boundaries where objects (“Person” is the subject of interest) are not detected at all.
I wonder if it’s configurable.
Frigate uses the same technique, but detection is better.
I remember the same story with Viseron 1.7.x, when author @roflcoopter recommended me to use 1.8.0 beta version that was optimized for particular YOLO detector that was able to work with smaller objects. Maybe that is the reason…

Are you still experiencing problems?
I believe frigate employs a little different technique for object detection which might make it more accurate, will look into it a bit more

Yes it should work with any camera if it supports RTSP or MJPEG

Your configuration is a little bit off, it should be something like this:

cameras:
  - name: samsung galaxy note8
    host: 192.168.0.183
    port: 4747
    username: myusername
    password: mypassword
    width: 1920
    height: 1080
    fps: 30

Yes, I tried using Darknet vs. EdgeTPU vs. Deepstack and here’s what I came up with:

  • Darknet detects objects with best sensitivity, however sometimes trash bags are detected as humans (is it possible to load custom models in Darknet within Viseron container?)
  • Deepstack works, but detection accuracy & speed is much worse compared to Darknet, though GPU version of Deepstack loads CPU less and thus looks more attractive in terms of resource-intensiveness.
  • EdgeTPU literally sucks… It detects objects (in my case - People) when they pose & stand still in order to look as an ideal model.

In my case CCTV cameras are installed on 3rd floor of the building, and it seems to make harder for AI to detect humans especially when they approach closer to the building. Maybe there is some special trained dataset for such scenes (when camera is installed above human’s heads).
Please advise how to improve accuracy and possibly utilize hardware for object detection.

P.S. For your reference Frigate works much worse in case of EdgeTPU compared to your product, if I use Darknet engine (I mean sensitivity of detection, some clearly visible persons may not be detected by Frigate, when Viseron detects with 80% confidence).

If you have custom Darknet models you can just mount them in the container and point towards them instead of the default ones.

I have plans on implementing some kind of transfer learning functionality, which would allow you to improve the accuracy of the model by supplying training data that is specific to each camera, but its hard to find the time to do everything!

Hi, thanks for the reply coopter.
I removed the ‘path’ attribute like you suggested, but still this python error occurs.

Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 185, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/lib/python3.8/runpy.py", line 144, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/usr/lib/python3.8/runpy.py", line 111, in _get_module_details
    __import__(pkg_name)
  File "/src/viseron/__init__.py", line 8, in <module>
    from viseron.config import CONFIG, NVRConfig, ViseronConfig
  File "/src/viseron/config/__init__.py", line 114, in <module>
    CONFIG = VISERON_CONFIG_SCHEMA(raw_config)
  File "/usr/local/lib/python3.8/dist-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
  File "/usr/local/lib/python3.8/dist-packages/voluptuous/validators.py", line 205, in _run
    return self._exec(self._compiled, value, path)
  File "/usr/local/lib/python3.8/dist-packages/voluptuous/validators.py", line 287, in _exec
    raise e if self.msg is None else AllInvalid(self.msg, path=path)
  File "/usr/local/lib/python3.8/dist-packages/voluptuous/validators.py", line 285, in _exec
    v = func(path, v)
  File "/usr/local/lib/python3.8/dist-packages/voluptuous/schema_builder.py", line 594, in validate_dict
    return base_validate(path, iteritems(data), out)
  File "/usr/local/lib/python3.8/dist-packages/voluptuous/schema_builder.py", line 432, in validate_mapping
    raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: required key not provided @ data['cameras'][0]['path']

Could you discover what is wrong from this traceback? Thanks

Ahh okay my bad, try this:

cameras:
  - name: samsung galaxy note8
    host: 192.168.0.183
    port: 4747
    path: /
    username: myusername
    password: mypassword
    width: 1920
    height: 1080
    fps: 30

Hello, I’ve still not given up on trying to connect my Android phone and record video.
Finally I’ve succeeded in initializing & pairing my phone with Viseron! I used RTSP protocol app(IP webcam) to do this. Then I’m trying to record video that is being streamed. I tuned yaml to save recording as mp4, but viseron keeps saving only jpg file on /recordings. Is there a way to record mp4 video?

my yaml file:
cameras:

  • name: samsung galaxy note8
    host: 192.168.0.183
    port: 8554
    path: /live
    username: admin
    password: qwerty
    fps: 30

recorder:
lookback: 3
timeout: 3
folder: /recordings
extension: mp4

Correction:
It works when I specify codec/audio codec on config file. One more question, do you support live streaming?