kakra-rvideo 0.9.6.3 → 0.9.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/rvideo/frame_capturer.rb +4 -2
- data/lib/rvideo/inspector.rb +12 -12
- data/lib/rvideo/tools/abstract_tool.rb +4 -4
- data/lib/rvideo/tools/ffmpeg.rb +9 -0
- data/rvideo.gemspec +3 -3
- data/spec/integrations/inspection_spec.rb +3 -3
- data/spec/units/abstract_tool_spec.rb +12 -0
- data/spec/units/frame_capturer_spec.rb +4 -4
- metadata +2 -2
|
@@ -50,7 +50,7 @@ module RVideo
|
|
|
50
50
|
|
|
51
51
|
@offset, @rate, @limit, @output = parse_options options
|
|
52
52
|
|
|
53
|
-
@command = "ffmpeg -i #{@input.shell_quoted} -ss #{@offset} -r #{@rate} #{@output.shell_quoted}"
|
|
53
|
+
@command = "ffmpeg -i #{@input.shell_quoted} -ss #{@offset} -r #{@rate} -f image2 -vframes 1 #{@output.shell_quoted}"
|
|
54
54
|
end
|
|
55
55
|
|
|
56
56
|
def capture!
|
|
@@ -58,7 +58,9 @@ module RVideo
|
|
|
58
58
|
frame_result = `#{@command} 2>&1`
|
|
59
59
|
RVideo.logger.info("\nScreenshot results: #{frame_result}")
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
# TODO: Fix
|
|
62
|
+
#Dir[File.expand_path(@output).sub("%d", "*")].entries
|
|
63
|
+
[@output]
|
|
62
64
|
end
|
|
63
65
|
|
|
64
66
|
VALID_TIMECODE_FORMAT = /\A([0-9.,]*)(s|f|%)?\Z/
|
data/lib/rvideo/inspector.rb
CHANGED
|
@@ -460,19 +460,19 @@ module RVideo # :nodoc:
|
|
|
460
460
|
# FIXME tbn/tbc may need braced alternatives, too: tb(n) / tb(c) - not tested
|
|
461
461
|
# not fixing as of yet because it renumbers backrefs
|
|
462
462
|
VIDEO_MATCH_PATTERN = /
|
|
463
|
-
Stream\s*(\#[\d.]+)(?:[\(\[].+?[\)\]])?\s*
|
|
464
|
-
[,:]\s*
|
|
465
|
-
(?:#{RATE}\s*#{FPS}[,:]\s*)?
|
|
466
|
-
Video:\s*
|
|
467
|
-
#{VAL}#{SEP}
|
|
468
|
-
(?:#{VAL}#{SEP})?
|
|
469
|
-
(\d+)x(\d+)#
|
|
470
|
-
|
|
463
|
+
Stream\s*(\#[\d.]+)(?:[\(\[].+?[\)\]])?\s* # stream id
|
|
464
|
+
[,:]\s*
|
|
465
|
+
(?:#{RATE}\s*#{FPS}[,:]\s*)? # frame rate, older builds
|
|
466
|
+
Video:\s*
|
|
467
|
+
#{VAL}#{SEP} # codec
|
|
468
|
+
(?:#{VAL}#{SEP})? # color space
|
|
469
|
+
(\d+)x(\d+) # resolution
|
|
470
|
+
(?:\s*\[?(?:PAR\s*(\d+:\d+))?\s*(?:DAR\s*(\d+:\d+))?\]?)? # pixel and display aspect ratios
|
|
471
471
|
#{SEP}?
|
|
472
|
-
(?:#{RATE}\s*(kb\/s)#{SEP}?)?
|
|
473
|
-
(?:#{RATE}\s*(?:
|
|
474
|
-
(?:#{RATE}\s*tbn#{SEP}?)?
|
|
475
|
-
(?:#{RATE}\s*tbc#{SEP}?)?
|
|
472
|
+
(?:#{RATE}\s*(kb\/s)#{SEP}?)? # video bit rate
|
|
473
|
+
(?:#{RATE}\s*(?:tb\(?r\)?|#{FPS})#{SEP}?)? # frame rate
|
|
474
|
+
(?:#{RATE}\s*tbn#{SEP}?)? # time base
|
|
475
|
+
(?:#{RATE}\s*tbc#{SEP}?)? # codec time base
|
|
476
476
|
/x
|
|
477
477
|
|
|
478
478
|
def video_match
|
|
@@ -60,10 +60,10 @@ module RVideo # :nodoc:
|
|
|
60
60
|
# nice the command if option :nice was given
|
|
61
61
|
# accepts a number 1..19 (nice value) or anything evaluating to true
|
|
62
62
|
unless RUBY_PLATFORM.downcase.include?("mswin")
|
|
63
|
-
if @options.has_key?
|
|
64
|
-
if (1..19) === @options[
|
|
65
|
-
final_command = "nice -n#{@options[
|
|
66
|
-
elsif @options[
|
|
63
|
+
if @options.has_key? 'nice'
|
|
64
|
+
if (1..19) === @options['nice']
|
|
65
|
+
final_command = "nice -n#{@options['nice']} #{final_command}"
|
|
66
|
+
elsif @options['nice']
|
|
67
67
|
final_command = "nice #{final_command}"
|
|
68
68
|
end
|
|
69
69
|
end
|
data/lib/rvideo/tools/ffmpeg.rb
CHANGED
|
@@ -120,6 +120,15 @@ module RVideo
|
|
|
120
120
|
"-ar #{params[:sample_rate]}"
|
|
121
121
|
end
|
|
122
122
|
|
|
123
|
+
def get_resolution
|
|
124
|
+
if @options['resolution'] && @options['resolution'].match(/(\d+)x(\d+)/)
|
|
125
|
+
options['width'] = $1
|
|
126
|
+
options['height'] = $2
|
|
127
|
+
get_specific_resolution
|
|
128
|
+
else
|
|
129
|
+
super
|
|
130
|
+
end
|
|
131
|
+
end
|
|
123
132
|
|
|
124
133
|
private
|
|
125
134
|
|
data/rvideo.gemspec
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Gem::Specification.new do |s|
|
|
4
4
|
s.name = %q{rvideo}
|
|
5
|
-
s.version = "0.9.6.
|
|
5
|
+
s.version = "0.9.6.6"
|
|
6
6
|
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
|
8
8
|
s.authors = ["Peter Boling, Jonathan Dahl (Slantwise Design), Seth Thomas Rasmussen, Kai Krakow"]
|
|
9
|
-
s.date = %q{2009-
|
|
9
|
+
s.date = %q{2009-05-16}
|
|
10
10
|
s.description = %q{Inspect and transcode video and audio files.}
|
|
11
11
|
s.email = %q{sethrasmussen@gmail.com}
|
|
12
12
|
s.extra_rdoc_files = ["CHANGELOG", "lib/rvideo/errors.rb", "lib/rvideo/float.rb", "lib/rvideo/frame_capturer.rb", "lib/rvideo/inspector.rb", "lib/rvideo/reporter/views/index.html.erb", "lib/rvideo/reporter/views/report.css", "lib/rvideo/reporter/views/report.html.erb", "lib/rvideo/reporter/views/report.js", "lib/rvideo/reporter.rb", "lib/rvideo/string.rb", "lib/rvideo/tools/abstract_tool.rb", "lib/rvideo/tools/ffmpeg.rb", "lib/rvideo/tools/ffmpeg2theora.rb", "lib/rvideo/tools/flvtool2.rb", "lib/rvideo/tools/mencoder.rb", "lib/rvideo/tools/mp4box.rb", "lib/rvideo/tools/mp4creator.rb", "lib/rvideo/tools/mplayer.rb", "lib/rvideo/tools/qtfaststart.rb", "lib/rvideo/tools/yamdi.rb", "lib/rvideo/transcoder.rb", "lib/rvideo/version.rb", "lib/rvideo.rb", "LICENSE", "README", "tasks/deployment.rake", "tasks/testing.rake", "tasks/transcoding.rake", "tasks/website.rake"]
|
|
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
|
|
|
16
16
|
s.rdoc_options = ["--quiet", "--title", "rvideo documentation", "--opname", "index.html", "--line-numbers", "--main", "README", "--inline-source"]
|
|
17
17
|
s.require_paths = ["lib"]
|
|
18
18
|
s.rubyforge_project = %q{rvideo}
|
|
19
|
-
s.rubygems_version = %q{1.3.
|
|
19
|
+
s.rubygems_version = %q{1.3.2}
|
|
20
20
|
s.summary = %q{Inspect and transcode video and audio files.}
|
|
21
21
|
|
|
22
22
|
if s.respond_to? :specification_version then
|
|
@@ -2,7 +2,7 @@ require File.dirname(__FILE__) + "/../spec_helper"
|
|
|
2
2
|
|
|
3
3
|
module RVideo
|
|
4
4
|
describe Inspector, "with boat.avi" do
|
|
5
|
-
|
|
5
|
+
before :each do
|
|
6
6
|
@i = Inspector.new :file => spec_file("boat.avi")
|
|
7
7
|
end
|
|
8
8
|
|
|
@@ -97,7 +97,7 @@ module RVideo
|
|
|
97
97
|
end
|
|
98
98
|
|
|
99
99
|
describe Inspector, "with kites.mp4" do
|
|
100
|
-
|
|
100
|
+
before :each do
|
|
101
101
|
@i = Inspector.new :file => spec_file("kites.mp4")
|
|
102
102
|
end
|
|
103
103
|
|
|
@@ -109,4 +109,4 @@ module RVideo
|
|
|
109
109
|
assert_equal "11:9", @i.display_aspect_ratio
|
|
110
110
|
end
|
|
111
111
|
end
|
|
112
|
-
end
|
|
112
|
+
end
|
|
@@ -57,6 +57,18 @@ module RVideo
|
|
|
57
57
|
it "should ignore extra options (not needed by the recipe)" do
|
|
58
58
|
Ffmpeg.new(@simple_avi, @options.merge(:foo => "bar"))
|
|
59
59
|
end
|
|
60
|
+
|
|
61
|
+
# FIXME This won't work here as final_command is not exposed to the testing framework and it will work different on mswin32 if not at all - needs fixing
|
|
62
|
+
#
|
|
63
|
+
#it "should be nice if given :nice => true" do
|
|
64
|
+
# ffmpeg = Ffmpeg.new(@simple_avi, @options.merge(:nice => true))
|
|
65
|
+
# ffmpeg.command.should == "nice ffmpeg -i '#{@options[:input_file]}' -ar 44100 -ab 64 -vcodec xvid -acodec mp3 -r 29.97 -y '#{@options[:output_file]}'"
|
|
66
|
+
#end
|
|
67
|
+
#
|
|
68
|
+
#it "should be nice if given an arbitrary :nice value" do
|
|
69
|
+
# ffmpeg = Ffmpeg.new(@simple_avi, @options.merge(:nice => 12))
|
|
70
|
+
# ffmpeg.command.should == "nice -n12 ffmpeg -i '#{@options[:input_file]}' -ar 44100 -ab 64 -vcodec xvid -acodec mp3 -r 29.97 -y '#{@options[:output_file]}'"
|
|
71
|
+
#end
|
|
60
72
|
|
|
61
73
|
it "should interpolate variables successfully" do
|
|
62
74
|
ffmpeg = Ffmpeg.new(@simple_avi, @options)
|
|
@@ -15,7 +15,7 @@ describe FrameCapturer, "calculating offset from a timecode argument" do
|
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
it "should calculate a timecode, when given a frame" do
|
|
18
|
-
@file.inspector.fps.should == "10
|
|
18
|
+
@file.inspector.fps.should == "10"
|
|
19
19
|
@file.calculate_time("10f").should be_close(1.0, 0.1)
|
|
20
20
|
@file.calculate_time("27.6f").should be_close(2.76, 0.1)
|
|
21
21
|
|
|
@@ -49,7 +49,7 @@ describe FrameCapturer, "calculating offset from a timecode argument" do
|
|
|
49
49
|
it "captures one frame at the start with no arguments" do
|
|
50
50
|
f = FrameCapturer.new :input => spec_file('kites.mp4')
|
|
51
51
|
assert_equal \
|
|
52
|
-
%{ffmpeg -i '#{f.input}' -ss 0 -r 1 '#{f.output}'},
|
|
52
|
+
%{ffmpeg -i '#{f.input}' -ss 0 -r 1 -f image2 -vframes 1 '#{f.output}'},
|
|
53
53
|
f.command
|
|
54
54
|
end
|
|
55
55
|
|
|
@@ -57,7 +57,7 @@ describe FrameCapturer, "calculating offset from a timecode argument" do
|
|
|
57
57
|
f = FrameCapturer.new :input => spec_file('kites.mp4'),
|
|
58
58
|
:offset => 10
|
|
59
59
|
assert_equal \
|
|
60
|
-
%{ffmpeg -i '#{f.input}' -ss 10.0 -r 1 '#{f.output}'},
|
|
60
|
+
%{ffmpeg -i '#{f.input}' -ss 10.0 -r 1 -f image2 -vframes 1 '#{f.output}'},
|
|
61
61
|
f.command
|
|
62
62
|
end
|
|
63
63
|
|
|
@@ -65,7 +65,7 @@ describe FrameCapturer, "calculating offset from a timecode argument" do
|
|
|
65
65
|
f = FrameCapturer.new :input => spec_file('kites.mp4'),
|
|
66
66
|
:interval => 5
|
|
67
67
|
assert_equal \
|
|
68
|
-
%{ffmpeg -i '#{f.input}' -ss 0 -r 0.2 '#{f.output}'},
|
|
68
|
+
%{ffmpeg -i '#{f.input}' -ss 0 -r 0.2 -f image2 -vframes 1 '#{f.output}'},
|
|
69
69
|
f.command
|
|
70
70
|
end
|
|
71
71
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kakra-rvideo
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.9.6.
|
|
4
|
+
version: 0.9.6.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Peter Boling, Jonathan Dahl (Slantwise Design), Seth Thomas Rasmussen, Kai Krakow
|
|
@@ -9,7 +9,7 @@ autorequire:
|
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
11
|
|
|
12
|
-
date: 2009-
|
|
12
|
+
date: 2009-05-16 00:00:00 -07:00
|
|
13
13
|
default_executable:
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|