Skip to content

Commit 05e728a

Browse files
committed
Add tests for extracting MP4 with large bitrates
Also added the test to `MP4PlaybackTest`. PiperOrigin-RevId: 459492188
1 parent 91f1777 commit 05e728a

File tree

9 files changed

+1427
-0
lines changed

9 files changed

+1427
-0
lines changed

libraries/exoplayer/src/test/java/androidx/media3/exoplayer/e2etest/Mp4PlaybackTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public static ImmutableList<String> mediaSamples() {
5757
"sample_eac3joc.mp4",
5858
"sample_fragmented.mp4",
5959
"sample_fragmented_seekable.mp4",
60+
"sample_fragmented_large_bitrates.mp4",
6061
"sample_fragmented_sei.mp4",
6162
"sample_mdat_too_long.mp4",
6263
"sample.mp4",

libraries/extractor/src/test/java/androidx/media3/extractor/mp4/FragmentedMp4ExtractorTest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,15 @@ public void samplePartiallyFragmented() throws Exception {
122122
simulationConfig);
123123
}
124124

125+
/** https://github.com/google/ExoPlayer/issues/10381 */
126+
@Test
127+
public void sampleWithLargeBitrates() throws Exception {
128+
ExtractorAsserts.assertBehavior(
129+
getExtractorFactory(ImmutableList.of()),
130+
"media/mp4/sample_fragmented_large_bitrates.mp4",
131+
simulationConfig);
132+
}
133+
125134
private static ExtractorFactory getExtractorFactory(final List<Format> closedCaptionFormats) {
126135
return () ->
127136
new FragmentedMp4Extractor(
Lines changed: 339 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,339 @@
1+
seekMap:
2+
isSeekable = true
3+
duration = 1067733
4+
getPosition(0) = [[timeUs=66733, position=1325]]
5+
getPosition(1) = [[timeUs=66733, position=1325]]
6+
getPosition(533866) = [[timeUs=66733, position=1325]]
7+
getPosition(1067733) = [[timeUs=66733, position=1325]]
8+
numberOfTracks = 2
9+
track 0:
10+
total output bytes = 85933
11+
sample count = 30
12+
format 0:
13+
id = 1
14+
sampleMimeType = video/avc
15+
codecs = avc1.64001F
16+
width = 1080
17+
height = 720
18+
initializationData:
19+
data = length 29, hash 4746B5D9
20+
data = length 10, hash 7A0D0F2B
21+
sample 0:
22+
time = 66733
23+
flags = 1
24+
data = length 38070, hash B58E1AEE
25+
sample 1:
26+
time = 200200
27+
flags = 0
28+
data = length 8340, hash 8AC449FF
29+
sample 2:
30+
time = 133466
31+
flags = 0
32+
data = length 1295, hash C0DA5090
33+
sample 3:
34+
time = 100100
35+
flags = 0
36+
data = length 469, hash D6E0A200
37+
sample 4:
38+
time = 166833
39+
flags = 0
40+
data = length 564, hash E5F56C5B
41+
sample 5:
42+
time = 333666
43+
flags = 0
44+
data = length 6075, hash 8756E49E
45+
sample 6:
46+
time = 266933
47+
flags = 0
48+
data = length 847, hash DCC2B618
49+
sample 7:
50+
time = 233566
51+
flags = 0
52+
data = length 455, hash B9CCE047
53+
sample 8:
54+
time = 300300
55+
flags = 0
56+
data = length 467, hash 69806D94
57+
sample 9:
58+
time = 467133
59+
flags = 0
60+
data = length 4549, hash 3944F501
61+
sample 10:
62+
time = 400400
63+
flags = 0
64+
data = length 1087, hash 491BF106
65+
sample 11:
66+
time = 367033
67+
flags = 0
68+
data = length 380, hash 5FED016A
69+
sample 12:
70+
time = 433766
71+
flags = 0
72+
data = length 455, hash 8A0610
73+
sample 13:
74+
time = 600600
75+
flags = 0
76+
data = length 5190, hash B9031D8
77+
sample 14:
78+
time = 533866
79+
flags = 0
80+
data = length 1071, hash 684E7DC8
81+
sample 15:
82+
time = 500500
83+
flags = 0
84+
data = length 653, hash 8494F326
85+
sample 16:
86+
time = 567233
87+
flags = 0
88+
data = length 485, hash 2CCC85F4
89+
sample 17:
90+
time = 734066
91+
flags = 0
92+
data = length 4884, hash D16B6A96
93+
sample 18:
94+
time = 667333
95+
flags = 0
96+
data = length 997, hash 164FF210
97+
sample 19:
98+
time = 633966
99+
flags = 0
100+
data = length 640, hash F664125B
101+
sample 20:
102+
time = 700700
103+
flags = 0
104+
data = length 491, hash B5930C7C
105+
sample 21:
106+
time = 867533
107+
flags = 0
108+
data = length 2989, hash 92CF4FCF
109+
sample 22:
110+
time = 800800
111+
flags = 0
112+
data = length 838, hash 294A3451
113+
sample 23:
114+
time = 767433
115+
flags = 0
116+
data = length 544, hash FCCE2DE6
117+
sample 24:
118+
time = 834166
119+
flags = 0
120+
data = length 329, hash A654FFA1
121+
sample 25:
122+
time = 1001000
123+
flags = 0
124+
data = length 1517, hash 5F7EBF8B
125+
sample 26:
126+
time = 934266
127+
flags = 0
128+
data = length 803, hash 7A5C4C1D
129+
sample 27:
130+
time = 900900
131+
flags = 0
132+
data = length 415, hash B31BBC3B
133+
sample 28:
134+
time = 967633
135+
flags = 0
136+
data = length 415, hash 850DFEA3
137+
sample 29:
138+
time = 1034366
139+
flags = 0
140+
data = length 619, hash AB5E56CA
141+
track 1:
142+
total output bytes = 18257
143+
sample count = 46
144+
format 0:
145+
averageBitrate = 2147483647
146+
peakBitrate = 2147483647
147+
id = 2
148+
sampleMimeType = audio/mp4a-latm
149+
codecs = mp4a.40.2
150+
channelCount = 1
151+
sampleRate = 44100
152+
language = und
153+
initializationData:
154+
data = length 5, hash 2B7623A
155+
sample 0:
156+
time = 0
157+
flags = 1
158+
data = length 18, hash 96519432
159+
sample 1:
160+
time = 23219
161+
flags = 1
162+
data = length 4, hash EE9DF
163+
sample 2:
164+
time = 46439
165+
flags = 1
166+
data = length 4, hash EEDBF
167+
sample 3:
168+
time = 69659
169+
flags = 1
170+
data = length 157, hash E2F078F4
171+
sample 4:
172+
time = 92879
173+
flags = 1
174+
data = length 371, hash B9471F94
175+
sample 5:
176+
time = 116099
177+
flags = 1
178+
data = length 373, hash 2AB265CB
179+
sample 6:
180+
time = 139319
181+
flags = 1
182+
data = length 402, hash 1295477C
183+
sample 7:
184+
time = 162539
185+
flags = 1
186+
data = length 455, hash 2D8146C8
187+
sample 8:
188+
time = 185759
189+
flags = 1
190+
data = length 434, hash F2C5D287
191+
sample 9:
192+
time = 208979
193+
flags = 1
194+
data = length 450, hash 84143FCD
195+
sample 10:
196+
time = 232199
197+
flags = 1
198+
data = length 429, hash EF769D50
199+
sample 11:
200+
time = 255419
201+
flags = 1
202+
data = length 450, hash EC3DE692
203+
sample 12:
204+
time = 278639
205+
flags = 1
206+
data = length 447, hash 3E519E13
207+
sample 13:
208+
time = 301859
209+
flags = 1
210+
data = length 457, hash 1E4F23A0
211+
sample 14:
212+
time = 325079
213+
flags = 1
214+
data = length 447, hash A439EA97
215+
sample 15:
216+
time = 348299
217+
flags = 1
218+
data = length 456, hash 1E9034C6
219+
sample 16:
220+
time = 371519
221+
flags = 1
222+
data = length 398, hash 99DB7345
223+
sample 17:
224+
time = 394739
225+
flags = 1
226+
data = length 474, hash 3F05F10A
227+
sample 18:
228+
time = 417959
229+
flags = 1
230+
data = length 416, hash C105EE09
231+
sample 19:
232+
time = 441179
233+
flags = 1
234+
data = length 454, hash 5FDBE458
235+
sample 20:
236+
time = 464399
237+
flags = 1
238+
data = length 438, hash 41A93AC3
239+
sample 21:
240+
time = 487619
241+
flags = 1
242+
data = length 443, hash 10FDA652
243+
sample 22:
244+
time = 510839
245+
flags = 1
246+
data = length 412, hash 1F791E25
247+
sample 23:
248+
time = 534058
249+
flags = 1
250+
data = length 482, hash A6D983D
251+
sample 24:
252+
time = 557278
253+
flags = 1
254+
data = length 386, hash BED7392F
255+
sample 25:
256+
time = 580498
257+
flags = 1
258+
data = length 463, hash 5309F8C9
259+
sample 26:
260+
time = 603718
261+
flags = 1
262+
data = length 394, hash 21C7321F
263+
sample 27:
264+
time = 626938
265+
flags = 1
266+
data = length 489, hash 71B4730D
267+
sample 28:
268+
time = 650158
269+
flags = 1
270+
data = length 403, hash D9C6DE89
271+
sample 29:
272+
time = 673378
273+
flags = 1
274+
data = length 447, hash 9B14B73B
275+
sample 30:
276+
time = 696598
277+
flags = 1
278+
data = length 439, hash 4760D35B
279+
sample 31:
280+
time = 719818
281+
flags = 1
282+
data = length 463, hash 1601F88D
283+
sample 32:
284+
time = 743038
285+
flags = 1
286+
data = length 423, hash D4AE6773
287+
sample 33:
288+
time = 766258
289+
flags = 1
290+
data = length 497, hash A3C674D3
291+
sample 34:
292+
time = 789478
293+
flags = 1
294+
data = length 419, hash D3734A1F
295+
sample 35:
296+
time = 812698
297+
flags = 1
298+
data = length 474, hash DFB41F9
299+
sample 36:
300+
time = 835918
301+
flags = 1
302+
data = length 413, hash 53E7CB9F
303+
sample 37:
304+
time = 859138
305+
flags = 1
306+
data = length 445, hash D15B0E39
307+
sample 38:
308+
time = 882358
309+
flags = 1
310+
data = length 453, hash 77ED81E4
311+
sample 39:
312+
time = 905578
313+
flags = 1
314+
data = length 545, hash 3321AEB9
315+
sample 40:
316+
time = 928798
317+
flags = 1
318+
data = length 317, hash F557D0E
319+
sample 41:
320+
time = 952018
321+
flags = 1
322+
data = length 537, hash ED58CF7B
323+
sample 42:
324+
time = 975238
325+
flags = 1
326+
data = length 458, hash 51CDAA10
327+
sample 43:
328+
time = 998458
329+
flags = 1
330+
data = length 465, hash CBA1EFD7
331+
sample 44:
332+
time = 1021678
333+
flags = 1
334+
data = length 446, hash D6735B8A
335+
sample 45:
336+
time = 1044897
337+
flags = 1
338+
data = length 10, hash A453EEBE
339+
tracksEnded = true

0 commit comments

Comments
 (0)