Last active
December 15, 2023 04:30
-
-
Save furryablack/181edc9554a27f8138ce93a683760e40 to your computer and use it in GitHub Desktop.
Use your phone like a webcam in your linux env
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
After STEP 3 you will have the Fake Webcam device in your devices list of your in third-party program (Zoom, etc)