mediainfo 0.6.2 → 0.7.0
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/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
@@ -58,205 +58,202 @@ class MediainfoDinnerTest < ActiveSupport::TestCase
|
|
58
58
|
### VIDEO
|
59
59
|
|
60
60
|
test "video stream id" do
|
61
|
-
assert_equal "1", @info.
|
61
|
+
assert_equal "1", @info.video.stream_id
|
62
62
|
end
|
63
63
|
|
64
64
|
test "video Format" do
|
65
|
-
assert_equal "MPEG-4 Visual", @info.
|
65
|
+
assert_equal "MPEG-4 Visual", @info.video.format
|
66
66
|
end
|
67
67
|
|
68
68
|
test "video format profile" do
|
69
|
-
assert_equal "Simple@L3", @info.
|
69
|
+
assert_equal "Simple@L3", @info.video.format_profile
|
70
70
|
end
|
71
71
|
|
72
72
|
test "video format version" do
|
73
|
-
assert_nil @info.
|
73
|
+
assert_nil @info.video.format_version
|
74
74
|
end
|
75
75
|
|
76
76
|
test "video format settings Matrix" do
|
77
|
-
assert_equal "Default (H.263)", @info.
|
77
|
+
assert_equal "Default (H.263)", @info.video.format_settings_matrix
|
78
78
|
end
|
79
79
|
|
80
80
|
test "video format settings CABAC" do
|
81
|
-
assert_nil @info.
|
81
|
+
assert_nil @info.video.format_settings_cabac
|
82
82
|
end
|
83
83
|
|
84
84
|
test "video format settings ReFrames" do
|
85
|
-
assert_nil @info.
|
85
|
+
assert_nil @info.video.format_settings_reframes
|
86
86
|
end
|
87
87
|
|
88
88
|
test "video Codec ID" do
|
89
|
-
assert_equal "20", @info.
|
89
|
+
assert_equal "20", @info.video.codec_id
|
90
90
|
end
|
91
91
|
|
92
92
|
test "video Duration" do
|
93
|
-
assert_equal 216000, @info.
|
94
|
-
assert_equal "3mn 36s", @info.
|
93
|
+
assert_equal 216000, @info.video.duration
|
94
|
+
assert_equal "3mn 36s", @info.video.duration_before_type_cast
|
95
95
|
end
|
96
96
|
|
97
97
|
test "video Bit rate" do
|
98
|
-
assert_equal "219 Kbps", @info.
|
98
|
+
assert_equal "219 Kbps", @info.video.bit_rate
|
99
99
|
end
|
100
100
|
|
101
101
|
test "video nominal bit rate" do
|
102
|
-
assert_equal "23.0 Kbps", @info.
|
102
|
+
assert_equal "23.0 Kbps", @info.video.nominal_bit_rate
|
103
103
|
end
|
104
104
|
|
105
105
|
test "video bit rate mode" do
|
106
|
-
assert_equal "Constant", @info.
|
107
|
-
assert !@info.vbr?
|
108
|
-
assert @info.cbr?
|
106
|
+
assert_equal "Constant", @info.video.bit_rate_mode
|
107
|
+
assert !@info.video.vbr?
|
108
|
+
assert @info.video.cbr?
|
109
109
|
end
|
110
110
|
|
111
|
-
test "
|
112
|
-
assert_equal "352x288", @info.
|
111
|
+
test "frame size" do
|
112
|
+
assert_equal "352x288", @info.video.frame_size
|
113
113
|
end
|
114
114
|
|
115
115
|
test "video Width" do
|
116
|
-
assert_equal 352, @info.
|
117
|
-
assert_equal 352, @info.width
|
116
|
+
assert_equal 352, @info.video.width
|
118
117
|
end
|
119
118
|
|
120
119
|
test "video Height" do
|
121
|
-
assert_equal 288, @info.
|
122
|
-
assert_equal 288, @info.height
|
120
|
+
assert_equal 288, @info.video.height
|
123
121
|
end
|
124
122
|
|
125
123
|
test "video Display aspect ratio" do
|
126
|
-
assert_equal "1.222", @info.
|
127
|
-
assert_equal "1.222", @info.display_aspect_ratio
|
124
|
+
assert_equal "1.222", @info.video.display_aspect_ratio
|
128
125
|
end
|
129
126
|
|
130
127
|
test "video frame rate" do
|
131
|
-
assert_equal "14.875 fps", @info.
|
132
|
-
assert_equal 14.875, @info.fps
|
133
|
-
assert_equal 14.875, @info.framerate
|
128
|
+
assert_equal "14.875 fps", @info.video.frame_rate
|
129
|
+
assert_equal 14.875, @info.video.fps
|
130
|
+
assert_equal 14.875, @info.video.framerate
|
134
131
|
|
135
|
-
assert_equal "2.370 fps", @info.
|
136
|
-
assert_equal 2.370, @info.min_fps
|
137
|
-
assert_equal 2.370, @info.min_framerate
|
132
|
+
assert_equal "2.370 fps", @info.video.minimum_frame_rate
|
133
|
+
assert_equal 2.370, @info.video.min_fps
|
134
|
+
assert_equal 2.370, @info.video.min_framerate
|
138
135
|
|
139
|
-
assert_equal "27.778 fps", @info.
|
140
|
-
assert_equal 27.778, @info.max_fps
|
141
|
-
assert_equal 27.778, @info.max_framerate
|
136
|
+
assert_equal "27.778 fps", @info.video.maximum_frame_rate
|
137
|
+
assert_equal 27.778, @info.video.max_fps
|
138
|
+
assert_equal 27.778, @info.video.max_framerate
|
142
139
|
end
|
143
140
|
|
144
141
|
test "video frame rate mode" do
|
145
|
-
assert_equal "Variable", @info.
|
142
|
+
assert_equal "Variable", @info.video.frame_rate_mode
|
146
143
|
end
|
147
144
|
|
148
145
|
test "video Resolution" do
|
149
|
-
assert_equal 24, @info.
|
150
|
-
assert_equal "24 bits", @info.
|
146
|
+
assert_equal 24, @info.video.resolution
|
147
|
+
assert_equal "24 bits", @info.video.resolution_before_type_cast
|
151
148
|
end
|
152
149
|
|
153
150
|
test "video colorimetry" do
|
154
|
-
assert_nil @info.
|
155
|
-
assert_nil @info.
|
151
|
+
assert_nil @info.video.colorimetry
|
152
|
+
assert_nil @info.video.colorspace
|
156
153
|
end
|
157
154
|
|
158
155
|
test "video Scan type" do
|
159
|
-
assert_equal "Progressive", @info.
|
160
|
-
assert !@info.interlaced?
|
161
|
-
assert @info.progressive?
|
156
|
+
assert_equal "Progressive", @info.video.scan_type
|
157
|
+
assert !@info.video.interlaced?
|
158
|
+
assert @info.video.progressive?
|
162
159
|
end
|
163
160
|
|
164
161
|
test "video scan order" do
|
165
|
-
assert_nil @info.
|
162
|
+
assert_nil @info.video.scan_order
|
166
163
|
end
|
167
164
|
|
168
165
|
test "video Bits/(Pixel*Frame)" do
|
169
|
-
assert_equal "0.145", @info.
|
166
|
+
assert_equal "0.145", @info.video.bits_pixel_frame
|
170
167
|
end
|
171
168
|
|
172
169
|
test "video Stream size" do
|
173
|
-
assert_equal "5.64 MiB (91%)", @info.
|
170
|
+
assert_equal "5.64 MiB (91%)", @info.video.stream_size
|
174
171
|
end
|
175
172
|
|
176
173
|
### AUDIO
|
177
174
|
|
178
175
|
test "audio stream id" do
|
179
|
-
assert_equal "2", @info.
|
176
|
+
assert_equal "2", @info.audio.stream_id
|
180
177
|
end
|
181
178
|
|
182
179
|
test "audio Format" do
|
183
|
-
assert_equal "QCELP", @info.
|
180
|
+
assert_equal "QCELP", @info.audio.format
|
184
181
|
end
|
185
182
|
|
186
183
|
test "audio format info" do
|
187
|
-
assert_nil @info.
|
184
|
+
assert_nil @info.audio.format_info
|
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 "E1", @info.
|
196
|
+
assert_equal "E1", @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 216000, @info.
|
208
|
-
assert_equal "3mn 36s", @info.
|
204
|
+
assert_equal 216000, @info.audio.duration
|
205
|
+
assert_equal "3mn 36s", @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 "14.0 Kbps", @info.
|
213
|
+
assert_equal "14.0 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 8000, @info.
|
237
|
-
assert_equal 8000, @info.
|
238
|
-
assert_equal "8 000 Hz", @info.
|
233
|
+
assert_equal 8000, @info.audio.sample_rate
|
234
|
+
assert_equal 8000, @info.audio.sampling_rate
|
235
|
+
assert_equal "8 000 Hz", @info.audio.sampling_rate_before_type_cast
|
239
236
|
end
|
240
237
|
|
241
238
|
test "audio resolution" do
|
242
|
-
assert_equal 16, @info.
|
243
|
-
assert_equal "16 bits", @info.
|
239
|
+
assert_equal 16, @info.audio.resolution
|
240
|
+
assert_equal "16 bits", @info.audio.resolution_before_type_cast
|
244
241
|
end
|
245
242
|
|
246
243
|
test "audio Stream size" do
|
247
|
-
assert_equal "369 KiB (6%)", @info.
|
244
|
+
assert_equal "369 KiB (6%)", @info.audio.stream_size
|
248
245
|
end
|
249
246
|
|
250
247
|
test "audio Interleave, duration" do
|
251
|
-
assert_nil @info.
|
248
|
+
assert_nil @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
|
data/test/mediainfo_hats_test.rb
CHANGED
@@ -58,197 +58,194 @@ class MediainfoHatsTest < ActiveSupport::TestCase
|
|
58
58
|
### VIDEO
|
59
59
|
|
60
60
|
test "video stream id" do
|
61
|
-
assert_equal "1", @info.
|
61
|
+
assert_equal "1", @info.video.stream_id
|
62
62
|
end
|
63
63
|
|
64
64
|
test "video Format" do
|
65
|
-
assert_equal "AVC", @info.
|
65
|
+
assert_equal "AVC", @info.video.format
|
66
66
|
end
|
67
67
|
|
68
68
|
test "video format profile" do
|
69
|
-
assert_equal "Baseline@L1.0", @info.
|
69
|
+
assert_equal "Baseline@L1.0", @info.video.format_profile
|
70
70
|
end
|
71
71
|
|
72
72
|
test "video format version" do
|
73
|
-
assert_nil @info.
|
73
|
+
assert_nil @info.video.format_version
|
74
74
|
end
|
75
75
|
|
76
76
|
test "video format settings Matrix" do
|
77
|
-
assert_nil @info.
|
77
|
+
assert_nil @info.video.format_settings_matrix
|
78
78
|
end
|
79
79
|
|
80
80
|
test "video format settings CABAC" do
|
81
|
-
assert_equal "No", @info.
|
81
|
+
assert_equal "No", @info.video.format_settings_cabac
|
82
82
|
end
|
83
83
|
|
84
84
|
test "video format settings ReFrames" do
|
85
|
-
assert_equal "2 frames", @info.
|
85
|
+
assert_equal "2 frames", @info.video.format_settings_reframes
|
86
86
|
end
|
87
87
|
|
88
88
|
test "video Codec ID" do
|
89
|
-
assert_equal "avc1", @info.
|
89
|
+
assert_equal "avc1", @info.video.codec_id
|
90
90
|
end
|
91
91
|
|
92
92
|
test "video Duration" do
|
93
|
-
assert_equal 301000, @info.
|
94
|
-
assert_equal "5mn 1s", @info.
|
93
|
+
assert_equal 301000, @info.video.duration
|
94
|
+
assert_equal "5mn 1s", @info.video.duration_before_type_cast
|
95
95
|
end
|
96
96
|
|
97
97
|
test "video Bit rate" do
|
98
|
-
assert_equal "57.5 Kbps", @info.
|
98
|
+
assert_equal "57.5 Kbps", @info.video.bit_rate
|
99
99
|
end
|
100
100
|
|
101
101
|
test "video nominal bit rate" do
|
102
|
-
assert_nil @info.
|
102
|
+
assert_nil @info.video.nominal_bit_rate
|
103
103
|
end
|
104
104
|
|
105
105
|
test "video bit rate mode" do
|
106
|
-
assert_equal "Variable", @info.
|
107
|
-
assert @info.vbr?
|
108
|
-
assert !@info.cbr?
|
106
|
+
assert_equal "Variable", @info.video.bit_rate_mode
|
107
|
+
assert @info.video.vbr?
|
108
|
+
assert !@info.video.cbr?
|
109
109
|
end
|
110
110
|
|
111
|
-
test "
|
112
|
-
assert_equal "176x144", @info.
|
111
|
+
test "frame size" do
|
112
|
+
assert_equal "176x144", @info.video.frame_size
|
113
113
|
end
|
114
114
|
|
115
115
|
test "video Width" do
|
116
|
-
assert_equal 176, @info.
|
117
|
-
assert_equal 176, @info.width
|
116
|
+
assert_equal 176, @info.video.width
|
118
117
|
end
|
119
118
|
|
120
119
|
test "video Height" do
|
121
|
-
assert_equal 144, @info.
|
122
|
-
assert_equal 144, @info.height
|
120
|
+
assert_equal 144, @info.video.height
|
123
121
|
end
|
124
122
|
|
125
123
|
test "video Display aspect ratio" do
|
126
|
-
assert_equal "1.222", @info.
|
127
|
-
assert_equal "1.222", @info.display_aspect_ratio
|
124
|
+
assert_equal "1.222", @info.video.display_aspect_ratio
|
128
125
|
end
|
129
126
|
|
130
127
|
test "video frame rate" do
|
131
|
-
assert_equal "14.985 fps", @info.
|
132
|
-
assert_equal 14.985, @info.fps
|
133
|
-
assert_equal 14.985, @info.framerate
|
128
|
+
assert_equal "14.985 fps", @info.video.frame_rate
|
129
|
+
assert_equal 14.985, @info.video.fps
|
130
|
+
assert_equal 14.985, @info.video.framerate
|
134
131
|
end
|
135
132
|
|
136
133
|
test "video frame rate mode" do
|
137
|
-
assert_equal "Constant", @info.
|
134
|
+
assert_equal "Constant", @info.video.frame_rate_mode
|
138
135
|
end
|
139
136
|
|
140
137
|
test "video Resolution" do
|
141
|
-
assert_equal 24, @info.
|
142
|
-
assert_equal "24 bits", @info.
|
138
|
+
assert_equal 24, @info.video.resolution
|
139
|
+
assert_equal "24 bits", @info.video.resolution_before_type_cast
|
143
140
|
end
|
144
141
|
|
145
142
|
test "video colorimetry" do
|
146
|
-
assert_equal "4:2:0", @info.
|
147
|
-
assert_equal "4:2:0", @info.
|
143
|
+
assert_equal "4:2:0", @info.video.colorimetry
|
144
|
+
assert_equal "4:2:0", @info.video.colorspace
|
148
145
|
end
|
149
146
|
|
150
147
|
test "video Scan type" do
|
151
|
-
assert_equal "Progressive", @info.
|
152
|
-
assert !@info.interlaced?
|
153
|
-
assert @info.progressive?
|
148
|
+
assert_equal "Progressive", @info.video.scan_type
|
149
|
+
assert !@info.video.interlaced?
|
150
|
+
assert @info.video.progressive?
|
154
151
|
end
|
155
152
|
|
156
153
|
test "video scan order" do
|
157
|
-
assert_nil @info.
|
154
|
+
assert_nil @info.video.scan_order
|
158
155
|
end
|
159
156
|
|
160
157
|
test "video Bits/(Pixel*Frame)" do
|
161
|
-
assert_equal "0.152", @info.
|
158
|
+
assert_equal "0.152", @info.video.bits_pixel_frame
|
162
159
|
end
|
163
160
|
|
164
161
|
test "video Stream size" do
|
165
|
-
assert_equal "2.07 MiB (69%)", @info.
|
162
|
+
assert_equal "2.07 MiB (69%)", @info.video.stream_size
|
166
163
|
end
|
167
164
|
|
168
165
|
### AUDIO
|
169
166
|
|
170
167
|
test "audio stream id" do
|
171
|
-
assert_equal "2", @info.
|
168
|
+
assert_equal "2", @info.audio.stream_id
|
172
169
|
end
|
173
170
|
|
174
171
|
test "audio Format" do
|
175
|
-
assert_equal "AAC", @info.
|
172
|
+
assert_equal "AAC", @info.audio.format
|
176
173
|
end
|
177
174
|
|
178
175
|
test "audio format info" do
|
179
|
-
assert_equal "Advanced Audio Codec", @info.
|
176
|
+
assert_equal "Advanced Audio Codec", @info.audio.format_info
|
180
177
|
end
|
181
178
|
|
182
179
|
test "audio Format settings, Endianness" do
|
183
|
-
assert_nil @info.
|
180
|
+
assert_nil @info.audio.format_settings_endianness
|
184
181
|
end
|
185
182
|
|
186
183
|
test "audio Format settings, Sign" do
|
187
|
-
assert_nil @info.
|
184
|
+
assert_nil @info.audio.format_settings_sign
|
188
185
|
end
|
189
186
|
|
190
187
|
test "audio Codec ID" do
|
191
|
-
assert_equal "40", @info.
|
188
|
+
assert_equal "40", @info.audio.codec_id
|
192
189
|
end
|
193
190
|
|
194
191
|
test "audio Codec ID/Info" do
|
195
|
-
assert_nil @info.
|
192
|
+
assert_nil @info.audio.codec_info
|
196
193
|
end
|
197
194
|
|
198
195
|
test "audio Duration" do
|
199
|
-
assert_equal 298000, @info.
|
200
|
-
assert_equal "4mn 58s", @info.
|
196
|
+
assert_equal 298000, @info.audio.duration
|
197
|
+
assert_equal "4mn 58s", @info.audio.duration_before_type_cast
|
201
198
|
end
|
202
199
|
|
203
200
|
test "audio Bit rate mode" do
|
204
|
-
assert_equal "Constant", @info.
|
201
|
+
assert_equal "Constant", @info.audio.bit_rate_mode
|
205
202
|
end
|
206
203
|
|
207
204
|
test "audio Bit rate" do
|
208
|
-
assert_equal "24.0 Kbps", @info.
|
205
|
+
assert_equal "24.0 Kbps", @info.audio.bit_rate
|
209
206
|
end
|
210
207
|
|
211
208
|
test "audio Channel(s)" do
|
212
|
-
assert_equal 1, @info.
|
209
|
+
assert_equal 1, @info.audio.channels
|
213
210
|
end
|
214
211
|
|
215
212
|
test "audio channel positions" do
|
216
|
-
assert_equal "C", @info.
|
213
|
+
assert_equal "C", @info.audio.channel_positions
|
217
214
|
end
|
218
215
|
|
219
216
|
test "stereo?" do
|
220
|
-
assert !@info.stereo?
|
217
|
+
assert !@info.audio.stereo?
|
221
218
|
end
|
222
219
|
|
223
220
|
test "mono?" do
|
224
|
-
assert @info.mono?
|
221
|
+
assert @info.audio.mono?
|
225
222
|
end
|
226
223
|
|
227
224
|
test "audio Sampling rate" do
|
228
|
-
assert_equal 16000, @info.
|
229
|
-
assert_equal 16000, @info.
|
230
|
-
assert_equal "16.0 KHz", @info.
|
225
|
+
assert_equal 16000, @info.audio.sample_rate
|
226
|
+
assert_equal 16000, @info.audio.sampling_rate
|
227
|
+
assert_equal "16.0 KHz", @info.audio.sampling_rate_before_type_cast
|
231
228
|
end
|
232
229
|
|
233
230
|
test "audio resolution" do
|
234
|
-
assert_equal 16, @info.
|
235
|
-
assert_equal "16 bits", @info.
|
231
|
+
assert_equal 16, @info.audio.resolution
|
232
|
+
assert_equal "16 bits", @info.audio.resolution_before_type_cast
|
236
233
|
end
|
237
234
|
|
238
235
|
test "audio Stream size" do
|
239
|
-
assert_equal "877 KiB (29%)", @info.
|
236
|
+
assert_equal "877 KiB (29%)", @info.audio.stream_size
|
240
237
|
end
|
241
238
|
|
242
239
|
test "audio Interleave, duration" do
|
243
|
-
assert_nil @info.
|
240
|
+
assert_nil @info.audio.interleave_duration
|
244
241
|
end
|
245
242
|
|
246
243
|
test "audio encoded date" do
|
247
|
-
assert_kind_of Time, @info.
|
244
|
+
assert_kind_of Time, @info.audio.encoded_date
|
248
245
|
end
|
249
246
|
|
250
247
|
test "audio tagged date" do
|
251
|
-
assert_kind_of Time, @info.
|
248
|
+
assert_kind_of Time, @info.audio.tagged_date
|
252
249
|
end
|
253
250
|
|
254
251
|
### IMAGE
|