viseron icon indicating copy to clipboard operation
viseron copied to clipboard

Viseron configuration and motion detection errors

Open stonehencs opened this issue 10 months ago • 3 comments

Hello, I installed viseron today and tried to set it to detect motion and to record 20sec before/after motion detection (by default it looks like 10 before, 10 after but with motion) Unfortunately I ran into errors like this or failed:

  • It doesn't record 10 seconds from the end of the motion but from the start, so only 20sec videos. I tried recorder_keepalive: true but it did not do anything literally. So I mean I wanted it like this: before 20 + full motion + after 20.
  • I tried to play with the Threshold value but it didn't do anything, because if I jump in front of the camera it starts, but if I just move my hand a little bit it doesn't start recording.
  • How can I specify the exact stream size? Currently 2304x1296. Is just using widht and height enough?
  • I tried to specify the codec but it always throws an error that there is none. I tried specifying (h265+)

My configuration so far:

ffmpeg:
  camera:
    camera_1:
      name: alma
      host: !secret camera1_ip
      port: 554
      path: /stream1
      username: !secret camera1_user
      password: !secret camera1_pswd
      fps: 25

mog2:
  motion_detector:
    cameras:
      camera_1:
        recorder_keepalive: true #I tried this but nothing new
        fps: 25
        trigger_recorder: true 

nvr:
  camera_1:

Thanks in advance for your answers!

P.S, Is there onviff support in Viseron? If yes, how to adapt it to motion detection?

stonehencs avatar Feb 10 '25 10:02 stonehencs

  • I tried to play with the Threshold value but it didn't do anything, because if I jump in front of the camera it starts, but if I just move my hand a little bit it doesn't start recording.

You need to set area to a lower value to make motion detection more sensitive.

  • How can I specify the exact stream size? Currently 2304x1296. Is just using widht and height enough?

Yes that is enough

  • I tried to specify the codec but it always throws an error that there is none. I tried specifying (h265+)

Setting codec: h265 or codec: hevc should work.

Is there onviff support in Viseron? If yes, how to adapt it to motion detection?

No ONVIF support yet but it is planned for a future release

roflcoopter avatar Feb 12 '25 10:02 roflcoopter

Thanks @roflcoopter, I managed to do it. But now I ran into a problem that during a test recording ( monitoring the parking lot) there were several times that it only recorded 1 minute videos max. Even if the whole movement was several minutes long. And I noticed that what it was doing was recording the whole movement but in 5 separate videos. My updated config:

ffmpeg:
  camera:
    camera_1:
      name: vigi_kamera_1
      host: !secret camera1_ip
      port: 554
      path: !secret camera1_path1
      username: !secret camera1_user
      password: !secret camera1_pswd
      fps: 25
      width: 2304
      height: 1296
      codec: hevc
      stream_format: rtsp
      substream:
        path: !secret camera1_path2
        port: 554
        stream_format: rtsp
        fps: 25
        width: 704
        height: 576
      recorder:
        lookback: 10
        idle_timeout: 15
        retain: 365

mog2:
  motion_detector:
    cameras:
      camera_1:
        recorder_keepalive: true
        threshold: 4
        fps: 10
        area: 0.005
        history: 800
        #detect_shadows: true
        trigger_recorder: true
        width: 704
        height: 576

nvr:
  camera_1:

stonehencs avatar Feb 13 '25 16:02 stonehencs

Hard to say for sure without logs but my guess is that the motion ends imtermittently and that is why it records several videos. If you increase idle_timeout timeout you will probably get better results

roflcoopter avatar Feb 24 '25 10:02 roflcoopter