class Tlapse::Video

Public Class Methods

new(opts) click to toggle source
# File lib/tlapse/video.rb, line 5
def initialize(opts)
  @size      = opts.fetch :size,      "1920x1080"
  @framerate = opts.fetch :framerate, "60"
  @codec     = opts.fetch :codec,     "libx264"
  @outfile   = opts.fetch :out,       "out.mkv"
end

Public Instance Methods

create!() click to toggle source
# File lib/tlapse/video.rb, line 23
def create!
  cmd = create_command
  puts cmd
  exec cmd
end
create_command() click to toggle source
# File lib/tlapse/video.rb, line 12
def create_command
  command = "ffmpeg"
  command += " -pattern_type glob"
  command += " -i '*.jpg'"
  command += " -s #{@size}"
  command += " -r #{@framerate}"
  command += " -vcodec #{@codec}"
  command += " #{@outfile}"
  command
end
outfile_exists?() click to toggle source
# File lib/tlapse/video.rb, line 29
def outfile_exists?
  File.exist? @outfile
end