mediainfo 0.6.2 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -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.video_stream_id
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.video_format
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.video_format_profile
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.video_format_version
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.video_format_settings_matrix
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.video_format_settings_cabac
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.video_format_settings_reframes
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.video_codec_id
89
+ assert_equal "20", @info.video.codec_id
90
90
  end
91
91
 
92
92
  test "video Duration" do
93
- assert_equal 216000, @info.video_duration
94
- assert_equal "3mn 36s", @info.video_duration_before_type_cast
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.video_bit_rate
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.video_nominal_bit_rate
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.video_bit_rate_mode
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 "resolution" do
112
- assert_equal "352x288", @info.resolution
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.video_width
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.video_height
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.video_display_aspect_ratio
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.video_frame_rate
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.video_minimum_frame_rate
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.video_maximum_frame_rate
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.video_frame_rate_mode
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.video_resolution
150
- assert_equal "24 bits", @info.video_resolution_before_type_cast
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.video_colorimetry
155
- assert_nil @info.video_colorspace
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.video_scan_type
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.video_scan_order
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.video_bits_pixel_frame
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.video_stream_size
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.audio_stream_id
176
+ assert_equal "2", @info.audio.stream_id
180
177
  end
181
178
 
182
179
  test "audio Format" do
183
- assert_equal "QCELP", @info.audio_format
180
+ assert_equal "QCELP", @info.audio.format
184
181
  end
185
182
 
186
183
  test "audio format info" do
187
- assert_nil @info.audio_format_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.audio_format_settings_endianness
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.audio_format_settings_sign
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.audio_codec_id
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.audio_codec_info
200
+ assert_nil @info.audio.codec_info
204
201
  end
205
202
 
206
203
  test "audio Duration" do
207
- assert_equal 216000, @info.audio_duration
208
- assert_equal "3mn 36s", @info.audio_duration_before_type_cast
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.audio_bit_rate_mode
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.audio_bit_rate
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.audio_channels
217
+ assert_equal 1, @info.audio.channels
221
218
  end
222
219
 
223
220
  test "audio channel positions" do
224
- assert_nil @info.audio_channel_positions
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.audio_sample_rate
237
- assert_equal 8000, @info.audio_sampling_rate
238
- assert_equal "8 000 Hz", @info.audio_sampling_rate_before_type_cast
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.audio_resolution
243
- assert_equal "16 bits", @info.audio_resolution_before_type_cast
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.audio_stream_size
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.audio_interleave_duration
248
+ assert_nil @info.audio.interleave_duration
252
249
  end
253
250
 
254
251
  test "audio encoded date" do
255
- assert_nil @info.audio_encoded_date
252
+ assert_nil @info.audio.encoded_date
256
253
  end
257
254
 
258
255
  test "audio tagged date" do
259
- assert_nil @info.audio_tagged_date
256
+ assert_nil @info.audio.tagged_date
260
257
  end
261
258
 
262
259
  ### IMAGE
@@ -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.video_stream_id
61
+ assert_equal "1", @info.video.stream_id
62
62
  end
63
63
 
64
64
  test "video Format" do
65
- assert_equal "AVC", @info.video_format
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.video_format_profile
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.video_format_version
73
+ assert_nil @info.video.format_version
74
74
  end
75
75
 
76
76
  test "video format settings Matrix" do
77
- assert_nil @info.video_format_settings_matrix
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.video_format_settings_cabac
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.video_format_settings_reframes
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.video_codec_id
89
+ assert_equal "avc1", @info.video.codec_id
90
90
  end
91
91
 
92
92
  test "video Duration" do
93
- assert_equal 301000, @info.video_duration
94
- assert_equal "5mn 1s", @info.video_duration_before_type_cast
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.video_bit_rate
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.video_nominal_bit_rate
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.video_bit_rate_mode
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 "resolution" do
112
- assert_equal "176x144", @info.resolution
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.video_width
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.video_height
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.video_display_aspect_ratio
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.video_frame_rate
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.video_frame_rate_mode
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.video_resolution
142
- assert_equal "24 bits", @info.video_resolution_before_type_cast
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.video_colorimetry
147
- assert_equal "4:2:0", @info.video_colorspace
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.video_scan_type
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.video_scan_order
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.video_bits_pixel_frame
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.video_stream_size
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.audio_stream_id
168
+ assert_equal "2", @info.audio.stream_id
172
169
  end
173
170
 
174
171
  test "audio Format" do
175
- assert_equal "AAC", @info.audio_format
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.audio_format_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.audio_format_settings_endianness
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.audio_format_settings_sign
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.audio_codec_id
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.audio_codec_info
192
+ assert_nil @info.audio.codec_info
196
193
  end
197
194
 
198
195
  test "audio Duration" do
199
- assert_equal 298000, @info.audio_duration
200
- assert_equal "4mn 58s", @info.audio_duration_before_type_cast
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.audio_bit_rate_mode
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.audio_bit_rate
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.audio_channels
209
+ assert_equal 1, @info.audio.channels
213
210
  end
214
211
 
215
212
  test "audio channel positions" do
216
- assert_equal "C", @info.audio_channel_positions
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.audio_sample_rate
229
- assert_equal 16000, @info.audio_sampling_rate
230
- assert_equal "16.0 KHz", @info.audio_sampling_rate_before_type_cast
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.audio_resolution
235
- assert_equal "16 bits", @info.audio_resolution_before_type_cast
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.audio_stream_size
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.audio_interleave_duration
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.audio_encoded_date
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.audio_tagged_date
248
+ assert_kind_of Time, @info.audio.tagged_date
252
249
  end
253
250
 
254
251
  ### IMAGE