{"id":22374641,"url":"https://github.com/blueokiris/bgrm","last_synced_at":"2025-10-16T23:39:10.076Z","repository":{"id":38326938,"uuid":"419981831","full_name":"blueOkiris/bgrm","owner":"blueOkiris","description":"Virtual webcam that takes real webcam footage and replaces the background in order to have Virtual Backgrounds in MS Teams for Linux where the feature is unimplemented.","archived":false,"fork":false,"pushed_at":"2023-05-16T09:35:55.000Z","size":3736,"stargazers_count":83,"open_issues_count":0,"forks_count":5,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-11-10T02:29:09.584Z","etag":null,"topics":["background-removal","linux","python","v4l2loopback","video"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blueOkiris.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-10-22T05:53:26.000Z","updated_at":"2024-07-04T16:49:44.000Z","dependencies_parsed_at":"2022-08-25T03:02:31.809Z","dependency_job_id":null,"html_url":"https://github.com/blueOkiris/bgrm","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blueOkiris%2Fbgrm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blueOkiris%2Fbgrm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blueOkiris%2Fbgrm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blueOkiris%2Fbgrm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blueOkiris","download_url":"https://codeload.github.com/blueOkiris/bgrm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228192298,"owners_count":17882758,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["background-removal","linux","python","v4l2loopback","video"],"created_at":"2024-12-04T21:18:05.159Z","updated_at":"2025-10-16T23:39:09.998Z","avatar_url":"https://github.com/blueOkiris.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Background Remover\n\n## The Need\n\nIt's been good long while since Microsoft first released a Teams version for Linux and yet, one of Teams' coolest features doesn't exist in said Linux version: removable backgrounds. As someone who uses Linux for their daily driver, this annoys me.\n\nWell, I'm an engineer, so of course, I found a solution.\n\nUsing OpenCV and a v4l2loopback device (basically a virtual webcam you can write data to), I threw together a Python application that takes your normal webcam input, removes and replaces the background, and outputs that to the created video device. Problem solved :)\n\nNote, this will work anywhere WebCams are used, not just Teams\n\nNow, the program can also be used to remove backgrounds from video files and save them as video files as well!\n\n## How to Use\n\n### WebCam Replacement\n\nDependencies:\n  - x86 or x64 only as mediapipe, a dependency, doesn't support ARM\n    + Although, there are versions of mediapipe that may work if you have Apple Silicon or a Raspberry Pi\n    + If on ARM, you'll have to install from the GitHub source and modify pyproject.toml to use a custom mediapipe library like [mediapipe-silicon](https://pypi.org/project/mediapipe-silicon/) or [mediapipe-rpi4](https://pypi.org/project/mediapipe-rpi4/)  or something else\n  - python \u003e= 3.8 (3.11 is what's supported officially)\n  - pip\n  - v4l2loopback\n\nSetup:\n1. Configure v4l2loopback (may not be necessary):\n  - Recommended something like this:\n    ```\n    export DEVICE_ARR=(`ls /sys/devices/virtual/video4linux | tr -d 'video'`); \\\n    sudo modprobe v4l2loopback \\\n        devices=1 exclusive_caps=1 video_nr=${DEVICE_ARR[1]} max_buffers=2 \\\n        card_label=v4l2lo\n    ```\n2. Install with `pip install bgrm`\n\nThen, you can run: \n- Run with `python -m bgrm \u003coptions\u003e` (use `--help` to see all options)\n- Example: `python -m bgrm -b ~/Pictures/Wallpapers/ni-skyline-wallpaper.png -w 320 -H 240 -s 2.0`\n\n### File Replacement\n\nYou can also remove the background from video files. It works just like the WebCam, but instead of setting the `--camera` cli arg, you call the program like this:\n\n`python -m bgrm --file_mode -i \u003cinput file\u003e -o \u003coutput file\u003e \u003cother options\u003e`\n\n## Build from Repo\n\nYou can also build the package yourself from source (or grab the latest version from the releases tab)\n\nTo do that you need the \"poetry\" build system.\n\nRun `poetry build` and install the whl from the dist/ folder\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblueokiris%2Fbgrm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblueokiris%2Fbgrm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblueokiris%2Fbgrm/lists"}