https://github.com/joschuck/matrix-webcam Skip to content Toggle navigation Sign up * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code + Explore + All features + Documentation + GitHub Skills + Blog * Solutions + By Plan + Enterprise + Teams + Compare all + By Solution + CI/CD & Automation + DevOps + DevSecOps + Case Studies + Customer Stories + Resources * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles + Repositories + Topics + Trending + Collections * Pricing [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} joschuck / matrix-webcam Public * Notifications * Fork 4 * Star 269 Take your video conference from within the matrix. License MIT license 269 stars 4 forks Star Notifications * Code * Issues 1 * Pull requests 0 * Actions * Projects 0 * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Security * Insights joschuck/matrix-webcam This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags 1 branch 0 tags Code * Clone HTTPS GitHub CLI [https://github.com/j] Use Git or checkout with SVN using the web URL. [gh repo clone joschu] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching Xcode If nothing happens, download Xcode and try again. Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @joschuck joschuck v0.4.0 select webcam ... c75be78 Oct 2, 2022 v0.4.0 select webcam c75be78 Git stats * 25 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time doc v0.3.0 actually have the matrix letters trickle down Apr 24, 2022 matrix_webcam v0.4.0 select webcam Oct 2, 2022 .gitignore initial version Apr 18, 2022 .pre-commit-config.yaml 0.3.1 dependency fixes, pre-commit fixes, proper existing and no webc... Sep 29, 2022 .pylintrc 0.3.1 dependency fixes, pre-commit fixes, proper existing and no webc... Sep 29, 2022 LICENSE Initial commit Apr 18, 2022 README.md v0.4.0 select webcam Oct 2, 2022 requirements.txt 0.3.1 dependency fixes, pre-commit fixes, proper existing and no webc... Sep 29, 2022 setup.cfg 0.3.1 dependency fixes, pre-commit fixes, proper existing and no webc... Sep 29, 2022 setup.py v0.4.0 select webcam Oct 2, 2022 View code [ ] matrix-webcam Running it Can I use this for Teams/Zoom/Skype etc.? For Windows/Mac Users For Linux Users Development TODO License README.md matrix-webcam License MIT issues Code style: black Checked with mypy This package displays your webcam video feed in the console. Take your next video conference from within the matrix! matrix-webcam demo Running it Make sure you have Python and pip installed. Installation using pip: $ pip install matrix-webcam # make sure it's in your PATH for it to run, alternatively use sudo $ matrix-webcam Installing and running it from source: $ git clone https://github.com/joschuck/matrix-webcam.git $ cd matrix-webcam $ python -m pip install . $ matrix-webcam Tip: Shrink your font size, it will look even more hacky usage: matrix-webcam [-h] [-l LETTERS] [-p PROBABILITY] [-u UPDATES_PER_SECOND] options: -h, --help show this help message and exit -d DEVICE, --device DEVICE Sets the index of the webcam if you have more than one webcam. -l LETTERS, --letters LETTERS The number of letters produced per update. -p PROBABILITY, --probability PROBABILITY 1/p probability of a dispense point deactivating each tick. -u UPDATES_PER_SECOND, --updates-per-second UPDATES_PER_SECOND The number of updates to perform per second. Can I use this for Teams/Zoom/Skype etc.? For Windows/Mac Users Yes! You can for example use OBS Studio ~~ together with the Virtual Cam plugin ~~ . Notice: obs-studio have officially provided virtual camera feature since version 26.0.0 , you can use it without installing this plugin. Then all you need to do is select the virtual webcam in Teams/Zoom/Skype. For Linux Users First we need to make sure you have the v4l2loopback kernel module to create V4L2 loopback devices setup. This module allows you to create "virtual video devices". Normal (v4l2) applications will read these devices as if they were ordinary video devices, but the video will not be read from e.g. a capture card but instead it is generated by another application. It should be available in your distro's package manager. Under Ubuntu install it using: $ sudo apt install -y v4l2loopback-dkms v4l2loopback-utils Now we need to create a virtual v4l2 device (exclusive_caps=1 and YUV2 conversion is required by Chromium for the device to be recognized): $ sudo modprobe v4l2loopback devices=1 video_nr=42 card_label="Virtual Camera" exclusive_caps=1 max_buffers=2 Now we need to find the xid if the terminal window we will launch matrix-webcam in using $ xdotool getactivewindow 79869947 # sample output Optionally resize the terminal window to something reasonable from another terminal and then launch matrix webcam $ wmctrl -i -r 79869947 -e 0,300,300,1280,720 # in another terminal (2) Now launch matrix-webcam $ matrix-webcam # in the terminal that was just resized Now launch the virtual device in terminal (2) - you need Gstreamer for this, check the link on how to install it $ gst-launch-1.0 ximagesrc xid=79869947 ! video/x-raw,framerate=30/1 ! videoconvert ! video/x-raw,format=YUY2 ! v4l2sink device=/dev/video42 That's it, your webcam should show up in Chromium, Teams, etc.! Development I'd recommend creating a new virtual environment (if you are under Ubuntu install it using sudo apt install python3-venv using $ python3 -m venv venv/ $ source venv/bin/activate Then install the dependencies using: $ pip install -e .[dev,deploy] Setup pre-commit, too: $ pre-commit install TODO * [*] Add Virtual webcam documentation for Linux/Gstreamer * [*] add webcam selection * [ ] Move to opencv-python-headless * [ ] add tests License This project is licensed under the MIT License (see the LICENSE file for details). About Take your video conference from within the matrix. Resources Readme License MIT license Stars 269 stars Watchers 1 watching Forks 4 forks Releases No releases published Packages 0 No packages published Languages * Python 100.0% Footer (c) 2022 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.