Skip to content

Instantly share code, notes, and snippets.

@aussielunix
Created May 1, 2012 05:13
Show Gist options
  • Save aussielunix/2565263 to your computer and use it in GitHub Desktop.
Save aussielunix/2565263 to your computer and use it in GitHub Desktop.
record my desktop
#!/bin/bash -e
if [ "$#" -eq 1 ]; then
SavePath=$1
else
SavePath=$(zenity --file-selection --save --confirm-overwrite --filename $HOME/personal/media/Videos/screencasts/incoming/ )
fi
echo "Saving video to $SavePath"
INFO=$(xwininfo -frame)
WIN_GEO=$(echo "$INFO"|grep -e "Height:" -e "Width:"|cut -d\: -f2|tr "\n" " "|awk '{print $1 "x" $2}')
WIN_POS=$(echo "$INFO"|grep "upper-left"|head -n 2|cut -d\: -f2|tr "\n" " "|awk '{print $1 "," $2}')
ffmpeg -f alsa -ac 2 -i hw:0,0 -f x11grab -s $WIN_GEO -r 15 -i :0.0+$WIN_POS -r 15 -acodec pcm_s16le -sameq "$SavePath"
echo "$WIN_GEO -i :0.0+$WIN_POS -acodec"
echo "$WIN_POS"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment