Skip to content

Instantly share code, notes, and snippets.

@Ecno92
Created April 24, 2017 07:37
Show Gist options
  • Save Ecno92/5aa5f906339b5d3d85f898163a5aaadd to your computer and use it in GitHub Desktop.
Save Ecno92/5aa5f906339b5d3d85f898163a5aaadd to your computer and use it in GitHub Desktop.
share-screen-as-webcam
#!/bin/bash
# Save this file in /usr/bin/local and make it executable.
# Once executed a webcam screen visualizing your desktop is available
# at /dev/video/video1
sudo modprobe v4l2loopback
ffmpeg -f x11grab -r 15 -s `xrandr --current | grep '*' | uniq | awk '{print $1}'` -i :1 -qscale 0 -vcodec rawvideo -threads 0 -vf scale=1280:720 -f v4l2 /dev/video1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment