mediainfo 0.7.2 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,264 +0,0 @@
1
- require "test_helper"
2
- require "mediainfo_test_helper"
3
-
4
- class MediainfoBrokenEmbracesTest < ActiveSupport::TestCase
5
- def setup
6
- @info = mediainfo_mock "Broken Embraces_510_780_576x432.mp4"
7
- end
8
-
9
- ### GENERAL
10
-
11
- test "audio?" do
12
- assert @info.audio?
13
- end
14
-
15
- test "video?" do
16
- assert @info.video?
17
- end
18
-
19
- test "format" do
20
- assert_equal "MPEG-4", @info.format
21
- end
22
-
23
- test "format profile" do
24
- assert_equal "Base Media", @info.format_profile
25
- end
26
-
27
- test "codec id" do
28
- assert_equal "isom", @info.codec_id
29
- end
30
-
31
- mediainfo_test_size
32
-
33
- test "duration" do
34
- assert_equal 106000, @info.duration
35
- assert_equal "1mn 46s", @info.duration_before_type_cast
36
- end
37
-
38
- test "overall bitrate" do
39
- assert_equal "911 Kbps", @info.overall_bit_rate
40
- end
41
-
42
- test "encoded date" do
43
- assert_nil @info.encoded_date
44
- end
45
-
46
- test "tagged date" do
47
- assert_nil @info.tagged_date
48
- end
49
-
50
- test "writing application" do
51
- assert_equal "Lavf52.39.0", @info.writing_application
52
- end
53
-
54
- test "writing library" do
55
- assert_nil @info.writing_library
56
- end
57
-
58
- ### VIDEO
59
-
60
- test "video stream id" do
61
- assert_equal "1", @info.video.stream_id
62
- end
63
-
64
- test "video Format" do
65
- assert_equal "AVC", @info.video.format
66
- end
67
-
68
- test "video format version" do
69
- assert_nil @info.video.format_version
70
- end
71
-
72
- test "video format settings Matrix" do
73
- assert_nil @info.video.format_settings_matrix
74
- end
75
-
76
- test "video format profile" do
77
- assert_equal "High@L3.0", @info.video.format_profile
78
- end
79
-
80
- test "video format settings CABAC" do
81
- assert_equal "Yes", @info.video.format_settings_cabac
82
- end
83
-
84
- test "video format settings ReFrames" do
85
- assert_equal "4 frames", @info.video.format_settings_reframes
86
- end
87
-
88
- test "video Codec ID" do
89
- assert_equal "avc1", @info.video.codec_id
90
- end
91
-
92
- test "video codec info" do
93
- assert_equal "Advanced Video Coding", @info.video.codec_info
94
- end
95
-
96
- test "video Duration" do
97
- assert_equal 106000, @info.video.duration
98
- assert_equal "1mn 46s", @info.video.duration_before_type_cast
99
- end
100
-
101
- test "video bit rate mode" do
102
- assert_equal "Variable", @info.video.bit_rate_mode
103
- assert @info.video.vbr?
104
- assert !@info.video.cbr?
105
- end
106
-
107
- test "video Bit rate" do
108
- assert_equal "780 Kbps", @info.video.bit_rate
109
- end
110
-
111
- test "video nominal bit rate" do
112
- assert_nil @info.video.nominal_bit_rate
113
- end
114
-
115
- test "frame size" do
116
- assert_equal "576x432", @info.video.frame_size
117
- end
118
-
119
- test "video Width" do
120
- assert_equal 576, @info.video.width
121
- end
122
-
123
- test "video Height" do
124
- assert_equal 432, @info.video.height
125
- end
126
-
127
- test "video Display aspect ratio" do
128
- assert_equal "4:3", @info.video.display_aspect_ratio
129
- end
130
-
131
- test "video Frame rate" do
132
- assert_equal "23.976 fps", @info.video.frame_rate
133
- assert_equal 23.976, @info.video.fps
134
- assert_equal 23.976, @info.video.framerate
135
- end
136
-
137
- test "video frame rate mode" do
138
- assert_equal "Variable", @info.video.frame_rate_mode
139
- end
140
-
141
- test "video Resolution" do
142
- assert_equal 24, @info.video.resolution
143
- end
144
-
145
- test "video colorimetry" do
146
- assert_equal "4:2:0", @info.video.colorimetry
147
- assert_equal "4:2:0", @info.video.colorspace
148
- end
149
-
150
- test "video Scan type" do
151
- assert_equal "Progressive", @info.video.scan_type
152
- assert !@info.video.interlaced?
153
- assert @info.video.progressive?
154
- end
155
-
156
- test "video scan order" do
157
- assert_nil @info.video.scan_order
158
- end
159
-
160
- test "video Bits/(Pixel*Frame)" do
161
- assert_equal "0.131", @info.video.bits_pixel_frame
162
- end
163
-
164
- test "video Stream size" do
165
- assert_equal "9.84 MiB (85%)", @info.video.stream_size
166
- end
167
-
168
- test "video encoded date" do
169
- assert_nil @info.video.encoded_date
170
- end
171
-
172
- test "video tagged date" do
173
- assert_nil @info.video.tagged_date
174
- end
175
-
176
- ### AUDIO
177
-
178
- test "audio stream id" do
179
- assert_equal "2", @info.audio.stream_id
180
- end
181
-
182
- test "audio Format" do
183
- assert_equal "AAC", @info.audio.format
184
- end
185
-
186
- test "audio format info" do
187
- assert_equal "Advanced Audio Codec", @info.audio.format_info
188
- end
189
-
190
- test "audio Format settings, Endianness" do
191
- assert_nil @info.audio.format_settings_endianness
192
- end
193
-
194
- test "audio Format settings, Sign" do
195
- assert_nil @info.audio.format_settings_sign
196
- end
197
-
198
- test "audio Codec ID" do
199
- assert_equal "40", @info.audio.codec_id
200
- end
201
-
202
- test "audio Codec ID/Info" do
203
- assert_nil @info.audio.codec_info
204
- end
205
-
206
- test "audio Duration" do
207
- assert_equal 106000, @info.audio.duration
208
- assert_equal "1mn 46s", @info.audio.duration_before_type_cast
209
- end
210
-
211
- test "audio Bit rate mode" do
212
- assert_equal "Variable", @info.audio.bit_rate_mode
213
- end
214
-
215
- test "audio Bit rate" do
216
- assert_equal "128 Kbps", @info.audio.bit_rate
217
- end
218
-
219
- test "audio Channel(s)" do
220
- assert_equal 2, @info.audio.channels
221
- end
222
-
223
- test "audio channel positions" do
224
- assert_equal "L R", @info.audio.channel_positions
225
- end
226
-
227
- test "stereo?" do
228
- assert @info.audio.stereo?
229
- end
230
-
231
- test "mono?" do
232
- assert !@info.audio.mono?
233
- end
234
-
235
- test "audio Sampling rate" do
236
- assert_equal 44100, @info.audio.sample_rate
237
- assert_equal 44100, @info.audio.sampling_rate
238
- assert_equal "44.1 KHz", @info.audio.sampling_rate_before_type_cast
239
- end
240
-
241
- test "audio Resolution" do
242
- assert_equal 16, @info.audio.resolution
243
- end
244
-
245
- test "audio Stream size" do
246
- assert_equal "1.62 MiB (14%)", @info.audio.stream_size
247
- end
248
-
249
- test "audio Interleave, duration" do
250
- assert_nil @info.audio.interleave_duration
251
- end
252
-
253
- test "audio encoded date" do
254
- assert_nil @info.audio.encoded_date
255
- end
256
-
257
- test "audio tagged date" do
258
- assert_nil @info.audio.tagged_date
259
- end
260
-
261
- ### IMAGE
262
-
263
- mediainfo_test_not_an_image
264
- end
@@ -1,262 +0,0 @@
1
- require "test_helper"
2
- require "mediainfo_test_helper"
3
-
4
- class MediainfoDinnerTest < ActiveSupport::TestCase
5
- def setup
6
- @info = mediainfo_mock "dinner.3g2"
7
- end
8
-
9
- ### GENERAL
10
-
11
- test "audio?" do
12
- assert @info.audio?
13
- end
14
-
15
- test "video?" do
16
- assert @info.video?
17
- end
18
-
19
- test "format" do
20
- assert_equal "MPEG-4", @info.format
21
- end
22
-
23
- test "format profile" do
24
- assert_equal "3GPP Media Release 5", @info.format_profile
25
- end
26
-
27
- test "codec id" do
28
- assert_equal "3gp5", @info.codec_id
29
- end
30
-
31
- mediainfo_test_size
32
-
33
- test "duration" do
34
- assert_equal 216000, @info.duration
35
- assert_equal "3mn 36s", @info.duration_before_type_cast
36
- end
37
-
38
- test "overall bitrate" do
39
- assert_equal "241 Kbps", @info.overall_bit_rate
40
- end
41
-
42
- test "encoded date" do
43
- assert_nil @info.encoded_date
44
- end
45
-
46
- test "tagged date" do
47
- assert_nil @info.tagged_date
48
- end
49
-
50
- test "writing application" do
51
- assert_nil @info.writing_application
52
- end
53
-
54
- test "writing library" do
55
- assert_nil @info.writing_library
56
- end
57
-
58
- ### VIDEO
59
-
60
- test "video stream id" do
61
- assert_equal "1", @info.video.stream_id
62
- end
63
-
64
- test "video Format" do
65
- assert_equal "MPEG-4 Visual", @info.video.format
66
- end
67
-
68
- test "video format profile" do
69
- assert_equal "Simple@L3", @info.video.format_profile
70
- end
71
-
72
- test "video format version" do
73
- assert_nil @info.video.format_version
74
- end
75
-
76
- test "video format settings Matrix" do
77
- assert_equal "Default (H.263)", @info.video.format_settings_matrix
78
- end
79
-
80
- test "video format settings CABAC" do
81
- assert_nil @info.video.format_settings_cabac
82
- end
83
-
84
- test "video format settings ReFrames" do
85
- assert_nil @info.video.format_settings_reframes
86
- end
87
-
88
- test "video Codec ID" do
89
- assert_equal "20", @info.video.codec_id
90
- end
91
-
92
- test "video Duration" do
93
- assert_equal 216000, @info.video.duration
94
- assert_equal "3mn 36s", @info.video.duration_before_type_cast
95
- end
96
-
97
- test "video Bit rate" do
98
- assert_equal "219 Kbps", @info.video.bit_rate
99
- end
100
-
101
- test "video nominal bit rate" do
102
- assert_equal "23.0 Kbps", @info.video.nominal_bit_rate
103
- end
104
-
105
- test "video bit rate mode" do
106
- assert_equal "Constant", @info.video.bit_rate_mode
107
- assert !@info.video.vbr?
108
- assert @info.video.cbr?
109
- end
110
-
111
- test "frame size" do
112
- assert_equal "352x288", @info.video.frame_size
113
- end
114
-
115
- test "video Width" do
116
- assert_equal 352, @info.video.width
117
- end
118
-
119
- test "video Height" do
120
- assert_equal 288, @info.video.height
121
- end
122
-
123
- test "video Display aspect ratio" do
124
- assert_equal "1.222", @info.video.display_aspect_ratio
125
- end
126
-
127
- test "video frame rate" do
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
131
-
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
135
-
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
139
- end
140
-
141
- test "video frame rate mode" do
142
- assert_equal "Variable", @info.video.frame_rate_mode
143
- end
144
-
145
- test "video Resolution" do
146
- assert_equal 24, @info.video.resolution
147
- assert_equal "24 bits", @info.video.resolution_before_type_cast
148
- end
149
-
150
- test "video colorimetry" do
151
- assert_nil @info.video.colorimetry
152
- assert_nil @info.video.colorspace
153
- end
154
-
155
- test "video Scan type" do
156
- assert_equal "Progressive", @info.video.scan_type
157
- assert !@info.video.interlaced?
158
- assert @info.video.progressive?
159
- end
160
-
161
- test "video scan order" do
162
- assert_nil @info.video.scan_order
163
- end
164
-
165
- test "video Bits/(Pixel*Frame)" do
166
- assert_equal "0.145", @info.video.bits_pixel_frame
167
- end
168
-
169
- test "video Stream size" do
170
- assert_equal "5.64 MiB (91%)", @info.video.stream_size
171
- end
172
-
173
- ### AUDIO
174
-
175
- test "audio stream id" do
176
- assert_equal "2", @info.audio.stream_id
177
- end
178
-
179
- test "audio Format" do
180
- assert_equal "QCELP", @info.audio.format
181
- end
182
-
183
- test "audio format info" do
184
- assert_nil @info.audio.format_info
185
- end
186
-
187
- test "audio Format settings, Endianness" do
188
- assert_nil @info.audio.format_settings_endianness
189
- end
190
-
191
- test "audio Format settings, Sign" do
192
- assert_nil @info.audio.format_settings_sign
193
- end
194
-
195
- test "audio Codec ID" do
196
- assert_equal "E1", @info.audio.codec_id
197
- end
198
-
199
- test "audio Codec ID/Info" do
200
- assert_nil @info.audio.codec_info
201
- end
202
-
203
- test "audio Duration" do
204
- assert_equal 216000, @info.audio.duration
205
- assert_equal "3mn 36s", @info.audio.duration_before_type_cast
206
- end
207
-
208
- test "audio Bit rate mode" do
209
- assert_equal "Constant", @info.audio.bit_rate_mode
210
- end
211
-
212
- test "audio Bit rate" do
213
- assert_equal "14.0 Kbps", @info.audio.bit_rate
214
- end
215
-
216
- test "audio Channel(s)" do
217
- assert_equal 1, @info.audio.channels
218
- end
219
-
220
- test "audio channel positions" do
221
- assert_nil @info.audio.channel_positions
222
- end
223
-
224
- test "stereo?" do
225
- assert !@info.audio.stereo?
226
- end
227
-
228
- test "mono?" do
229
- assert @info.audio.mono?
230
- end
231
-
232
- test "audio Sampling rate" do
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
236
- end
237
-
238
- test "audio resolution" do
239
- assert_equal 16, @info.audio.resolution
240
- assert_equal "16 bits", @info.audio.resolution_before_type_cast
241
- end
242
-
243
- test "audio Stream size" do
244
- assert_equal "369 KiB (6%)", @info.audio.stream_size
245
- end
246
-
247
- test "audio Interleave, duration" do
248
- assert_nil @info.audio.interleave_duration
249
- end
250
-
251
- test "audio encoded date" do
252
- assert_nil @info.audio.encoded_date
253
- end
254
-
255
- test "audio tagged date" do
256
- assert_nil @info.audio.tagged_date
257
- end
258
-
259
- ### IMAGE
260
-
261
- mediainfo_test_not_an_image
262
- end