Skip to content

Instantly share code, notes, and snippets.

@mslinn
Last active December 18, 2015 05:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mslinn/5736500 to your computer and use it in GitHub Desktop.
Save mslinn/5736500 to your computer and use it in GitHub Desktop.
Linux bash script to capture desktop @ 1920x1080, 30 frames/second with stereo audio @ 44,100Hz
#!/bin/bash
if [ $# -ne 1 ]; then
echo "Usage: $(basename $0) outputName.mp4"
exit -1
fi
DIM=$(xwininfo -root | grep 'geometry' | awk '{print $2;}')
ffmpeg -f alsa -ac 2 -i hw:0,0 -f x11grab -s $DIM -r 30 -i :0.0 -sameq -f mpeg -ar 44100 -s hd1080 -y "$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment