mediainfo 0.6.2 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Changelog +5 -0
- data/Manifest +1 -0
- data/README.markdown +1 -0
- data/Rakefile +3 -1
- data/index.html.template +9 -0
- data/lib/mediainfo.rb +268 -168
- data/lib/mediainfo/attr_readers.rb +26 -29
- data/mediainfo.gemspec +5 -5
- data/test/mediainfo_awaywego_test.rb +64 -67
- data/test/mediainfo_broken_embraces_test.rb +59 -62
- data/test/mediainfo_dinner_test.rb +64 -67
- data/test/mediainfo_hats_test.rb +58 -61
- data/test/mediainfo_multiple_streams_test.rb +516 -0
- data/test/mediainfo_omen_image_test.rb +42 -44
- data/test/mediainfo_test.rb +5 -0
- data/test/mediainfo_vimeo_test.rb +59 -62
- metadata +15 -5
@@ -59,125 +59,125 @@ class MediainfoOmenImageTest < ActiveSupport::TestCase
|
|
59
59
|
end
|
60
60
|
|
61
61
|
### VIDEO
|
62
|
-
|
62
|
+
=begin
|
63
63
|
test "video Format" do
|
64
|
-
assert_nil @info.
|
64
|
+
assert_nil @info.video.format
|
65
65
|
end
|
66
66
|
|
67
67
|
test "video format profile" do
|
68
|
-
assert_nil @info.
|
68
|
+
assert_nil @info.video.format_profile
|
69
69
|
end
|
70
70
|
|
71
71
|
test "video format settings CABAC" do
|
72
|
-
assert_nil @info.
|
72
|
+
assert_nil @info.video.format_settings_cabac
|
73
73
|
end
|
74
74
|
|
75
75
|
test "video format settings ReFrames" do
|
76
|
-
assert_nil @info.
|
76
|
+
assert_nil @info.video.format_settings_cabac
|
77
77
|
end
|
78
78
|
|
79
79
|
test "video Codec ID" do
|
80
|
-
assert_nil @info.
|
80
|
+
assert_nil @info.video.codec_id
|
81
81
|
end
|
82
82
|
|
83
83
|
test "video Duration" do
|
84
|
-
assert_nil @info.
|
84
|
+
assert_nil @info.video.duration
|
85
85
|
end
|
86
86
|
|
87
87
|
test "video Bit rate" do
|
88
|
-
assert_nil @info.
|
88
|
+
assert_nil @info.video.bit_rate
|
89
89
|
end
|
90
90
|
|
91
91
|
test "video bit rate mode" do
|
92
|
-
assert_nil @info.
|
92
|
+
assert_nil @info.video.bit_rate_mode
|
93
93
|
end
|
94
94
|
|
95
|
-
test "
|
96
|
-
assert_equal "480x336", @info.
|
95
|
+
test "frame size" do
|
96
|
+
assert_equal "480x336", @info.frame_size
|
97
97
|
end
|
98
98
|
|
99
99
|
test "video Width" do
|
100
|
-
assert_nil @info.
|
100
|
+
assert_nil @info.video.width
|
101
101
|
end
|
102
102
|
|
103
103
|
test "video Height" do
|
104
|
-
assert_nil @info.
|
104
|
+
assert_nil @info.video.height
|
105
105
|
end
|
106
106
|
|
107
107
|
test "video Display aspect ratio" do
|
108
|
-
assert_nil @info.
|
108
|
+
assert_nil @info.video.display_aspect_ratio
|
109
109
|
assert_nil @info.display_aspect_ratio
|
110
110
|
end
|
111
111
|
|
112
112
|
test "video Frame rate" do
|
113
|
-
assert_nil @info.
|
113
|
+
assert_nil @info.video.frame_rate
|
114
114
|
assert_nil @info.fps
|
115
115
|
assert_nil @info.framerate
|
116
116
|
end
|
117
117
|
|
118
118
|
test "video frame rate mode" do
|
119
|
-
assert_nil @info.
|
119
|
+
assert_nil @info.video.frame_rate_mode
|
120
120
|
end
|
121
121
|
|
122
122
|
test "video Resolution" do
|
123
|
-
assert_nil @info.
|
123
|
+
assert_nil @info.video.resolution
|
124
124
|
end
|
125
125
|
|
126
126
|
test "video colorimetry" do
|
127
|
-
assert_nil @info.
|
128
|
-
assert_nil @info.
|
127
|
+
assert_nil @info.video.colorimetry
|
128
|
+
assert_nil @info.video.colorspace
|
129
129
|
end
|
130
130
|
|
131
131
|
test "video Scan type" do
|
132
|
-
assert_nil @info.
|
132
|
+
assert_nil @info.video.scan_type
|
133
133
|
assert !@info.interlaced?
|
134
134
|
assert !@info.progressive?
|
135
135
|
end
|
136
136
|
|
137
137
|
test "video Bits/(Pixel*Frame)" do
|
138
|
-
assert_nil @info.
|
138
|
+
assert_nil @info.video.bits_pixel_frame
|
139
139
|
end
|
140
140
|
|
141
141
|
test "video Stream size" do
|
142
|
-
assert_nil @info.
|
142
|
+
assert_nil @info.video.stream_size
|
143
143
|
end
|
144
144
|
|
145
145
|
### AUDIO
|
146
146
|
|
147
147
|
test "audio Format" do
|
148
|
-
assert_nil @info.
|
148
|
+
assert_nil @info.audio.format
|
149
149
|
end
|
150
150
|
|
151
151
|
test "audio Format settings, Endianness" do
|
152
|
-
assert_nil @info.
|
152
|
+
assert_nil @info.audio.format_settings_endianness
|
153
153
|
end
|
154
154
|
|
155
155
|
test "audio Format settings, Sign" do
|
156
|
-
assert_nil @info.
|
156
|
+
assert_nil @info.audio.format_settings_sign
|
157
157
|
end
|
158
158
|
|
159
159
|
test "audio Codec ID" do
|
160
|
-
assert_nil @info.
|
160
|
+
assert_nil @info.audio.codec_id
|
161
161
|
end
|
162
162
|
|
163
163
|
test "audio Codec ID/Info" do
|
164
|
-
assert_nil @info.
|
164
|
+
assert_nil @info.audio.codec_info
|
165
165
|
end
|
166
166
|
|
167
167
|
test "audio Duration" do
|
168
|
-
assert_nil @info.
|
168
|
+
assert_nil @info.audio.duration
|
169
169
|
end
|
170
170
|
|
171
171
|
test "audio Bit rate mode" do
|
172
|
-
assert_nil @info.
|
172
|
+
assert_nil @info.audio.bit_rate_mode
|
173
173
|
end
|
174
174
|
|
175
175
|
test "audio Bit rate" do
|
176
|
-
assert_nil @info.
|
176
|
+
assert_nil @info.audio.bit_rate
|
177
177
|
end
|
178
178
|
|
179
179
|
test "audio Channel(s)" do
|
180
|
-
assert_nil @info.
|
180
|
+
assert_nil @info.audio.channels
|
181
181
|
end
|
182
182
|
|
183
183
|
test "stereo?" do
|
@@ -189,46 +189,44 @@ class MediainfoOmenImageTest < ActiveSupport::TestCase
|
|
189
189
|
end
|
190
190
|
|
191
191
|
test "audio Sampling rate" do
|
192
|
-
assert_nil @info.
|
192
|
+
assert_nil @info.audio.sampling_rate
|
193
193
|
end
|
194
194
|
|
195
195
|
test "audio Resolution" do
|
196
|
-
assert_nil @info.
|
196
|
+
assert_nil @info.audio.resolution
|
197
197
|
end
|
198
198
|
|
199
199
|
test "audio Stream size" do
|
200
|
-
assert_nil @info.
|
200
|
+
assert_nil @info.audio.stream_size
|
201
201
|
end
|
202
202
|
|
203
203
|
test "audio Interleave, duration" do
|
204
|
-
assert_nil @info.
|
204
|
+
assert_nil @info.audio.interleave_duration
|
205
205
|
end
|
206
206
|
|
207
207
|
test "audio encoded date" do
|
208
|
-
assert_nil @info.
|
208
|
+
assert_nil @info.audio.encoded_date
|
209
209
|
end
|
210
210
|
|
211
211
|
test "audio tagged date" do
|
212
|
-
assert_nil @info.
|
212
|
+
assert_nil @info.audio.tagged_date
|
213
213
|
end
|
214
|
-
|
214
|
+
=end
|
215
215
|
### IMAGE
|
216
216
|
|
217
217
|
test "image format" do
|
218
|
-
assert_equal "JPEG", @info.
|
218
|
+
assert_equal "JPEG", @info.image.format
|
219
219
|
end
|
220
220
|
|
221
221
|
test "image width" do
|
222
|
-
assert_equal 480, @info.
|
223
|
-
assert_equal 480, @info.width
|
222
|
+
assert_equal 480, @info.image.width
|
224
223
|
end
|
225
224
|
|
226
225
|
test "image height" do
|
227
|
-
assert_equal 336, @info.
|
228
|
-
assert_equal 336, @info.height
|
226
|
+
assert_equal 336, @info.image.height
|
229
227
|
end
|
230
228
|
|
231
229
|
test "image resolution" do
|
232
|
-
assert_equal "24 bits", @info.
|
230
|
+
assert_equal "24 bits", @info.image.resolution
|
233
231
|
end
|
234
232
|
end
|
data/test/mediainfo_test.rb
CHANGED
@@ -28,7 +28,9 @@ class MediainfoTest < ActiveSupport::TestCase
|
|
28
28
|
:video_scan_type,
|
29
29
|
:video_resolution,
|
30
30
|
:video_colorimetry,
|
31
|
+
:video_standard,
|
31
32
|
:video_format,
|
33
|
+
:video_format_info,
|
32
34
|
:video_format_profile,
|
33
35
|
:video_format_version,
|
34
36
|
:video_format_settings_cabac,
|
@@ -62,8 +64,11 @@ class MediainfoTest < ActiveSupport::TestCase
|
|
62
64
|
:audio_resolution,
|
63
65
|
:audio_format,
|
64
66
|
:audio_format_info,
|
67
|
+
:audio_format_profile,
|
65
68
|
:audio_format_settings_endianness,
|
66
69
|
:audio_format_settings_sign,
|
70
|
+
:audio_format_settings_sbr,
|
71
|
+
:audio_format_version,
|
67
72
|
:audio_codec_id,
|
68
73
|
:audio_codec_id_hint,
|
69
74
|
:audio_codec_info,
|
@@ -62,201 +62,198 @@ class MediainfoVimeoTest < ActiveSupport::TestCase
|
|
62
62
|
### VIDEO
|
63
63
|
|
64
64
|
test "video stream id" do
|
65
|
-
assert_equal "0", @info.
|
65
|
+
assert_equal "0", @info.video.stream_id
|
66
66
|
end
|
67
67
|
|
68
68
|
test "video Format" do
|
69
|
-
assert_equal "M-JPEG", @info.
|
69
|
+
assert_equal "M-JPEG", @info.video.format
|
70
70
|
end
|
71
71
|
|
72
72
|
test "video format profile" do
|
73
|
-
assert_nil @info.
|
73
|
+
assert_nil @info.video.format_profile
|
74
74
|
end
|
75
75
|
|
76
76
|
test "video format version" do
|
77
|
-
assert_nil @info.
|
77
|
+
assert_nil @info.video.format_version
|
78
78
|
end
|
79
79
|
|
80
80
|
test "video format settings Matrix" do
|
81
|
-
assert_nil @info.
|
81
|
+
assert_nil @info.video.format_settings_matrix
|
82
82
|
end
|
83
83
|
|
84
84
|
test "video format settings CABAC" do
|
85
|
-
assert_nil @info.
|
85
|
+
assert_nil @info.video.format_settings_cabac
|
86
86
|
end
|
87
87
|
|
88
88
|
test "video format settings ReFrames" do
|
89
|
-
assert_nil @info.
|
89
|
+
assert_nil @info.video.format_settings_reframes
|
90
90
|
end
|
91
91
|
|
92
92
|
test "video Codec ID" do
|
93
|
-
assert_equal "MJPG", @info.
|
93
|
+
assert_equal "MJPG", @info.video.codec_id
|
94
94
|
end
|
95
95
|
|
96
96
|
test "video Duration" do
|
97
|
-
assert_equal 15164, @info.
|
98
|
-
assert_equal "15s 164ms", @info.
|
97
|
+
assert_equal 15164, @info.video.duration
|
98
|
+
assert_equal "15s 164ms", @info.video.duration_before_type_cast
|
99
99
|
end
|
100
100
|
|
101
101
|
test "video Bit rate" do
|
102
|
-
assert_equal "2 019 Kbps", @info.
|
102
|
+
assert_equal "2 019 Kbps", @info.video.bit_rate
|
103
103
|
end
|
104
104
|
|
105
105
|
test "video nominal bit rate" do
|
106
|
-
assert_nil @info.
|
106
|
+
assert_nil @info.video.nominal_bit_rate
|
107
107
|
end
|
108
108
|
|
109
109
|
test "video bit rate mode" do
|
110
|
-
assert_nil @info.
|
111
|
-
assert @info.vbr?
|
112
|
-
assert !@info.cbr?
|
110
|
+
assert_nil @info.video.bit_rate_mode
|
111
|
+
assert @info.video.vbr?
|
112
|
+
assert !@info.video.cbr?
|
113
113
|
end
|
114
114
|
|
115
|
-
test "
|
116
|
-
assert_equal "320x240", @info.
|
115
|
+
test "frame size" do
|
116
|
+
assert_equal "320x240", @info.video.frame_size
|
117
117
|
end
|
118
118
|
|
119
119
|
test "video Width" do
|
120
|
-
assert_equal 320, @info.
|
121
|
-
assert_equal 320, @info.width
|
120
|
+
assert_equal 320, @info.video.width
|
122
121
|
end
|
123
122
|
|
124
123
|
test "video Height" do
|
125
|
-
assert_equal 240, @info.
|
126
|
-
assert_equal 240, @info.height
|
124
|
+
assert_equal 240, @info.video.height
|
127
125
|
end
|
128
126
|
|
129
127
|
test "video Display aspect ratio" do
|
130
|
-
assert_equal "4:3", @info.
|
131
|
-
assert_equal "4:3", @info.display_aspect_ratio
|
128
|
+
assert_equal "4:3", @info.video.display_aspect_ratio
|
132
129
|
end
|
133
130
|
|
134
131
|
test "video frame rate" do
|
135
|
-
assert_equal "15.102 fps", @info.
|
136
|
-
assert_equal 15.102, @info.fps
|
137
|
-
assert_equal 15.102, @info.framerate
|
132
|
+
assert_equal "15.102 fps", @info.video.frame_rate
|
133
|
+
assert_equal 15.102, @info.video.fps
|
134
|
+
assert_equal 15.102, @info.video.framerate
|
138
135
|
end
|
139
136
|
|
140
137
|
test "video frame rate mode" do
|
141
|
-
assert_nil @info.
|
138
|
+
assert_nil @info.video.frame_rate_mode
|
142
139
|
end
|
143
140
|
|
144
141
|
test "video Resolution" do
|
145
|
-
assert_equal 24, @info.
|
146
|
-
assert_equal "24 bits", @info.
|
142
|
+
assert_equal 24, @info.video.resolution
|
143
|
+
assert_equal "24 bits", @info.video.resolution_before_type_cast
|
147
144
|
end
|
148
145
|
|
149
146
|
test "video colorimetry" do
|
150
|
-
assert_nil @info.
|
151
|
-
assert_nil @info.
|
147
|
+
assert_nil @info.video.colorimetry
|
148
|
+
assert_nil @info.video.colorspace
|
152
149
|
end
|
153
150
|
|
154
151
|
test "video Scan type" do
|
155
|
-
assert_equal "Progressive", @info.
|
156
|
-
assert !@info.interlaced?
|
157
|
-
assert @info.progressive?
|
152
|
+
assert_equal "Progressive", @info.video.scan_type
|
153
|
+
assert !@info.video.interlaced?
|
154
|
+
assert @info.video.progressive?
|
158
155
|
end
|
159
156
|
|
160
157
|
test "video scan order" do
|
161
|
-
assert_nil @info.
|
158
|
+
assert_nil @info.video.scan_order
|
162
159
|
end
|
163
160
|
|
164
161
|
test "video Bits/(Pixel*Frame)" do
|
165
|
-
assert_equal "1.741", @info.
|
162
|
+
assert_equal "1.741", @info.video.bits_pixel_frame
|
166
163
|
end
|
167
164
|
|
168
165
|
test "video Stream size" do
|
169
|
-
assert_equal "3.65 MiB (97%)", @info.
|
166
|
+
assert_equal "3.65 MiB (97%)", @info.video.stream_size
|
170
167
|
end
|
171
168
|
|
172
169
|
### AUDIO
|
173
170
|
|
174
171
|
test "audio stream id" do
|
175
|
-
assert_nil @info.
|
172
|
+
assert_nil @info.audio.stream_id
|
176
173
|
end
|
177
174
|
|
178
175
|
test "audio Format" do
|
179
|
-
assert_equal "ADPCM", @info.
|
176
|
+
assert_equal "ADPCM", @info.audio.format
|
180
177
|
end
|
181
178
|
|
182
179
|
test "audio format info" do
|
183
|
-
assert_nil @info.
|
180
|
+
assert_nil @info.audio.format_info
|
184
181
|
end
|
185
182
|
|
186
183
|
test "audio codec id hint" do
|
187
|
-
assert_equal "Intel", @info.
|
184
|
+
assert_equal "Intel", @info.audio.codec_id_hint
|
188
185
|
end
|
189
186
|
|
190
187
|
test "audio Format settings, Endianness" do
|
191
|
-
assert_nil @info.
|
188
|
+
assert_nil @info.audio.format_settings_endianness
|
192
189
|
end
|
193
190
|
|
194
191
|
test "audio Format settings, Sign" do
|
195
|
-
assert_nil @info.
|
192
|
+
assert_nil @info.audio.format_settings_sign
|
196
193
|
end
|
197
194
|
|
198
195
|
test "audio Codec ID" do
|
199
|
-
assert_equal "11", @info.
|
196
|
+
assert_equal "11", @info.audio.codec_id
|
200
197
|
end
|
201
198
|
|
202
199
|
test "audio Codec ID/Info" do
|
203
|
-
assert_nil @info.
|
200
|
+
assert_nil @info.audio.codec_info
|
204
201
|
end
|
205
202
|
|
206
203
|
test "audio Duration" do
|
207
|
-
assert_equal 15164, @info.
|
208
|
-
assert_equal "15s 164ms", @info.
|
204
|
+
assert_equal 15164, @info.audio.duration
|
205
|
+
assert_equal "15s 164ms", @info.audio.duration_before_type_cast
|
209
206
|
end
|
210
207
|
|
211
208
|
test "audio Bit rate mode" do
|
212
|
-
assert_equal "Constant", @info.
|
209
|
+
assert_equal "Constant", @info.audio.bit_rate_mode
|
213
210
|
end
|
214
211
|
|
215
212
|
test "audio Bit rate" do
|
216
|
-
assert_equal "44.1 Kbps", @info.
|
213
|
+
assert_equal "44.1 Kbps", @info.audio.bit_rate
|
217
214
|
end
|
218
215
|
|
219
216
|
test "audio Channel(s)" do
|
220
|
-
assert_equal 1, @info.
|
217
|
+
assert_equal 1, @info.audio.channels
|
221
218
|
end
|
222
219
|
|
223
220
|
test "audio channel positions" do
|
224
|
-
assert_nil @info.
|
221
|
+
assert_nil @info.audio.channel_positions
|
225
222
|
end
|
226
223
|
|
227
224
|
test "stereo?" do
|
228
|
-
assert !@info.stereo?
|
225
|
+
assert !@info.audio.stereo?
|
229
226
|
end
|
230
227
|
|
231
228
|
test "mono?" do
|
232
|
-
assert @info.mono?
|
229
|
+
assert @info.audio.mono?
|
233
230
|
end
|
234
231
|
|
235
232
|
test "audio Sampling rate" do
|
236
|
-
assert_equal 11025, @info.
|
237
|
-
assert_equal 11025, @info.
|
238
|
-
assert_equal "11.025 KHz", @info.
|
233
|
+
assert_equal 11025, @info.audio.sample_rate
|
234
|
+
assert_equal 11025, @info.audio.sampling_rate
|
235
|
+
assert_equal "11.025 KHz", @info.audio.sampling_rate_before_type_cast
|
239
236
|
end
|
240
237
|
|
241
238
|
test "audio resolution" do
|
242
|
-
assert_equal 4, @info.
|
243
|
-
assert_equal "4 bits", @info.
|
239
|
+
assert_equal 4, @info.audio.resolution
|
240
|
+
assert_equal "4 bits", @info.audio.resolution_before_type_cast
|
244
241
|
end
|
245
242
|
|
246
243
|
test "audio Stream size" do
|
247
|
-
assert_equal "82.8 KiB (2%)", @info.
|
244
|
+
assert_equal "82.8 KiB (2%)", @info.audio.stream_size
|
248
245
|
end
|
249
246
|
|
250
247
|
test "audio Interleave, duration" do
|
251
|
-
assert_equal "67 ms (1.00 video frame)", @info.
|
248
|
+
assert_equal "67 ms (1.00 video frame)", @info.audio.interleave_duration
|
252
249
|
end
|
253
250
|
|
254
251
|
test "audio encoded date" do
|
255
|
-
assert_nil @info.
|
252
|
+
assert_nil @info.audio.encoded_date
|
256
253
|
end
|
257
254
|
|
258
255
|
test "audio tagged date" do
|
259
|
-
assert_nil @info.
|
256
|
+
assert_nil @info.audio.tagged_date
|
260
257
|
end
|
261
258
|
|
262
259
|
### IMAGE
|