diff --git a/hosts/kameramann/nvr.nix b/hosts/kameramann/nvr.nix index f9cfe06..23a0c82 100644 --- a/hosts/kameramann/nvr.nix +++ b/hosts/kameramann/nvr.nix @@ -20,6 +20,10 @@ ]; services.go2rtc.enable = true; + services.go2rtc.settings = { + rtsp.listen = ":8554"; + webrtc.listen = ":8555"; + }; services.go2rtc.settings.streams = { "ulfried" = [ "\${ULFRIED_URL}" @@ -55,5 +59,107 @@ ]; }; - networking.firewall.allowedTCPPorts = [ 1984 ]; + services.frigate.enable = true; + services.frigate.hostname = "kameramann.lan.baubs.net"; + services.frigate.settings.go2rtc = { streams = { + "ulfried" = []; + "ulfried_sub" = []; + "taubis" = []; + "taubis_sub" = []; + "foeff" = []; + "foeff_sub" = []; + "gnisbert" = []; + "gnisbert_sub" = []; + };}; + services.frigate.settings.detect = { + enabled = true; + }; + services.frigate.settings.objects = { + track = ["person" "bird" "car"]; + }; + services.frigate.settings.classification.bird.enabled = true; + + + services.frigate.settings.cameras = { + "ulfried" = { + record = { + enabled = true; + continuous.days = 0; + alerts.retain = { + days = 30; + mode = "motion"; + }; + }; + ffmpeg.inputs = [{ + path = "rtsp://127.0.0.1:8554/ulfried?timeout=30"; + input_args = "preset-rtsp-generic"; + roles = [ + "record" + ]; + } + { + path = "rtsp://127.0.0.1:8554/ulfried_sub?timeout=30"; + input_args = "preset-rtsp-generic"; + roles = [ + "detect" + "audio" + ]; + }]; + }; + "foeff" = { + record = { + enabled = true; + continuous.days = 0; + alerts.retain = { + days = 30; + mode = "motion"; + }; + }; + ffmpeg.inputs = [ + { + path = "rtsp://127.0.0.1:8554/foeff?timeout=30"; + input_args = "preset-rtsp-generic"; + roles = [ + "record" + ]; + } + { + path = "rtsp://127.0.0.1:8554/foeff_sub?timeout=30"; + input_args = "preset-rtsp-generic"; + roles = [ + "detect" + "audio" + ]; + } + ]; + }; + "taubis" = { + detect.enabled = true; + record = { + enabled = true; + continuous.days = 1; + detections.retain.days = 7; + }; + ffmpeg.inputs = [ + { + path = "rtsp://127.0.0.1:8554/taubis?timeout=30"; + input_args = "preset-rtsp-generic"; + roles = [ + "record" + ]; + } + { + path = "rtsp://127.0.0.1:8554/taubis_sub?timeout=30"; + input_args = "preset-rtsp-generic"; + roles = [ + "detect" + "audio" + ]; + } + ]; + }; + }; + + networking.firewall.allowedTCPPorts = [ 5000 1984 80 8555 ]; + networking.firewall.allowedUDPPorts = [ 8555 ]; }