ffmpeg screen capture
- by Mirai
I wrote this script for some basic screen capture; it gets the window dimensions then uses the ffmpeg binary to record. I suspect there is a better way (maybe with the ffmpeg library), but scripting is what I know and ffmpeg generally works.
Any software (other than recordmydesktop), or improvements to the script are welcome.
info=`xwininfo -frame`
H=`echo "$info" | grep Height | sed -E "s/^.*: ([[:digit:]]+)$/\1/"`
W=`echo "$info" | grep Width | sed -E "s/^.*: ([[:digit:]]+)$/\1/"`
offset=:0.0+`echo "$info" | grep Corners | sed -E "s/^.*:[[:space:]]+\+([[:digit:]]+\+[[:digit:]]+)[[:space:]]+.+/\1/" | tr + ,`
/usr/local/bin/ffmpeg -f x11grab -s ${W}x${H} -r 45 -i $offset -sameq -f avi ~/videos/`date +%Y-%m-%d-%H%M%s`_vid &
echo $! > /tmp/$(basename $0)-$USER