Skip to content

Instantly share code, notes, and snippets.

@furryablack
Last active December 15, 2023 04:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save furryablack/181edc9554a27f8138ce93a683760e40 to your computer and use it in GitHub Desktop.
Save furryablack/181edc9554a27f8138ce93a683760e40 to your computer and use it in GitHub Desktop.
Use your phone like a webcam in your linux env
# STEP 1
# Install deps
sudo apt install v4l2loopback-dkms
sudo apt install ffmpeg
# STEP 2
# Create fake webcam dummy device
# It will be used like a stream source in third-party programs like Zoom, Skype, etc
sudo modprobe v4l2loopback card_label="Fake Webcam" exclusive_caps=1
# STEP 3
# Get rtsp stream and forward it by deviceX into our dummy device which was created later
# rtsp://ip:port/h264_pcm.sdp - Look in IP Webcam stream's meta data
# /dev/videoX - Look in `ls -1 /dev/video*` list and take the last one
ffmpeg -stream_loop -1 -re -i rtsp://ip:port/h264_pcm.sdp -vcodec rawvideo -vsync 2 -threads 0 -f v4l2 /dev/videoX
@furryablack
Copy link
Author

Successfully tested with

  • Ubuntu 20.04.6 LTS
  • Zoom
  • IP Webcam (free un-pro version) for Android based device (xiaomi)

@furryablack
Copy link
Author

After STEP 3 you will have the Fake Webcam device in your devices list of your in third-party program (Zoom, etc)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment