Use a Canon EOS camera as a webcam on Linux. eoscam is written for the EOS
550D. Other Canon models with liveview may need --size.
eoscam is a daemon that writes frames to a v4l2loopback device. Video apps see that device as a webcam named "EOS Webcam".
- While no camera is connected, eoscam writes black frames. The webcam stays available to apps.
- When you plug in or switch on the camera, eoscam claims it within a few seconds and streams its liveview. Before eoscam claims the camera, it stops gvfs's gphoto2 processes, because they hold the camera.
- When you switch off or unplug the camera, eoscam goes back to black frames and waits for the camera. Apps that use the webcam keep their stream.
eoscam reads the camera through libgphoto2 and writes to the v4l2loopback
device itself. You do not need gphoto2 or ffmpeg.
-
Add the flake to your inputs:
eoscam.url = "github:noahhhx/eoscam";
-
Import the module and enable the service:
{ inputs, ... }: { imports = [ inputs.eoscam.nixosModules.default ]; services.eoscam.enable = true; }
-
Rebuild your system.
The module loads v4l2loopback with card_label="EOS Webcam" exclusive_caps=1.
It runs eoscam as a systemd user service.
The installer supports Ubuntu, Debian, Arch, Fedora, and other distros that use systemd. Before you start, check these requirements:
- Your machine is x86_64. The release has no other builds.
- Your distro has glibc 2.34 or later: Ubuntu 22.04+, Debian 12+, Arch, or Fedora 35+.
- If Secure Boot is on, DKMS asks you to enroll a signing key (MOK) the first time it builds v4l2loopback. Follow its prompt and reboot.
-
Install libgphoto2 and v4l2loopback:
Distro Packages Ubuntu 24.04+ libgphoto2-6t64 v4l2loopback-dkmsUbuntu 22.04, Debian 12 libgphoto2-6 v4l2loopback-dkmsArch libgphoto2 v4l2loopback-dkms, and headers for your kernelFedora libgphoto2 v4l2loopbackfrom RPM FusionOn Arch, the headers package for the default kernel is
linux-headers. -
Run the installer:
curl -fsSL https://raw.githubusercontent.com/noahhhx/eoscam/main/install.sh | sh
The installer does these steps:
- Downloads the binary from the latest GitHub release.
- Checks for libgphoto2 and v4l2loopback. If either is missing, it prints the packages to install and stops. It does not change your system.
- Installs the binary to
/usr/local/bin/eoscam. - Configures v4l2loopback to load at boot, and loads it now.
- Enables eoscam as a systemd user service for all users.
To update eoscam, run the installer again.
To uninstall eoscam, run:
curl -fsSL https://raw.githubusercontent.com/noahhhx/eoscam/main/install.sh | sh -s -- --uninstallThe uninstaller leaves the libgphoto2 and v4l2loopback packages installed.
Turn on the camera and watch the log:
journalctl --user -u eoscam -fWhen eoscam finds the camera, it logs camera connected, streaming. Open
"EOS Webcam" in a video app to see the liveview.
--name NAME v4l2loopback card_label to write to [default: EOS Webcam]
--device PATH write to this device instead of looking it up by name
--size WxH output resolution [default: 1056x704, the 550D liveview size]
If the camera's liveview size differs from --size, eoscam logs the correct
--size value. Until you change it, eoscam crops or pads each frame to fit.
On NixOS, set options with services.eoscam.extraArgs and
services.eoscam.cardLabel.
The dev environment uses devenv. It provides stable Rust,
libgphoto2, libclang for bindgen, and a clippy pre-commit hook. If you use
direnv, run direnv allow once. Otherwise, run devenv shell.
cargo test
cargo runTo test install.sh with a local build instead of the latest release, set
EOSCAM_BINARY:
cargo build --release
EOSCAM_BINARY=target/release/eoscam sh install.shflake.nix only builds the package and the NixOS module. It does not define
the dev environment.
-
Push a version tag:
git tag v0.1.0 && git push --tags -
The release workflow builds the binary on Ubuntu 22.04. It attaches the binary to a GitHub release as
eoscam-x86_64-linux.install.shdownloads this file.