wip go2rtc

This commit is contained in:
2025-02-13 17:43:38 +02:00
parent 1f777dd46e
commit 116ae739cc

View File

@@ -14,13 +14,43 @@ in
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
systemd.services.frigate = { systemd.services = {
preStart = "ln -sf $CREDENTIALS_DIRECTORY/secrets.env /run/frigate/secrets.env"; frigate = {
serviceConfig = { preStart = "ln -sf $CREDENTIALS_DIRECTORY/secrets.env /run/frigate/secrets.env";
EnvironmentFile = [ "-/run/frigate/secrets.env" ]; serviceConfig = {
Environment = [ "PYTHONPERFSUPPORT=1" ]; EnvironmentFile = [ "-/run/frigate/secrets.env" ];
RuntimeDirectory = "frigate"; RuntimeDirectory = "frigate";
LoadCredential = [ "secrets.env:${cfg.secretsEnv}" ]; LoadCredential = [ "secrets.env:${cfg.secretsEnv}" ];
};
};
go2rtc = {
preStart = "ln -sf $CREDENTIALS_DIRECTORY/secrets.env /run/go2rtc/secrets.env";
serviceConfig = {
EnvironmentFile = [ "-/run/go2rtc/secrets.env" ];
RuntimeDirectory = "go2rtc";
LoadCredential = [ "secrets.env:${cfg.secretsEnv}" ];
};
};
};
services.go2rtc = {
enable = true;
settings = {
streams = {
"vno4-dome-panorama-high" = [
"ffmpeg:rtsp://frigate:\${FRIGATE_RTSP_PASSWORD}@192.168.188.10/cam/realmonitor?channel=1&subtype=0"
];
"vno4-dome-panorama-low" = [
"ffmpeg:rtsp://frigate:\${FRIGATE_RTSP_PASSWORD}@192.168.188.10/cam/realmonitor?channel=1&subtype=1"
];
"vno4-dome-ptz-high" = [
"ffmpeg:rtsp://frigate:\${FRIGATE_RTSP_PASSWORD}@192.168.188.10/cam/realmonitor?channel=2&subtype=0"
];
"vno4-dome-ptz-low" = [
"ffmpeg:rtsp://frigate:\${FRIGATE_RTSP_PASSWORD}@192.168.188.10/cam/realmonitor?channel=2&subtype=1"
];
};
}; };
}; };
@@ -32,16 +62,6 @@ in
enabled = true; enabled = true;
}; };
go2rtc = {
streams = {
#vno4-dome-panorama = {
# path = "rtsp://frigate:{FRIGATE_RTSP_PASSWORD}@192.168.188.10/cam/realmonitor?channel=1&subtype=0";
#};
#vno4-dome-ptz = {
# path = "rtsp://frigate:{FRIGATE_RTSP_PASSWORD}@192.168.188.10/cam/realmonitor?channel=2&subtype=0";
#};
};
};
detectors = { detectors = {
coral = { coral = {
type = "edgetpu"; type = "edgetpu";
@@ -62,19 +82,18 @@ in
ffmpeg = { ffmpeg = {
hwaccel_args = "preset-vaapi"; hwaccel_args = "preset-vaapi";
output_args = { output_args = {
#record = "preset-record-generic-audio-copy"; record = "preset-record-generic-audio-copy";
record = "preset-record-generic";
}; };
inputs = [ inputs = [
{ {
path = "rtsp://frigate:{FRIGATE_RTSP_PASSWORD}@192.168.188.10/cam/realmonitor?channel=1&subtype=0"; path = "rtsp://localhost:8554/vno4-dome-panorama-high";
roles = [ roles = [
#"audio" "audio"
"record" "record"
]; ];
} }
{ {
path = "rtsp://frigate:{FRIGATE_RTSP_PASSWORD}@192.168.188.10/cam/realmonitor?channel=1&subtype=1"; path = "rtsp://localhost:8554/vno4-dome-panorama-low";
roles = [ "detect" ]; roles = [ "detect" ];
} }
]; ];
@@ -84,19 +103,18 @@ in
enabled = true; enabled = true;
ffmpeg = { ffmpeg = {
output_args = { output_args = {
#record = "preset-record-generic-audio-copy"; record = "preset-record-generic-audio-copy";
record = "preset-record-generic";
}; };
inputs = [ inputs = [
{ {
path = "rtsp://frigate:{FRIGATE_RTSP_PASSWORD}@192.168.188.10/cam/realmonitor?channel=2&subtype=0"; path = "rtsp://localhost:8554/vno4-dome-ptz-high";
roles = [ roles = [
#"audio" "audio"
"record" "record"
]; ];
} }
{ {
path = "rtsp://frigate:{FRIGATE_RTSP_PASSWORD}@192.168.188.10/cam/realmonitor?channel=2&subtype=1"; path = "rtsp://localhost:8554/vno4-dome-ptz-low";
roles = [ "detect" ]; roles = [ "detect" ];
} }
]; ];