ffmpeg screen capture
Posted
by Mirai
on Stack Overflow
See other posts from Stack Overflow
or by Mirai
Published on 2010-05-23T18:52:57Z
Indexed on
2010/05/23
19:01 UTC
Read the original article
Hit count: 352
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
© Stack Overflow or respective owner