streamio-ffmpeg 0.6.5 → 0.6.6
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +4 -0
- data/VERSION +1 -1
- data/lib/ffmpeg/transcoder.rb +12 -4
- data/spec/ffmpeg/transcoder_spec.rb +10 -0
- data/streamio-ffmpeg.gemspec +2 -2
- metadata +4 -4
data/CHANGELOG
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.6
|
data/lib/ffmpeg/transcoder.rb
CHANGED
@@ -64,10 +64,12 @@ module FFMPEG
|
|
64
64
|
return false
|
65
65
|
end
|
66
66
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
67
|
+
if validate_duration?
|
68
|
+
precision = 1.1
|
69
|
+
unless !(encoded.duration >= (@movie.duration * precision) or encoded.duration <= (@movie.duration / precision))
|
70
|
+
@errors << "encoded file duration differed from original (original: #{@movie.duration}sec, encoded: #{encoded.duration}sec)"
|
71
|
+
return false
|
72
|
+
end
|
71
73
|
end
|
72
74
|
|
73
75
|
true
|
@@ -91,5 +93,11 @@ module FFMPEG
|
|
91
93
|
@raw_options[:resolution] = "#{new_width}x#{@raw_options.height}"
|
92
94
|
end
|
93
95
|
end
|
96
|
+
|
97
|
+
def validate_duration?
|
98
|
+
return false if @movie.uncertain_duration?
|
99
|
+
return false if %w(.jpg .png).include?(File.extname(@output_file))
|
100
|
+
true
|
101
|
+
end
|
94
102
|
end
|
95
103
|
end
|
@@ -129,6 +129,16 @@ module FFMPEG
|
|
129
129
|
transcoder = Transcoder.new(movie, "#{tmp_path}/duration_fail.flv")
|
130
130
|
lambda { transcoder.run }.should_not raise_error(RuntimeError)
|
131
131
|
end
|
132
|
+
|
133
|
+
it "should be able to transcode to images" do
|
134
|
+
movie = Movie.new("#{fixture_path}/movies/awesome movie.mov")
|
135
|
+
|
136
|
+
encoded = Transcoder.new(movie, "#{tmp_path}/image.png", :custom => "-ss 00:00:03 -vframes 1 -f image2").run
|
137
|
+
encoded.resolution.should == "640x480"
|
138
|
+
|
139
|
+
encoded = Transcoder.new(movie, "#{tmp_path}/image.jpg", :custom => "-ss 00:00:03 -vframes 1 -f image2").run
|
140
|
+
encoded.resolution.should == "640x480"
|
141
|
+
end
|
132
142
|
end
|
133
143
|
end
|
134
144
|
end
|
data/streamio-ffmpeg.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{streamio-ffmpeg}
|
8
|
-
s.version = "0.6.
|
8
|
+
s.version = "0.6.6"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["David Backeus"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-06-10}
|
13
13
|
s.description = %q{Simple wrapper around ffmpeg to get metadata from movies and do transcoding}
|
14
14
|
s.email = %q{duztdruid@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: streamio-ffmpeg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
version: 0.6.
|
9
|
+
- 6
|
10
|
+
version: 0.6.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- David Backeus
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-06-10 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|