aboutsummarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDylan Turner2021-10-23 14:14:04 -0500
committerDylan Turner2021-10-23 14:14:04 -0500
commitd120969db16f39d3e6a082ad5bf88ed2686954f7 (patch)
tree2ff758af039ee9d8a1c7e57169b5eadb047ac859
downloadaur-d120969db16f39d3e6a082ad5bf88ed2686954f7.tar.gz
v21.1023.1350
-rw-r--r--.SRCINFO15
-rw-r--r--.gitignore4
-rw-r--r--PKGBUILD44
-rw-r--r--README.md29
4 files changed, 92 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..d5f1bda4ebb8
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,15 @@
+pkgbase = bgrm-git
+ pkgdesc = A utility for removing backgrounds from a webcam and returning a virtual webcam for use in applications like Teams, OBS, etc
+ pkgver = 21.1023
+ pkgrel = 1350
+ url = https://www.github.com/blueOkiris/bgrm
+ arch = any
+ license = GPL3
+ makedepends = git
+ makedepends = python
+ makedepends = python-pip
+ makedepends = v4l2loopback-dkms
+ source = git://github.com/blueOkiris/bgrm.git
+ md5sums = SKIP
+
+pkgname = bgrm-git
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..634415de43e9
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+src/
+*.tar*
+pkg/
+bgrm/
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..507254eb6bf7
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,44 @@
+# Maintainer: Dylan Turner dylantdmt@gmail.com
+pkgname=bgrm-git
+pkgver=21.1023
+pkgrel=1350
+epoch=
+pkgdesc="A utility for removing backgrounds from a webcam and returning a virtual webcam for use in applications like Teams, OBS, etc"
+arch=('any')
+url="https://www.github.com/blueOkiris/bgrm"
+license=('GPL3')
+makedepends=('git' 'python' 'python-pip' 'v4l2loopback-dkms')
+source=('git://github.com/blueOkiris/bgrm.git')
+md5sums=('SKIP')
+
+build() {
+ cd bgrm
+
+ echo "Setting up proper virtual environment."
+ ./scripts/setup-venv.sh
+
+ echo "Patching "
+ ./scripts/patch-v4l2-py-mod.sh
+}
+
+package() {
+ echo "Installing to $pkgdir/opt/bgrm."
+
+ mkdir -p "$pkgdir/opt/bgrm"
+
+ cp bgrm/bgrm.sh "$pkgdir/opt/bgrm"
+ cp bgrm/LICENSE "$pkgdir/opt/bgrm"
+ cp bgrm/README.md "$pkgdir/opt/bgrm"
+ cp -r bgrm/bgrm/ "$pkgdir/opt/bgrm"
+ cp -r bgrm/.venv "$pkgdir/opt/bgrm"
+
+ mkdir -p "$pkgdir/usr/bin"
+
+ echo "Creating link in $pkgdir/usr/bin"
+ cat <<EOF > "$pkgdir/usr/bin/bgrm"
+#!/bin/bash
+cd /opt/bgrm
+source bgrm.sh
+EOF
+ chmod +x "$pkgdir/usr/bin/bgrm"
+} \ No newline at end of file
diff --git a/README.md b/README.md
new file mode 100644
index 000000000000..ea343e2179be
--- /dev/null
+++ b/README.md
@@ -0,0 +1,29 @@
+# Background Remover
+
+## The Need
+
+It'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.
+
+Well, I'm an engineer, so of course, I found a solution.
+
+Using 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 :)
+
+## How to Use
+
+1. Setup
+ - First time you set up you need to do the following
+ - Create the proper virtual environment with `./scripts/setup-env.sh`
+ - Patch the v4l2 library `./scripts/patch-v4l2-py-mod.sh`
+
+2. Run
+ - After setting up, you can run the application
+ - Run with `sudo ./bgrm.sh <options>` (use `--help` to see all options)
+ - Example: `sudo ./bgrm.sh -b ~/Pictures/Wallpapers/ni-skyline-wallpaper.png -w 320 -H 240 -s 2.0`
+
+Note, this will work anywhere WebCams are used.
+
+# Dependencies
+
+ - python >= 3.9
+ - pip
+ - v4l2loopback-dkms