Requires:
- OpenCV 4.3
- Webcam
- Linux?
Usage:
- Have a file named
video.mp4
at the project root (not included) to be used as the background - Execute
cargo run
from project root
- Install latest (v4l2loopback)[https://github.com/umlaeute/v4l2loopback/]
- You may use the following command to start a new virtual webcam:
insmod v4l2loopback.ko devices=1 max_buffers=16 exclusive_caps=1 card_label="VirtualCam #0"
- You may use the following command to start a new virtual webcam:
- Make sure you have
gst-launch-1.0
andwmctrl
available - Start this app
- Two windows will open, one with threshold control and another named
WEBCAM
that you shall not change
- Two windows will open, one with threshold control and another named
- Call
wmctrl -l
to get theWEBCAM
window ID - Call
gst-launch-1.0 ximagesrc use-damage=false xid=0x04c0000d starty=65 endy=485 ! videoconvert ! "video/x-raw,format=YUY2" ! v4l2sink device=/dev/videoN
to start streaming the content fromWEBCAM
into your virtual webcam - ???
- Profit!