Sha256: fb00a1228bb8bcbd7724e8fd3a3874c93586171113c1ab474e99399f05643941

Contents?: true

Size: 545 Bytes

Versions: 1

Compression:

Stored size: 545 Bytes

Contents

require 'spec_helper'
require 'thwomp'

module Thwomp

  describe Renderers::FFMPEG do

    let(:path) { File.expand_path("./spec/fixtures/test.flv") }

    it "creates a screenshot every second" do
      renderer = Renderers::FFMPEG.new(path)
      now = Time.now
      output_file = "#{Dir.tmpdir}/frame_#{now.to_i}_%d.png"
      cmd = "ffmpeg -i #{path} -f image2 -r 1 -vf scale=128:-1 #{output_file} &> /dev/null"

      Time.stub(:now).and_return(now)
      Command.should_receive(:exec).with(cmd)
      renderer.frames
    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
thwomp-0.1.0 spec/renderers/ffmpeg_spec.rb