streamio-ffmpeg 0.7.1 → 0.7.2
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/CHANGELOG +5 -0
- data/VERSION +1 -1
- data/lib/ffmpeg/encoding_options.rb +4 -0
- data/lib/ffmpeg/movie.rb +1 -1
- data/lib/ffmpeg/transcoder.rb +4 -3
- data/spec/ffmpeg/encoding_options_spec.rb +4 -0
- data/spec/ffmpeg/transcoder_spec.rb +17 -0
- data/spec/{stremio-ffmpeg_spec.rb → streamio-ffmpeg_spec.rb} +0 -0
- data/streamio-ffmpeg.gemspec +4 -4
- metadata +6 -6
data/CHANGELOG
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.7.
|
1
|
+
0.7.2
|
data/lib/ffmpeg/movie.rb
CHANGED
@@ -28,7 +28,7 @@ module FFMPEG
|
|
28
28
|
|
29
29
|
if video_stream
|
30
30
|
@video_codec, @colorspace, resolution = video_stream.split(/\s?,\s?/)
|
31
|
-
@resolution = resolution.split(" ").first # get rid of [PAR 1:1 DAR 16:9]
|
31
|
+
@resolution = resolution.split(" ").first rescue nil # get rid of [PAR 1:1 DAR 16:9]
|
32
32
|
@dar = $1 if video_stream[/DAR (\d+:\d+)/]
|
33
33
|
end
|
34
34
|
|
data/lib/ffmpeg/transcoder.rb
CHANGED
@@ -65,9 +65,10 @@ module FFMPEG
|
|
65
65
|
end
|
66
66
|
|
67
67
|
if validate_duration?
|
68
|
-
precision = 1.1
|
69
|
-
|
70
|
-
|
68
|
+
precision = @raw_options[:duration] ? 1.5 : 1.1
|
69
|
+
desired_duration = @raw_options[:duration] && @raw_options[:duration] < @movie.duration ? @raw_options[:duration] : @movie.duration
|
70
|
+
if (encoded.duration >= (desired_duration * precision) or encoded.duration <= (desired_duration / precision))
|
71
|
+
@errors << "encoded file duration differed from original/specified duration (wanted: #{desired_duration}sec, got: #{encoded.duration}sec)"
|
71
72
|
return false
|
72
73
|
end
|
73
74
|
end
|
@@ -90,6 +90,10 @@ module FFMPEG
|
|
90
90
|
EncodingOptions.new(:threads => 2).to_s.should == "-threads 2"
|
91
91
|
end
|
92
92
|
|
93
|
+
it "should convert duration" do
|
94
|
+
EncodingOptions.new(:duration => 30).to_s.should == "-t 30"
|
95
|
+
end
|
96
|
+
|
93
97
|
it "should convert video preset" do
|
94
98
|
EncodingOptions.new(:video_preset => "max").to_s.should == "-vpre max"
|
95
99
|
end
|
@@ -139,6 +139,23 @@ module FFMPEG
|
|
139
139
|
encoded = Transcoder.new(movie, "#{tmp_path}/image.jpg", :custom => "-ss 00:00:03 -vframes 1 -f image2").run
|
140
140
|
encoded.resolution.should == "640x480"
|
141
141
|
end
|
142
|
+
|
143
|
+
it "should validate duration to the specified duration if given" do
|
144
|
+
movie = Movie.new("#{fixture_path}/movies/awesome movie.mov")
|
145
|
+
|
146
|
+
encoded = Transcoder.new(movie, "#{tmp_path}/durationalized.mp4", :duration => 2).run
|
147
|
+
|
148
|
+
encoded.duration.should >= 1.8
|
149
|
+
encoded.duration.should <= 2.2
|
150
|
+
end
|
151
|
+
|
152
|
+
it "should validate duration to original movies duration if duration specified to higher number than original" do
|
153
|
+
movie = Movie.new("#{fixture_path}/movies/awesome movie.mov")
|
154
|
+
|
155
|
+
expect {
|
156
|
+
Transcoder.new(movie, "#{tmp_path}/durationalized.mp4", :duration => 10).run
|
157
|
+
}.to_not raise_error
|
158
|
+
end
|
142
159
|
end
|
143
160
|
end
|
144
161
|
end
|
File without changes
|
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.7.
|
8
|
+
s.version = "0.7.2"
|
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-08-11}
|
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 = [
|
@@ -38,7 +38,7 @@ Gem::Specification.new do |s|
|
|
38
38
|
"spec/fixtures/sounds/napoleon.mp3",
|
39
39
|
"spec/spec.opts",
|
40
40
|
"spec/spec_helper.rb",
|
41
|
-
"spec/
|
41
|
+
"spec/streamio-ffmpeg_spec.rb",
|
42
42
|
"streamio-ffmpeg.gemspec"
|
43
43
|
]
|
44
44
|
s.homepage = %q{http://github.com/streamio/streamio-ffmpeg}
|
@@ -51,7 +51,7 @@ Gem::Specification.new do |s|
|
|
51
51
|
"spec/ffmpeg/movie_spec.rb",
|
52
52
|
"spec/ffmpeg/transcoder_spec.rb",
|
53
53
|
"spec/spec_helper.rb",
|
54
|
-
"spec/
|
54
|
+
"spec/streamio-ffmpeg_spec.rb"
|
55
55
|
]
|
56
56
|
|
57
57
|
if s.respond_to? :specification_version then
|
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: 7
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 7
|
9
|
-
-
|
10
|
-
version: 0.7.
|
9
|
+
- 2
|
10
|
+
version: 0.7.2
|
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-08-11 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -65,7 +65,7 @@ files:
|
|
65
65
|
- spec/fixtures/sounds/napoleon.mp3
|
66
66
|
- spec/spec.opts
|
67
67
|
- spec/spec_helper.rb
|
68
|
-
- spec/
|
68
|
+
- spec/streamio-ffmpeg_spec.rb
|
69
69
|
- streamio-ffmpeg.gemspec
|
70
70
|
has_rdoc: true
|
71
71
|
homepage: http://github.com/streamio/streamio-ffmpeg
|
@@ -106,4 +106,4 @@ test_files:
|
|
106
106
|
- spec/ffmpeg/movie_spec.rb
|
107
107
|
- spec/ffmpeg/transcoder_spec.rb
|
108
108
|
- spec/spec_helper.rb
|
109
|
-
- spec/
|
109
|
+
- spec/streamio-ffmpeg_spec.rb
|