#!/usr/bin/env ruby
num_snaps = 5
time_int = Time.now.to_i
num_snaps.times do |i|
file="~/.gitshots/#{time_int}__#{i+1}_of_#{num_snaps}.jpg"
system "imagesnap -q #{file}"
end
exit 0
The problem with this code is it makes the camera go on and off successively, which creates a minimum delay between shots. It would be nicer to have finer control over the interval.
Picturesnap somehow supports sequences but there's no control to how long they should last (would require firing a background task), and snapshots get saved in the running directory (instead of based on the passed filename/path) which would require mving each file. Pull request could be a short and sweet free time project...
You're quite right. But we're still left with many problems stemmed from not having control on the sequence length and file names. I've tried it with a background task and the results are super flimsy. The time that the camera takes to be ready varies which then makes the number of files generated vary, sometimes the process is killed before imagesnap finished saving current file resulting in a corrupted image. And the file names outputted are really begging for some post-processing renaming.
Picturesnap somehow supports sequences but there's no control to how long they should last (would require firing a background task), and snapshots get saved in the running directory (instead of based on the passed filename/path) which would require mving each file. Pull request could be a short and sweet free time project...