diff --git a/nixos/boxes/home/palace/vms/default.nix b/nixos/boxes/home/palace/vms/default.nix index 463e061..bb3985c 100644 --- a/nixos/boxes/home/palace/vms/default.nix +++ b/nixos/boxes/home/palace/vms/default.nix @@ -192,6 +192,8 @@ "device qemu-xhci,id=xhci" # Front-right port? "device usb-host,hostbus=1,hostport=4" + # Front-left port + "device usb-host,hostbus=1,hostport=3" ]; }; }; diff --git a/nixos/boxes/home/palace/vms/sfh/containers/hass.nix b/nixos/boxes/home/palace/vms/sfh/containers/hass.nix index 105a06a..975b3f0 100644 --- a/nixos/boxes/home/palace/vms/sfh/containers/hass.nix +++ b/nixos/boxes/home/palace/vms/sfh/containers/hass.nix @@ -108,6 +108,9 @@ in # "http://reolink-living-room.${domain}/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin#video=copy#audio=copy#audio=opus" "rtsp://admin:@reolink-living-room:554/h264Preview_01_main" ]; + webcam_office = [ + "ffmpeg:device?video=/dev/video0&video_size=1024x576#video=h264" + ]; }; }; }; @@ -139,6 +142,21 @@ in retain.days = 1; }; }; + + webcam_office = { + ffmpeg.inputs = [ + { + path = "rtsp://127.0.0.1:8554/webcam_office"; + input_args = "preset-rtsp-restream"; + roles = [ "record" "detect" ]; + } + ]; + detect.enabled = false; + record = { + enabled = true; + retain.days = 1; + }; + }; }; }; }; diff --git a/nixos/boxes/home/palace/vms/sfh/default.nix b/nixos/boxes/home/palace/vms/sfh/default.nix index 6895206..2d45d0c 100644 --- a/nixos/boxes/home/palace/vms/sfh/default.nix +++ b/nixos/boxes/home/palace/vms/sfh/default.nix @@ -150,6 +150,7 @@ in systemd.services = { "systemd-nspawn@hass".serviceConfig.DeviceAllow = [ "char-ttyUSB rw" + "char-video4linux rw" ]; }; @@ -177,6 +178,7 @@ in hass = { bindMounts = { "/dev/bus/usb/001/002".readOnly = false; + "/dev/video0".readOnly = false; "/dev/serial/by-id/usb-Nabu_Casa_Home_Assistant_Connect_ZBT-1_ce549704fe38ef11a2c2e5d154516304-if00-port0" = { readOnly = false; mountPoint = "/dev/ttyUSB0";