Stream camera frames from a device to a virtual video device on Linux.
camd
is a command-line utility for Linux that streams camera frames from a device to a virtual video device.
Using FFmpeg, the application converts the camera frames into a suitable format for the virtual video device.
- A virtual video device available
- FFmpeg (already installed in most of Linux distributions)
Clone this repository:
git clone https://github.com/zenoxygen/camd.git
Build the binary with optimizations:
cargo build --release
Install the binary on your system:
sudo install -m 0755 -o root -g root -t /usr/local/bin ./target/release/camd
camd 0.1.0
USAGE:
camd [OPTIONS]
OPTIONS:
--host_camera <host_camera> the host of the camera server [default: 0.0.0.0:4321]
--host_video <host_video> the host of the video server [default: 0.0.0.0:1234]
--virtual_device <virtual_device> the name of the virtual device [default: /dev/video2]
Run with the environment variable set:
RUST_LOG=trace camd
- Install v4l2loopback:
sudo apt-get install v4l2loopback-dkms v4l-utils
- Load the v4l2loopback module into the kernel:
sudo modprobe v4l2loopback
- List available video devices using v4l2-ctl:
v4l2-ctl --list-devices