aspotton / fake-cam

A Python app and Docker image for webcam stream manipulation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fake-cam

Supported Python Versions Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public. License

A Python app and Docker image for webcam stream manipulation. This app will take the feed from the webcam (/dev/video0) and allow you to modify the video stream. It will send that modified output to a new, fake webcam device (/dev/video1) which can be used in chat applications like Google Hangouts/Meet, Zoom, etc.

Requires: A Linux host system (I used Ubuntu)

Original purpose: being able to apply deep fake effects during live video calls.

Running

  1. Make sure you install the libraries from 'On the host system'
  2. Build docker image

Then:

sudo modprobe v4l2loopback exclusive_caps=1 && \
docker run -it --rm --device /dev/video0:/dev/video0 --device /dev/video1:/dev/video1 -v $(pwd):/code webcam:latest /bin/bash -l

You should be able to select the new webcam in your web browser / chat application.

On the host system

sudo apt install v4l2loopback-dkms

Allows webcam to be used by Chrome, etc

sudo modprobe v4l2loopback exclusive_caps=1

Docker image

Building

docker build -t webcam:latest .

About

A Python app and Docker image for webcam stream manipulation

License:MIT License


Languages

Language:Python 93.2%Language:Dockerfile 6.8%