From 9fce5541f856f7973e5f9f31a10f0f79eaaf97fa Mon Sep 17 00:00:00 2001 From: Mehran Dehghanian Date: Sun, 7 Aug 2022 11:43:32 +0430 Subject: [PATCH] Add 'fake webcam streams ubuntu18' --- fake-webcam-streams-ubuntu18.md | 38 +++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 fake-webcam-streams-ubuntu18.md diff --git a/fake-webcam-streams-ubuntu18.md b/fake-webcam-streams-ubuntu18.md new file mode 100644 index 0000000..4291794 --- /dev/null +++ b/fake-webcam-streams-ubuntu18.md @@ -0,0 +1,38 @@ +### Install the important dependencies +~~sudo apt install v4l2loopback-dkms~~ +``` +sudo apt install ffmpeg +``` + +### Install v4l2loopback +``` +git clone https://github.com/umlaeute/v4l2loopback.git +cd v4l2loopback +make +sudo su +make install +``` +``` +sudo depmod -a +``` +### Add Kernel Modules +``` +sudo modprobe v4l2loopback card_label="My Fake Webcam" exclusive_caps=1 +``` +### Link Video Stream To Fake Webcam +Find video feed in dev +``` +ls -1 /dev/video* +``` + +Next up, we need to “fake” our webcam feed with : +``` +ffmpeg -stream_loop -1 -re -i /path/to/video -vcodec rawvideo -threads 0 -f v4l2 /dev/videoX +``` + +### Remove the fake webcam streams +Once you are done with the fake stream, remove the previously loaded kernel modules with: + +`sudo modprobe --remove v4l2loopback` + +This should disable the fake webcam.