Add filters (background blur, etc) to your webcam on Linux
Project description
webcam-filters
Add filters (background blur, etc) to your webcam on Linux.
Video conferencing applications tend to either lack video effects altogether or support only a limited set of capabilities on Linux (e.g. Zoom [1], Google Meets [2]).
Goal here is to provide a virtual webcam via v4l2loopback with a common set of filters that can be used everywhere.
Usage
Passthrough (no-op):
$ webcam-filters --input-dev /dev/video0 --output-dev /dev/video3
Blur background:
$ webcam-filters --input-dev /dev/video0 --output-dev /dev/video3 --background-blur 150
Dependencies
Other than the Python dependencies that can be automatically installed by Pip, there are a few system dependencies that require manual attention.
v4l2loopback
v4l2loopback kernel module is required to emulate a virtual webcam. See your distro’s docs or v4l2loopback on how to install and set it up (e.g. https://archlinux.org/packages/community/any/v4l2loopback-dkms/).
You’ll probably want to create at least one loopback device (that’s persistent on boot):
$ sudo tee /etc/modprobe.d/v4l2loopback.conf << "EOF" # /dev/video3 options v4l2loopback video_nr=3 options v4l2loopback card_label="Virtual Webcam" options v4l2loopback exclusive_caps=1 EOF $ sudo modprobe v4l2loopback $ v4l2-ctl --device /dev/video3 --info
Gstreamer
gstreamer-1.0 (e.g. https://archlinux.org/packages/extra/x86_64/gstreamer/)
gst-plugins-base (e.g. https://archlinux.org/packages/extra/x86_64/gst-plugins-base/)
gst-python (e.g. https://archlinux.org/packages/extra/x86_64/gst-python/)
gst-plugins-good (e.g. https://archlinux.org/packages/extra/x86_64/gst-plugins-good/)
Installation
You can either use pipx or pip. Pipx is recommend to keep dependencies isolated.
Latest stable:
$ pipx install --system-site-packages webcam-filters $ pip install --user webcam-filters
Latest pre-release:
$ pipx install --system-site-packages --pip-args='--pre' webcam-filters $ pip install --user --pre webcam-filters
Git:
$ url="git+https://github.com/jashandeep-sohi/webcam-filters.git" $ pipx install --system-site-packages "$url" $ pip install --user "$url"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for webcam_filters-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 340fa44888202faa629334e3315f5686371c9d875551e0b3ae209a76381fc9d9 |
|
MD5 | 0e4c957895fac14dab132b0453cb2aa7 |
|
BLAKE2b-256 | 25b3e4fb40177fd4fc18518fe4b919d0944b6bc32d3d53ac87ac2fdd8150e485 |