Skip to content

Instantly share code, notes, and snippets.

Last active Sep 1, 2020
What would you like to do?
Streaming Magic

Streaming Magic

This gist contains cmd line streaming magic.

Create a virtual cam with the desktop as the input

For a 1280x1024 desktop:

sudo modprobe v4l2loopback devices=1

gst-launch-0.10 -v ximagesrc startx=0 starty=0 endx=1279 endy=1023 ! videoscale \
  ! ffmpegcolorspace ! "video/x-raw-yuv,width=1280,height=1024,framerate=10/1" \
  ! v4l2sink device=/dev/video1

# not working if encode to video4linux2 is missing
# avconv -f x11grab -r 15 -s 1280x720 -i :0.0+0,0 -vcodec rawvideo \
#   -pix_fmt yuv420p -threads 0 -f video4linux2 /dev/video1
# "Requested output format 'video4linux2' is not a suitable output format"

Other Inputs

static image, etc.:

Conference Systems

Call a conference room via cmd line and send your audio + video

simpleopal h323:<Number>@<IP> --rx-video --tx-video \
  --grabber "Integrated Camera" -s "Default"

using --grabber "#<Number>" indexed 1+ should work, too for video input.

to do: test to send a second stream with the desktop to share presentations, etc. Might be as simple as:

simpleopal h323:<Number>@<IP> --tx-video --grabber "#2" -S
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment