├── capture-makemovie.sh ├── capture-preparemovie.sh ├── capture-screens.sh ├── LICENSE └── README.md /capture-makemovie.sh: -------------------------------------------------------------------------------- 1 | TEMPDIR=~/Downloads/screencaps_temp 2 | 3 | ffmpeg -start_number 1 -r 30 -i $TEMPDIR/%05d.jpg -vcodec libx264 -vb 20M ~/Downloads/screencaps.mp4 4 | -------------------------------------------------------------------------------- /capture-preparemovie.sh: -------------------------------------------------------------------------------- 1 | CAPDIR=~/Downloads/screencaps 2 | TEMPDIR=~/Downloads/screencaps_temp 3 | 4 | mkdir $TEMPDIR 5 | x=1; for i in $CAPDIR/*jpg; do counter=$(printf %05d $x); ln "$i" "$TEMPDIR/$counter.jpg"; x=$(($x+1)); done 6 | -------------------------------------------------------------------------------- /capture-screens.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | INTERVAL=1 4 | CAPDIR=~/Downloads/screencaps/ 5 | 6 | mkdir $CAPDIR 7 | cd $CAPDIR 8 | 9 | DATE=`date +%Y%m%d-%H%M%S` 10 | COUNTER=1000000000 11 | 12 | while true; do 13 | let COUNTER=COUNTER+1 14 | screencapture -Cm -t jpg -x "$DATE-$COUNTER.jpg" 15 | echo "saving screenshot to ~/Downloads/screencaps/$DATE-$COUNTER.jpg" 16 | sleep $INTERVAL 17 | done 18 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | timelapse-scripts 2 | ================= 3 | 4 | Bash scripts for making screen shot time lapse movies on OS X. 5 | 6 | # Screen Capture 7 | 8 | The script `capture-screens.sh` grabs the actual screen content. Open it in a text editor to change its settings. By default, it takes a JPG screenshot off the main screen every second and puts it into the folder Downloads/screencaps/. 9 | 10 | You can stop the capture process any time by hitting CTRL-c, and resume by just starting the script again. The naming convention of the capture files contain the timestamp at the moment of start, so at the end the movie frames will be in order. Because of this, you can also combine captured frames from different computers for example if you alternated between your laptop and your desktop. 11 | 12 | ## Caveat: please check that files are actually being produced in the target directory as the script is running. You don't want to discover, after you're done with everything, that nothing got recorded. 13 | 14 | # Preparing for Movie Generation 15 | 16 | After recording the time-lapse, it's time to generate a movie out of it. For this, you'll need the `ffmpeg` command-line tool. Most Macs should already have it, but if you don't you can just download it with Homebrew. 17 | 18 | The movie generation has two steps: first sorting through all the captured frames, and finally encoding the movie. Start the sorting operation by launching the script `capture-preparemovie.sh`. 19 | 20 | This will put a symbolic link to every frame into the folder ~/Downloads/screencaps_temp/. 21 | 22 | # Make the Movie 23 | 24 | To launch the encode, start the script `capture-makemovie.sh`. You'll see some updates on screen as the movie is being made. If you see any error messages, it's likely you have captured images with different sizes (for example, if they come from different computers) - in that case, put the differing frames away and encode them later into a second movie. 25 | 26 | At the end, a new movie file called ~/Downloads/screencaps.mp4 should appear. After a quick check that it came out OK you can delete the source folders `~/Downloads/screencaps/` and `~/Downloads/screencaps_temp/`. 27 | 28 | --------------------------------------------------------------------------------