3 ms·
Using your suggestion I ended up with the following for a Canon 7D: services.udev.extraRules = '' ACTION=="add", \ ATTR{idVendor}=="04a9", \ ATTR
by l0b0 4y ago
Using your suggestion I ended up with the following for a Canon 7D:
services.udev.extraRules = ''
ACTION=="add", \
ATTR{idVendor}=="04a9", \
ATTR{idProduct}=="319a", \
ENV{SYSTEMD_WANTS}+="external_webcam.service", \
SUBSYSTEM=="usb", \
TAG+="systemd"
'';
systemd.services.external_webcam = {
enable = true;
script = ''
${pkgs.gphoto2}/bin/gphoto2 --stdout --capture-movie |
${pkgs.ffmpeg}/bin/ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -f v4l2 /dev/video0
'';
wantedBy = ["multi-user.target"];
};
Worked first try! [1]
[1] https://gitlab.com/engmark/root/-/commit/ae59aad118e6effcf47ca47698b4640008ccace8 https://gitlab.com/engmark/root/-/commit/ae59aad118e6effcf47...