Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
creates a virtual webcam with ffmpeg and v4l2loopback
# WTFPL license
# You might need to change /dev/video2 to something different depending on what hardware you have plugged in
sudo modprobe v4l2loopback
echo "Enter the file path (no spaces):"
read filepath
echo starting stream...
ffmpeg -re -stream_loop -1 -i $filepath -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment