mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
fix(motion): logistics webcam
but also disable for now
This commit is contained in:
parent
6b3ba157a4
commit
33b18bc348
3 changed files with 31 additions and 5 deletions
|
|
@ -5,6 +5,7 @@
|
|||
...
|
||||
}: let
|
||||
inherit (gensokyo-zone.lib) mapDefaults;
|
||||
inherit (lib.strings) concatStringsSep;
|
||||
inherit (config.services) motion;
|
||||
format = "mjpeg"; # or "yuyv"
|
||||
params = {
|
||||
|
|
@ -22,7 +23,12 @@
|
|||
in {
|
||||
services.motion.cameras.livingcam.settings = mapDefaults {
|
||||
video_device = "/dev/livingcam";
|
||||
video_params = "auto_brightness=2,brightness=72,power_line_frequency=2,palette=${toString params.${format}.palette}";
|
||||
video_params = concatStringsSep "," [
|
||||
#"auto_brightness=2"
|
||||
"brightness=56"
|
||||
"power_line_frequency=2"
|
||||
"palette=${toString params.${format}.palette}"
|
||||
];
|
||||
inherit (params.${format}) width height;
|
||||
#framerate = 30;
|
||||
framerate = 20;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,14 @@
|
|||
{gensokyo-zone, ...}: let
|
||||
{
|
||||
config,
|
||||
gensokyo-zone,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (config.services) motion;
|
||||
inherit (gensokyo-zone.lib) mapDefaults;
|
||||
in {
|
||||
services.motion.cameras.webcam.settings = mapDefaults {
|
||||
video_device = "/dev/video0";
|
||||
video_device = "/dev/webcam";
|
||||
video_params = "palette=15";
|
||||
width = 1280;
|
||||
height = 720;
|
||||
|
|
@ -10,4 +16,19 @@ in {
|
|||
framerate = 3;
|
||||
text_left = "logistics";
|
||||
};
|
||||
services.udev.extraRules = let
|
||||
inherit (lib.strings) concatStringsSep;
|
||||
rules = [
|
||||
''SUBSYSTEM=="video4linux"''
|
||||
''ATTR{index}=="0"''
|
||||
''ATTRS{idVendor}=="5986"''
|
||||
''ATTRS{idProduct}=="111c"''
|
||||
''SYMLINK+="webcam"''
|
||||
''OWNER="${motion.user}"''
|
||||
''TAG+="systemd"''
|
||||
''ENV{SYSTEMD_WANTS}="motion.service"''
|
||||
];
|
||||
rulesLine = concatStringsSep ", " rules;
|
||||
in
|
||||
rulesLine;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue