Skip to content

Instantly share code, notes, and snippets.

@alcides
Created January 29, 2009 22:09
Show Gist options
  • Select an option

  • Save alcides/54800 to your computer and use it in GitHub Desktop.

Select an option

Save alcides/54800 to your computer and use it in GitHub Desktop.
Script to take a few screenshots of your Mac desktop and make a movie.
folder = "/Users/alcides/Desktop/timelapse"
puts "recording..."
1.upto 60 do
`screencapture -xC #{folder}/#{Time.now.strftime("%I-%M-%S")}.tiff`
sleep 30
end
puts "converting..."
`ls #{folder}`.split("\n").each do |i|
f = [folder,i].join("/")
n = f.sub "tiff","png"
`convert #{f} -resize 25% #{n}`
end
puts "removing originals"
`rm #{folder}/*.tiff`
`mencoder -ovc lavc -mf type=png:fps=30 -o movie.avi mf://#{folder}/*.png`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment