Add proxy for camera

This commit is contained in:
Thomas Avé 2026-03-13 14:55:42 +07:00
parent 22284efb55
commit fbc5116995
1 changed files with 34 additions and 0 deletions

View File

@ -19,6 +19,7 @@
boot.extraModprobeConfig = ''
options thinkpad_acpi fan_control=1
options v4l2loopback exclusive_caps=1 card_label="Android Virtual Camera"
options v4l2loopback exclusive_caps=1 video_nr=42 card_label="IPU6 Virtual Camera"
'';
# boot.kernelParams = ["ipv6.disable=1"];
@ -63,4 +64,37 @@
services.udev.extraRules = ''
SUBSYSTEM=="intel-ipu6-psys", MODE="0660", GROUP="video"
'';
systemd.services.ipu6-v4l2-proxy = {
description = "IPU6 Libcamera to V4L2Loopback Proxy";
# wantedBy = ["multi-user.target"];
after = ["systemd-udev-settle.service"];
serviceConfig = {
ExecStart = let
gstPluginPath = pkgs.lib.makeSearchPathOutput "lib" "lib/gstreamer-1.0" (with pkgs.gst_all_1;
[
gstreamer
gst-plugins-base
gst-plugins-good
gst-plugins-bad
]
++ [pkgs.libcamera]);
in ''
${pkgs.gst_all_1.gstreamer}/bin/gst-launch-1.0 \
--gst-plugin-path=${gstPluginPath} \
libcamerasrc \
! video/x-raw \
! vapostproc contrast=1.3 saturation=1.4 brightness=-0.15 \
! video/x-raw,width=1280,height=720 \
! videoconvert \
! gamma gamma=0.7 \
! videoconvert \
! video/x-raw,format=YUY2 \
! v4l2sink device=/dev/video42
'';
Restart = "always";
RestartSec = "3";
};
};
}