Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Viseron configuration and motion detection errors #909

Open
stonehencs opened this issue Feb 10, 2025 · 3 comments
Open

Viseron configuration and motion detection errors #909

stonehencs opened this issue Feb 10, 2025 · 3 comments

Comments

@stonehencs
Copy link

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?

@roflcoopter
Copy link
Owner

  • 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

@stonehencs
Copy link
Author

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:

@roflcoopter
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants