kakra-rvideo 0.9.6.2 → 0.9.6.3

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.
@@ -33,7 +33,7 @@ module RVideo # :nodoc:
33
33
  end
34
34
  end
35
35
 
36
- abstract_attribute_formatter :resolution, :fps,
36
+ abstract_attribute_formatter :resolution, :deinterlace, :fps,
37
37
  :video_bit_rate, :video_bit_rate_tolerance,
38
38
  :video_bit_rate_min, :video_bit_rate_max,
39
39
  :audio_channels, :audio_bit_rate, :audio_sample_rate
@@ -131,11 +131,19 @@ module RVideo # :nodoc:
131
131
 
132
132
  ###
133
133
  # Resolution
134
-
134
+
135
+ def deinterlace
136
+ format_deinterlace(get_deinterlace)
137
+ end
138
+
139
+ def get_deinterlace
140
+ { :deinterlace => @options['deinterlace'] ? true : false }
141
+ end
142
+
135
143
  def resolution
136
144
  format_resolution(get_resolution)
137
145
  end
138
-
146
+
139
147
  def get_resolution
140
148
  inspect_original if @original.nil?
141
149
 
@@ -156,7 +164,7 @@ module RVideo # :nodoc:
156
164
  end
157
165
  end
158
166
  end
159
-
167
+
160
168
  def get_fit_to_width_resolution
161
169
  w = @options['width']
162
170
 
@@ -51,6 +51,10 @@ module RVideo
51
51
  'ffmpeg'
52
52
  end
53
53
 
54
+ def format_deinterlace(params={})
55
+ params[:deinterlace] ? "-deinterlace" : ""
56
+ end
57
+
54
58
  def format_fps(params={})
55
59
  "-r #{params[:fps]}"
56
60
  end
data/rvideo.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{rvideo}
5
- s.version = "0.9.6.2"
5
+ s.version = "0.9.6.3"
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"]
@@ -1,6 +1,6 @@
1
1
  simple_flv: |
2
2
  ffmpeg -i $input_file$ -ar 22050 -ab 64 -f flv -r 29.97 -s $resolution$ -y $temp_file$
3
- flvtool2 -U $temp_file$ $output_file$
3
+ # flvtool2 -U $temp_file$ $output_file$
4
4
  simple_avi: |
5
5
  ffmpeg -i $input_file$ -ar 44100 -ab 64 -vcodec xvid -acodec mp3 -r 29.97 -s $resolution$ -y $output_file$
6
6
 
@@ -39,13 +39,13 @@ flash_700:
39
39
  command: |
40
40
  ffmpeg -y -i $input_file$ -f flv -b 700k -ab 80k -acodec libmp3lame -r 15 -ar 22050 -ac 2 -psnr -pass 1 -passlogfile $output_file$.log -s 480x360 $output_file$
41
41
  ffmpeg -y -i $input_file$ -f flv -b 700k -ab 80k -acodec libmp3lame -r 15 -ar 22050 -ac 2 -psnr -pass 2 -passlogfile $output_file$.log -s 480x360 $output_file$
42
- flvtool2 -U $output_file$
42
+ # flvtool2 -U $output_file$
43
43
  flash_300:
44
44
  extension: 'flv'
45
45
  command: |
46
46
  ffmpeg -y -i $input_file$ -f flv -b 300k -ab 64k -acodec libmp3lame -r 15 -ar 22050 -ac 2 -psnr -pass 1 -passlogfile $output_file$.log -s 320x240 $output_file$
47
47
  ffmpeg -y -i $input_file$ -f flv -b 300k -ab 64k -acodec libmp3lame -r 15 -ar 22050 -ac 2 -psnr -pass 2 -passlogfile $output_file$.log -s 320x240 $output_file$
48
- flvtool2 -U $output_file$
48
+ # flvtool2 -U $output_file$
49
49
  qt_500:
50
50
  extension: 'mov'
51
51
  command: |
@@ -81,13 +81,13 @@ module RVideo
81
81
  }.should raise_error(TranscoderError::ParameterError)
82
82
  end
83
83
 
84
- it "the should raise an error when a recipe includes a variable not supplied (2)" do
84
+ it "should raise an error when a recipe includes a variable not supplied (2)" do
85
85
  lambda {
86
86
  ffmpeg = Ffmpeg.new(@simple_avi + " $novar$", @options)
87
87
  }.should raise_error(TranscoderError::ParameterError)
88
88
  end
89
89
 
90
- it "the should not raise an error when a variable is supplied but nil" do
90
+ it "should not raise an error when a variable is supplied but nil" do
91
91
  ffmpeg = Ffmpeg.new(@simple_avi, @options.merge(:resolution => nil))
92
92
  ffmpeg.command.should == "ffmpeg -i '#{@options[:input_file]}' -ar 44100 -ab 64 -vcodec xvid -acodec mp3 -r 29.97 -y '#{@options[:output_file]}'"
93
93
  end
@@ -111,6 +111,18 @@ module RVideo
111
111
  ffmpeg = Ffmpeg.new("ffmpeg -i $input_file$ $video_bit_rate$ $video_bit_rate_min$ $video_bit_rate_max$ -y $output_file$", @options)
112
112
  ffmpeg.command.should == "ffmpeg -i '#{@options[:input_file]}' -b 666k -minrate 666k -maxrate 666k -y '#{@options[:output_file]}'"
113
113
  end
114
+
115
+ it "supports :deinterlace => true" do
116
+ @options.merge! :deinterlace => true
117
+ ffmpeg = Ffmpeg.new("ffmpeg -i $input_file$ $deinterlace$ -y $output_file$", @options)
118
+ ffmpeg.command.should == "ffmpeg -i '#{@options[:input_file]}' -deinterlace -y '#{@options[:output_file]}'"
119
+ end
120
+
121
+ it "handles :deinterlace => false correct" do
122
+ @options.merge! :deinterlace => false
123
+ ffmpeg = Ffmpeg.new("ffmpeg -i $input_file$ $deinterlace$ -y $output_file$", @options)
124
+ ffmpeg.command.should == "ffmpeg -i '#{@options[:input_file]}' -y '#{@options[:output_file]}'"
125
+ end
114
126
 
115
127
  ###
116
128
 
@@ -155,22 +167,20 @@ module RVideo
155
167
  ffmpeg = Ffmpeg.new("ffmpeg -i $input_file$ $video_quality$ -y $output_file$", @options)
156
168
  ffmpeg.command.should == "ffmpeg -i '#{@options[:input_file]}' -b 666k -crf 18 -flags +loop -cmp +sad -partitions +parti4x4+partp8x8+partb8x8 -flags2 +mixed_refs -me full -subq 6 -trellis 1 -refs 3 -bf 3 -b_strategy 1 -coder 1 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -y '#{@options[:output_file]}'"
157
169
  end
158
-
159
- # These appear unsupported..
160
- #
161
- # it 'should support passthrough height' do
162
- # options = {:input_file => spec_file("kites.mp4"), :output_file => "bar", :width => "640"}
163
- # command = "ffmpeg -i $input_file$ -ar 44100 -ab 64 -vcodec xvid -acodec libmp3lame -r 29.97 $resolution$ -y $output_file$"
164
- # ffmpeg = Ffmpeg.new(command, options)
165
- # ffmpeg.command.should == "ffmpeg -i '#{options[:input_file]}' -ar 44100 -ab 64 -vcodec xvid -acodec libmp3lame -r 29.97 -s 640x720 -y 'bar'"
166
- # end
167
- #
168
- # it 'should support passthrough width' do
169
- # options = {:input_file => spec_file("kites.mp4"), :output_file => "bar", :height => "360"}
170
- # command = "ffmpeg -i $input_file$ -ar 44100 -ab 64 -vcodec xvid -acodec libmp3lame -r 29.97 $resolution$ -y $output_file$"
171
- # ffmpeg = Ffmpeg.new(command, options)
172
- # ffmpeg.command.should == "ffmpeg -i '#{options[:input_file]}' -ar 44100 -ab 64 -vcodec xvid -acodec libmp3lame -r 29.97 -s 1280x360 -y 'bar'"
173
- # end
170
+
171
+ it "should support passthrough scaled and rounded height" do
172
+ options = {:input_file => spec_file("kites.mp4"), :output_file => "bar", :width => "640"}
173
+ command = "ffmpeg -i $input_file$ -ar 44100 -ab 64 -vcodec xvid -acodec libmp3lame -r 29.97 $resolution$ -y $output_file$"
174
+ ffmpeg = Ffmpeg.new(command, options)
175
+ ffmpeg.command.should == "ffmpeg -i '#{options[:input_file]}' -ar 44100 -ab 64 -vcodec xvid -acodec libmp3lame -r 29.97 -s 640x528 -y 'bar'"
176
+ end
177
+
178
+ it "should support passthrough scaled and rounded width" do
179
+ options = {:input_file => spec_file("kites.mp4"), :output_file => "bar", :height => "360"}
180
+ command = "ffmpeg -i $input_file$ -ar 44100 -ab 64 -vcodec xvid -acodec libmp3lame -r 29.97 $resolution$ -y $output_file$"
181
+ ffmpeg = Ffmpeg.new(command, options)
182
+ ffmpeg.command.should == "ffmpeg -i '#{options[:input_file]}' -ar 44100 -ab 64 -vcodec xvid -acodec libmp3lame -r 29.97 -s 448x360 -y 'bar'"
183
+ end
174
184
  end
175
185
 
176
186
  describe Ffmpeg, " when parsing a result" do
@@ -250,7 +260,7 @@ module RVideo
250
260
  end
251
261
 
252
262
  context Ffmpeg, "result parsing should raise an exception" do
253
- setup do
263
+ before do
254
264
  setup_ffmpeg_spec
255
265
  @results = load_fixture :ffmpeg_results
256
266
  end
@@ -51,7 +51,7 @@ module RVideo
51
51
 
52
52
  context Flvtool2, " result parsing should raise an exception" do
53
53
 
54
- setup do
54
+ before do
55
55
  setup_flvtool2_spec
56
56
  end
57
57
 
@@ -321,4 +321,4 @@ def setup_flvtool2_spec
321
321
  hasCuePoints: false
322
322
  width: 320
323
323
  ..."
324
- end
324
+ end
@@ -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.00"
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
 
@@ -69,4 +69,4 @@ describe FrameCapturer, "calculating offset from a timecode argument" do
69
69
  f.command
70
70
  end
71
71
  end
72
- end
72
+ end
@@ -46,7 +46,7 @@ module RVideo
46
46
 
47
47
  context Mencoder, " result parsing should raise an exception" do
48
48
 
49
- setup do
49
+ before do
50
50
  setup_mencoder_spec
51
51
  end
52
52
 
@@ -4991,4 +4991,4 @@ def setup_mencoder_spec
4991
4991
  Video stream: 413.233 kbit/s (51654 B/s) size: 8350481 bytes 161.661 secs 2429 frames
4992
4992
 
4993
4993
  Audio stream: 63.831 kbit/s (7978 B/s) size: 1291598 bytes 161.877 secs"
4994
- end
4994
+ 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.2
4
+ version: 0.9.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Boling, Jonathan Dahl (Slantwise Design), Seth Thomas Rasmussen, Kai Krakow