Skip to content

Instantly share code, notes, and snippets.

@joshmarshall
Created March 26, 2012 02:47
Show Gist options
  • Save joshmarshall/2202561 to your computer and use it in GitHub Desktop.
Save joshmarshall/2202561 to your computer and use it in GitHub Desktop.
Streaming an Ubuntu Screen / Audio
#!/bin/sh
PORT="5544"
FRAMERATE="20"
VIDEO_SIZE="1280x720"
VIDEO_BITRATE="2000k"
AUDIO_BITRATE="512k"
AUDIO_FORMAT="mp2"
ffmpeg -f alsa -ac 2 -i pulse -acodec "$AUDIO_FORMAT" -ab "$AUDIO_BITRATE" \
-f x11grab -r "$FRAMERATE" -s 1600x900 -i :0.0 -vcodec mpeg2video -g 200 \
-s "$VIDEO_SIZE" -vb "$VIDEO_BITRATE" -r "$FRAMERATE" -f mpegts - | \
cvlc - --sout "#rtp{sdp=rtsp://:$PORT/stream}" --sout-keep
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment