Advertisement
Guest User

time-lapse

a guest
May 14th, 2013
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.82 KB | None | 0 0
  1. #!/bin/sh
  2. #
  3. #  Imagemagick required
  4.  
  5. #  The ultimate destination for the shot.
  6. destination=/home/fathead/Pictures/Timelapse
  7. last_file=$(ls -tr | tail -1 | cut -c 1-5)
  8. new_file=`printf "%05d" $(($last_file+1))`
  9. filename=${new_file}.jpg
  10. jpg_qual=100
  11. delay_minutes=$((1))
  12. delay=$(($delay_minutes/60))
  13. width=$((1920))
  14. height=$((1080))
  15. while true ; do
  16.  
  17.   uvccapture -x"$width" -y"$height" -q"$jpg_qual" -o"$filename"
  18.  
  19.   # Image stamp it if `convert` is installed.
  20.  # if [ -e /usr/bin/convert ]; then
  21.  #    convert -font helvetica -fill black -draw "text 10, 280 '`date`'" "$tempfile"  "$tempfile"
  22.  # fi
  23.  
  24.   # Move it into position.
  25.  
  26. # /bin/mv "$tempfile" "$destination"
  27.  
  28.   # Pause
  29.   sleep "$delay";
  30. last_file=$(ls -tr | tail -1 | cut -c 1-5)
  31. new_file=`printf "%05d" $(($last_file+1))`
  32. filename=${new_file}.jpg
  33. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement