Created
March 9, 2018 10:25
-
-
Save CyJimmy264/358bc3660501c19edf254b5b3b4d7119 to your computer and use it in GitHub Desktop.
Screenlapser with scrot and mencoder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
write_avi() { | |
mencoder -ovc x264 -mf w=1400:h=900:fps=20:type=jpg \ | |
"mf://@screenlapser-$atimeout.txt" \ | |
-o screenlapse-`date +%Y-%m-%d-%H-%M-%S`.avi | |
xargs rm < screenlapser-$atimeout.txt | |
rm screenlapser-$atimeout.txt | |
} | |
trap 'atimeout=$timeout; write_avi; trap - INT; kill -INT $$' INT | |
while true; do | |
timeout=`date -Ins --date "+1 hour"` | |
while [[ $shot < $timeout ]]; do | |
shot=`date -Ins` | |
scrot -q 30 $shot.jpg | |
echo $shot.jpg >> screenlapser-$timeout.txt | |
sleep 0.333 | |
done | |
atimeout=$timeout | |
write_avi & | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment