streamio-ffmpeg 0.6.5 → 0.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/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.6.6 2010-06-10
2
+
3
+ * Transcodings to .jpg and .png will now work as they will skip duration validation.
4
+
1
5
  == 0.6.5 2010-05-19
2
6
 
3
7
  * Movie#size method to get file size.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.5
1
+ 0.6.6
@@ -64,10 +64,12 @@ module FFMPEG
64
64
  return false
65
65
  end
66
66
 
67
- precision = 1.1
68
- unless @movie.uncertain_duration? || !(encoded.duration >= (@movie.duration * precision) or encoded.duration <= (@movie.duration / precision))
69
- @errors << "encoded file duration differed from original (original: #{@movie.duration}sec, encoded: #{encoded.duration}sec)"
70
- return false
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
@@ -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.5"
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-05-19}
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: 13
4
+ hash: 11
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 5
10
- version: 0.6.5
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-05-19 00:00:00 +02:00
18
+ date: 2010-06-10 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency