aboutsummaryrefslogtreecommitdiffstats
path: root/retrospect.rb
diff options
context:
space:
mode:
Diffstat (limited to 'retrospect.rb')
-rw-r--r--retrospect.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/retrospect.rb b/retrospect.rb
new file mode 100644
index 0000000..783037f
--- /dev/null
+++ b/retrospect.rb
@@ -0,0 +1,17 @@
+SECONDS = 10
+OUTPUT = "/tmp/movie.mov"
+BASEDIR = File.dirname(File.realpath(__FILE__))
+
+trap(:ALRM) {
+ fork do
+ system "#{BASEDIR}/ffmpeg", '-y', '-i', "/tmp/img_%d.jpg", OUTPUT
+ system "/usr/bin/open", OUTPUT
+ end
+}
+
+i = 0
+while true do
+ system "/usr/sbin/screencapture", '-t', 'jpg', "/tmp/img_#{i}.jpg"
+ i = i + 1
+ sleep 1
+end