Projects

FakeCam

published 2021-08-04

Let's Talk About Ethics Real Quick

So this project could totally be used for unethical reasons. For example, one could hypothetically use it to make it appear one is in any virtual class, when in reality they are off doing other stuff. I'd just like to say I don't condone doing such things. You would be cheating yourself out of your education, and also deceiving your teachers who just want to help you pass your class.

The Project

Now that that's out of the way, let me tell you about the time I built an app that made it so you could record video of yourself and then run it through a virtual webcam.

The code can be found here.

Basically, it connects to a virtual loopback device created using v4l2loopback, and then allows the user to switch back and forth between sending a looping video to that device or the actual webcam feed.

This loopback device can be selected just as a normal webcam input in things like google classroom or zoom.

Unfortunately this will only be run on Linux due to the Linux-specific kernel module that it uses.

Technologies Used

The first iteration of this project was written using OpenCV to handle video processing, PyFakeWebcam to interface with the v4l2loopback device, and PyGame to handle the GUI.

The second iteration aimed to use GTK, implemented using PyGObject to make a more fully-featured GUI and add the ability to record video to loopback while also sending the camera input to the lookback device. It got most of the way there, but was never actually finished.

What I Learned

This project was my first time messing with loopback devices, kernel modules, and my first time using multithreading/subprocesses in python.

I also learned a lot about making GUIs in python, getting some experience with both PyGObject and PyGame.