Last active
August 29, 2015 14:07
-
-
Save NQNStudios/1b6205259700fb91e36d to your computer and use it in GitHub Desktop.
Contains helpful functions for using mencoder and Scrot on Linux for creating time lapses.
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
#!/bin/bash | |
# First argument: delay between time lapse screenshots (in seconds). Default=3 | |
DELAY=${1:-"3"} | |
echo "Press Ctrl+C to stop capturing time lapse screenshots." | |
while [ 1 ]; do | |
scrot -q 100 "$(date +%Y%m%d%H%M%S).jpg" | |
sleep $DELAY | |
done |
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
#!/bin/bash | |
FRAMES="*.jpg" | |
FILES="files.txt" | |
VIDEO="screenlapse.avi" | |
for FRAME in $FRAMES; do | |
rm "$FRAME" | |
done | |
if [ -e "$FILES" ]; then | |
rm "$FILES" | |
fi | |
if [ -e "$VIDEO" ]; then | |
rm "$VIDEO" | |
fi |
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
#!/bin/bash | |
# First two arguments (optional): width, height of video resolution | |
WIDTH=${1:-"1280"} | |
HEIGHT=${2:-"720"} | |
# Third argument (optional): FPS of output video | |
FPS=${3:-"20"} | |
ls -1tr *.jpg > files.txt | |
mencoder -ovc x264 -oac mp3lame -mf w=${WIDTH}:h=${HEIGHT}:fps=${FPS}:type=jpg 'mf://@files.txt' -o screenlapse.avi |
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
#!/bin/bash | |
FILES="files.txt" | |
VIDEO="screenlapse.avi" | |
if [ -e "$FILES" ]; then | |
rm "$FILES" | |
fi | |
if [ -e "$VIDEO" ]; then | |
rm "$VIDEO" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment