one-k-rmov 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +6 -0
- data/Rakefile +1 -1
- data/lib/quicktime/track.rb +10 -0
- data/rmov.gemspec +1 -1
- data/spec/quicktime/hd_track_spec.rb +35 -6
- metadata +1 -1
data/CHANGELOG
CHANGED
data/Rakefile
CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
|
|
2
2
|
require 'rake'
|
3
3
|
require 'echoe'
|
4
4
|
|
5
|
-
Echoe.new('rmov', '0.2.
|
5
|
+
Echoe.new('rmov', '0.2.7') do |p|
|
6
6
|
p.summary = "Ruby wrapper for the QuickTime C API."
|
7
7
|
p.description = "Ruby wrapper for the QuickTime C API. Updates by 1K include exposing some movie properties such as codec and audio channel descriptions"
|
8
8
|
p.url = "http://github.com/one-k/rmov"
|
data/lib/quicktime/track.rb
CHANGED
@@ -27,5 +27,15 @@ module QuickTime
|
|
27
27
|
media_type == :text
|
28
28
|
end
|
29
29
|
|
30
|
+
# returns numerical value for aspect ratio. eg. 1.33333 is 4x3
|
31
|
+
def aspect_ratio
|
32
|
+
pix_num, pix_den = pixel_aspect_ratio
|
33
|
+
encoded_size = encoded_pixel_dimensions
|
34
|
+
aspect = (encoded_size[:width].to_f / encoded_size[:height].to_f) * (pix_num.to_f / pix_den.to_f)
|
35
|
+
return :widescreen if aspect == (16.0/9.0)
|
36
|
+
return :fullframe if aspect == (4.0/3.0)
|
37
|
+
:other
|
38
|
+
end
|
39
|
+
|
30
40
|
end
|
31
41
|
end
|
data/rmov.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{rmov}
|
5
|
-
s.version = "0.2.
|
5
|
+
s.version = "0.2.7"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Ryan Bates, with updates by 1K Studios, LLC"]
|
@@ -72,13 +72,18 @@ describe QuickTime::Track do
|
|
72
72
|
@track.encoded_pixel_dimensions.should == {:width => 720, :height => 480}
|
73
73
|
end
|
74
74
|
|
75
|
-
it "has display pixel size of
|
75
|
+
it "has display pixel size of 853x480" do
|
76
76
|
@track.display_pixel_dimensions.should == {:width => 853, :height => 480}
|
77
77
|
end
|
78
|
-
|
78
|
+
|
79
79
|
it "has aspect ratio of 1:0.84375" do
|
80
80
|
@track.pixel_aspect_ratio.should == [100000, 84375]
|
81
81
|
end
|
82
|
+
|
83
|
+
it "has aspect ratio" do
|
84
|
+
@track.aspect_ratio.should == :widescreen
|
85
|
+
end
|
86
|
+
|
82
87
|
end
|
83
88
|
|
84
89
|
describe "audio tracks" do
|
@@ -133,17 +138,41 @@ describe QuickTime::Track do
|
|
133
138
|
track = @movie.video_tracks.first
|
134
139
|
track.pixel_aspect_ratio.should == [1, 1]
|
135
140
|
end
|
141
|
+
|
142
|
+
it "has aspect ratio" do
|
143
|
+
track = @movie.video_tracks.first
|
144
|
+
track.aspect_ratio.should == :other
|
145
|
+
end
|
146
|
+
|
136
147
|
end
|
137
148
|
|
138
149
|
|
139
|
-
describe "SD2v2.mov
|
150
|
+
describe "SD2v2.mov" do
|
140
151
|
before(:each) do
|
141
152
|
@movie = QuickTime::Movie.open(File.dirname(__FILE__) + '/../fixtures/SD2v2.mov')
|
142
153
|
end
|
143
154
|
|
144
|
-
|
145
|
-
|
146
|
-
|
155
|
+
describe "video track" do
|
156
|
+
before(:each) do
|
157
|
+
@track = @movie.video_tracks.first
|
158
|
+
end
|
159
|
+
|
160
|
+
it "has video track aspect ratio of 100000:112500" do
|
161
|
+
@track.pixel_aspect_ratio.should == [100000, 112500]
|
162
|
+
end
|
163
|
+
|
164
|
+
it "has encoded pixel size" do
|
165
|
+
@track.encoded_pixel_dimensions.should == {:width => 720, :height => 480}
|
166
|
+
end
|
167
|
+
|
168
|
+
it "has display pixel size" do
|
169
|
+
@track.display_pixel_dimensions.should == {:width => 640, :height => 480}
|
170
|
+
end
|
171
|
+
|
172
|
+
it "has aspect ratio" do
|
173
|
+
@track.aspect_ratio.should == :fullframe
|
174
|
+
end
|
175
|
+
|
147
176
|
end
|
148
177
|
|
149
178
|
end
|