Make onOutputFormat nullable

- This is to make sure we know about all the tracks before initializing
the SamplePipelines. This allows to set the muxer and the fallback
listener track count before the SamplePipelines are built.
- As a result, the test files had to be updated because the order in
which the tracks are written has changed.
- The ImageAssetLoader also had to be updated to call onOutputFormat
repeatedly until it returns a non-null SampleConsumer.
- Also fix the trackCount sent to the muxer and fallback listener. The
correct track count can be computed now that we know about all the
tracks before building the SamplePipelines.

PiperOrigin-RevId: 514426123
This commit is contained in:
kimvde 2023-03-06 16:58:09 +00:00 committed by Rohit Singh
parent 729066fbd6
commit 0f8b67b875
11 changed files with 1643 additions and 1578 deletions

View File

@ -1,9 +1,4 @@
format 0:
sampleMimeType = audio/mp4a-latm
channelCount = 1
sampleRate = 44100
pcmEncoding = 2
format 1:
id = 1
sampleMimeType = video/avc
codecs = avc1.640034
@ -14,356 +9,361 @@ format 1:
initializationData:
data = length 30, hash F6F3D010
data = length 10, hash 7A0D0F2B
format 1:
sampleMimeType = audio/mp4a-latm
channelCount = 1
sampleRate = 44100
pcmEncoding = 2
sample:
trackIndex = 1
dataHashCode = -252482306
size = 36477
isKeyFrame = true
presentationTimeUs = 0
sample:
trackIndex = 1
dataHashCode = 67864034
size = 5341
isKeyFrame = false
presentationTimeUs = 67000
sample:
trackIndex = 1
dataHashCode = 897273234
size = 596
isKeyFrame = false
presentationTimeUs = 33000
sample:
trackIndex = 1
dataHashCode = -1549870586
size = 7704
isKeyFrame = false
presentationTimeUs = 200000
sample:
trackIndex = 1
dataHashCode = 672384813
size = 989
isKeyFrame = false
presentationTimeUs = 133000
sample:
trackIndex = 1
dataHashCode = -988996493
size = 721
isKeyFrame = false
presentationTimeUs = 100000
sample:
trackIndex = 1
dataHashCode = 1711151377
size = 519
isKeyFrame = false
presentationTimeUs = 167000
sample:
trackIndex = 1
dataHashCode = -506806036
size = 6160
isKeyFrame = false
presentationTimeUs = 333000
sample:
trackIndex = 1
dataHashCode = 1902167649
size = 953
isKeyFrame = false
presentationTimeUs = 267000
sample:
trackIndex = 1
dataHashCode = 2054873212
size = 620
isKeyFrame = false
presentationTimeUs = 233000
sample:
trackIndex = 0
dataHashCode = 555688582
size = 416
isKeyFrame = true
presentationTimeUs = 0
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 2000837254
size = 418
isKeyFrame = true
presentationTimeUs = 4717
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -1593942879
size = 418
isKeyFrame = true
presentationTimeUs = 9456
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 587837542
size = 418
isKeyFrame = true
presentationTimeUs = 14196
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -1836423877
size = 418
isKeyFrame = true
presentationTimeUs = 18935
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 874705099
size = 418
isKeyFrame = true
presentationTimeUs = 23674
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -269206181
size = 418
isKeyFrame = true
presentationTimeUs = 28413
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -58682425
size = 418
isKeyFrame = true
presentationTimeUs = 33152
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -859796970
size = 418
isKeyFrame = true
presentationTimeUs = 37892
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 711911523
size = 418
isKeyFrame = true
presentationTimeUs = 42631
sample:
trackIndex = 0
dataHashCode = -252482306
size = 36477
isKeyFrame = true
presentationTimeUs = 0
sample:
trackIndex = 0
dataHashCode = 67864034
size = 5341
isKeyFrame = false
presentationTimeUs = 67000
sample:
trackIndex = 0
dataHashCode = 897273234
size = 596
isKeyFrame = false
presentationTimeUs = 33000
sample:
trackIndex = 0
dataHashCode = -1549870586
size = 7704
isKeyFrame = false
presentationTimeUs = 200000
sample:
trackIndex = 0
dataHashCode = 672384813
size = 989
isKeyFrame = false
presentationTimeUs = 133000
sample:
trackIndex = 0
dataHashCode = -988996493
size = 721
isKeyFrame = false
presentationTimeUs = 100000
sample:
trackIndex = 0
dataHashCode = 1711151377
size = 519
isKeyFrame = false
presentationTimeUs = 167000
sample:
trackIndex = 0
dataHashCode = -506806036
size = 6160
isKeyFrame = false
presentationTimeUs = 333000
sample:
trackIndex = 0
dataHashCode = 1902167649
size = 953
isKeyFrame = false
presentationTimeUs = 267000
sample:
trackIndex = 0
dataHashCode = 2054873212
size = 620
isKeyFrame = false
presentationTimeUs = 233000
sample:
trackIndex = 1
dataHashCode = -694513071
size = 418
isKeyFrame = true
presentationTimeUs = 47370
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -1124371059
size = 418
isKeyFrame = true
presentationTimeUs = 52109
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 297166745
size = 418
isKeyFrame = true
presentationTimeUs = 56849
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -937110638
size = 418
isKeyFrame = true
presentationTimeUs = 61588
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -1050158990
size = 418
isKeyFrame = true
presentationTimeUs = 66327
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 1109510229
size = 418
isKeyFrame = true
presentationTimeUs = 71066
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 1297086772
size = 418
isKeyFrame = true
presentationTimeUs = 75805
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -1739939803
size = 418
isKeyFrame = true
presentationTimeUs = 80545
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -1149727930
size = 418
isKeyFrame = true
presentationTimeUs = 85284
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -1627652713
size = 418
isKeyFrame = true
presentationTimeUs = 90023
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = 1556608231
size = 405
isKeyFrame = false
presentationTimeUs = 300000
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = -1648978019
size = 4852
isKeyFrame = false
presentationTimeUs = 433000
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = -484808327
size = 547
isKeyFrame = false
presentationTimeUs = 400000
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = -20706048
size = 570
isKeyFrame = false
presentationTimeUs = 367000
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = 2085064574
size = 5525
isKeyFrame = false
presentationTimeUs = 567000
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = -637074022
size = 1082
isKeyFrame = false
presentationTimeUs = 500000
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = -1824027029
size = 807
isKeyFrame = false
presentationTimeUs = 467000
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = -1701945306
size = 744
isKeyFrame = false
presentationTimeUs = 533000
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -551926260
size = 418
isKeyFrame = true
presentationTimeUs = 94762
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 45987178
size = 418
isKeyFrame = true
presentationTimeUs = 99502
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -903675808
size = 418
isKeyFrame = true
presentationTimeUs = 104241
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -755916991
size = 418
isKeyFrame = true
presentationTimeUs = 108980
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -1355207303
size = 418
isKeyFrame = true
presentationTimeUs = 113719
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -975703389
size = 418
isKeyFrame = true
presentationTimeUs = 118459
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 1933194670
size = 418
isKeyFrame = true
presentationTimeUs = 123198
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -565778989
size = 418
isKeyFrame = true
presentationTimeUs = 127937
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 1454083383
size = 418
isKeyFrame = true
presentationTimeUs = 132676
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = -952425536
size = 4732
isKeyFrame = false
presentationTimeUs = 700000
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = -1978031576
size = 1004
isKeyFrame = false
presentationTimeUs = 633000
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = -2128215508
size = 794
isKeyFrame = false
presentationTimeUs = 600000
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = -259850011
size = 645
isKeyFrame = false
presentationTimeUs = 667000
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = 1920983928
size = 2684
isKeyFrame = false
presentationTimeUs = 833000
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = 1100642337
size = 787
isKeyFrame = false
presentationTimeUs = 767000
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = 1544917830
size = 649
isKeyFrame = false
presentationTimeUs = 733000
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = -116205995
size = 509
isKeyFrame = false
presentationTimeUs = 800000
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = 696343585
size = 1226
isKeyFrame = false
presentationTimeUs = 967000
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = -644371190
size = 898
isKeyFrame = false
presentationTimeUs = 900000
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = -1606273467
size = 476
isKeyFrame = false
presentationTimeUs = 867000
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = -571265861
size = 486
isKeyFrame = false

View File

@ -1,9 +1,4 @@
format 0:
sampleMimeType = audio/mp4a-latm
channelCount = 1
sampleRate = 48000
pcmEncoding = 2
format 1:
id = 1
sampleMimeType = video/avc
codecs = avc1.64001F
@ -14,458 +9,463 @@ format 1:
initializationData:
data = length 29, hash 4746B5D9
data = length 10, hash 7A0D0F2B
format 1:
sampleMimeType = audio/mp4a-latm
channelCount = 1
sampleRate = 48000
pcmEncoding = 2
sample:
trackIndex = 1
dataHashCode = -770308242
size = 36692
isKeyFrame = true
presentationTimeUs = 0
sample:
trackIndex = 1
dataHashCode = -732087136
size = 5312
isKeyFrame = false
presentationTimeUs = 66733
sample:
trackIndex = 1
dataHashCode = 468156717
size = 599
isKeyFrame = false
presentationTimeUs = 33366
sample:
trackIndex = 1
dataHashCode = 1150349584
size = 7735
isKeyFrame = false
presentationTimeUs = 200200
sample:
trackIndex = 1
dataHashCode = 1443582006
size = 987
isKeyFrame = false
presentationTimeUs = 133466
sample:
trackIndex = 1
dataHashCode = -310585145
size = 673
isKeyFrame = false
presentationTimeUs = 100100
sample:
trackIndex = 1
dataHashCode = 807460688
size = 523
isKeyFrame = false
presentationTimeUs = 166833
sample:
trackIndex = 1
dataHashCode = 1936487090
size = 6061
isKeyFrame = false
presentationTimeUs = 333666
sample:
trackIndex = 1
dataHashCode = -32297181
size = 992
isKeyFrame = false
presentationTimeUs = 266933
sample:
trackIndex = 1
dataHashCode = 1529616406
size = 623
isKeyFrame = false
presentationTimeUs = 233566
sample:
trackIndex = 0
dataHashCode = 1868041800
size = 22
isKeyFrame = true
presentationTimeUs = 0
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 1552866193
size = 8
isKeyFrame = true
presentationTimeUs = 230
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 701848493
size = 160
isKeyFrame = true
presentationTimeUs = 313
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 2000505720
size = 206
isKeyFrame = true
presentationTimeUs = 1980
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 57276327
size = 222
isKeyFrame = true
presentationTimeUs = 4125
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 382237408
size = 228
isKeyFrame = true
presentationTimeUs = 6438
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 795308374
size = 228
isKeyFrame = true
presentationTimeUs = 8813
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 356270426
size = 224
isKeyFrame = true
presentationTimeUs = 11188
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 963641614
size = 244
isKeyFrame = true
presentationTimeUs = 13521
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 2045272193
size = 234
isKeyFrame = true
presentationTimeUs = 16063
sample:
trackIndex = 0
dataHashCode = -770308242
size = 36692
isKeyFrame = true
presentationTimeUs = 0
sample:
trackIndex = 0
dataHashCode = -732087136
size = 5312
isKeyFrame = false
presentationTimeUs = 66733
sample:
trackIndex = 0
dataHashCode = 468156717
size = 599
isKeyFrame = false
presentationTimeUs = 33366
sample:
trackIndex = 0
dataHashCode = 1150349584
size = 7735
isKeyFrame = false
presentationTimeUs = 200200
sample:
trackIndex = 0
dataHashCode = 1443582006
size = 987
isKeyFrame = false
presentationTimeUs = 133466
sample:
trackIndex = 0
dataHashCode = -310585145
size = 673
isKeyFrame = false
presentationTimeUs = 100100
sample:
trackIndex = 0
dataHashCode = 807460688
size = 523
isKeyFrame = false
presentationTimeUs = 166833
sample:
trackIndex = 0
dataHashCode = 1936487090
size = 6061
isKeyFrame = false
presentationTimeUs = 333666
sample:
trackIndex = 0
dataHashCode = -32297181
size = 992
isKeyFrame = false
presentationTimeUs = 266933
sample:
trackIndex = 0
dataHashCode = 1529616406
size = 623
isKeyFrame = false
presentationTimeUs = 233566
sample:
trackIndex = 1
dataHashCode = -251933090
size = 228
isKeyFrame = true
presentationTimeUs = 18500
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -329315280
size = 234
isKeyFrame = true
presentationTimeUs = 20875
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -1536715689
size = 248
isKeyFrame = true
presentationTimeUs = 23313
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -1275249610
size = 254
isKeyFrame = true
presentationTimeUs = 25896
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -2081231470
size = 254
isKeyFrame = true
presentationTimeUs = 28542
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 1912348529
size = 250
isKeyFrame = true
presentationTimeUs = 31188
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -1393642278
size = 246
isKeyFrame = true
presentationTimeUs = 33792
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -2073671562
size = 236
isKeyFrame = true
presentationTimeUs = 36355
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -381095129
size = 248
isKeyFrame = true
presentationTimeUs = 38813
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -804721381
size = 238
isKeyFrame = true
presentationTimeUs = 41396
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = 1949198785
size = 421
isKeyFrame = false
presentationTimeUs = 300300
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = -147880287
size = 4899
isKeyFrame = false
presentationTimeUs = 433766
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = 1369083472
size = 568
isKeyFrame = false
presentationTimeUs = 400400
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = 965782073
size = 620
isKeyFrame = false
presentationTimeUs = 367033
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 172275944
size = 260
isKeyFrame = true
presentationTimeUs = 43875
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -1045486664
size = 248
isKeyFrame = true
presentationTimeUs = 46584
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -1465283679
size = 260
isKeyFrame = true
presentationTimeUs = 49167
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 1840117006
size = 254
isKeyFrame = true
presentationTimeUs = 51875
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -631848848
size = 250
isKeyFrame = true
presentationTimeUs = 54521
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -1207491554
size = 236
isKeyFrame = true
presentationTimeUs = 57125
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 838792456
size = 258
isKeyFrame = true
presentationTimeUs = 59584
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -1131122284
size = 264
isKeyFrame = true
presentationTimeUs = 62271
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -122326555
size = 250
isKeyFrame = true
presentationTimeUs = 65021
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -1340323720
size = 250
isKeyFrame = true
presentationTimeUs = 67625
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = -261176150
size = 5450
isKeyFrame = false
presentationTimeUs = 567233
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = -1830836678
size = 1051
isKeyFrame = false
presentationTimeUs = 500500
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = 1767407540
size = 874
isKeyFrame = false
presentationTimeUs = 467133
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = 918440283
size = 781
isKeyFrame = false
presentationTimeUs = 533866
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -1290952882
size = 260
isKeyFrame = true
presentationTimeUs = 70230
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 2118216858
size = 244
isKeyFrame = true
presentationTimeUs = 72938
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 879520231
size = 252
isKeyFrame = true
presentationTimeUs = 75480
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -174892555
size = 264
isKeyFrame = true
presentationTimeUs = 78105
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -555873771
size = 252
isKeyFrame = true
presentationTimeUs = 80855
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -1479853263
size = 256
isKeyFrame = true
presentationTimeUs = 83480
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -1068971504
size = 250
isKeyFrame = true
presentationTimeUs = 86146
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -866214350
size = 254
isKeyFrame = true
presentationTimeUs = 88750
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -2111034853
size = 288
isKeyFrame = true
presentationTimeUs = 91396
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -1445430754
size = 278
isKeyFrame = true
presentationTimeUs = 94396
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 1200468541
size = 246
isKeyFrame = true
presentationTimeUs = 97292
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -1853596884
size = 246
isKeyFrame = true
presentationTimeUs = 99855
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -1266372568
size = 254
isKeyFrame = true
presentationTimeUs = 102417
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -212017561
size = 248
isKeyFrame = true
presentationTimeUs = 105063
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -1464702479
size = 8
isKeyFrame = true
presentationTimeUs = 107646
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -2065
size = 2
isKeyFrame = true
presentationTimeUs = 107730
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = -1408463661
size = 4725
isKeyFrame = false
presentationTimeUs = 700700
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = 1569455924
size = 1022
isKeyFrame = false
presentationTimeUs = 633966
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = -1723778407
size = 790
isKeyFrame = false
presentationTimeUs = 600600
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = 1578275472
size = 610
isKeyFrame = false
presentationTimeUs = 667333
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = 1989768395
size = 2751
isKeyFrame = false
presentationTimeUs = 834166
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = -1215674502
size = 745
isKeyFrame = false
presentationTimeUs = 767433
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = -814473606
size = 621
isKeyFrame = false
presentationTimeUs = 734066
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = 498370894
size = 505
isKeyFrame = false
presentationTimeUs = 800800
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = -1051506468
size = 1268
isKeyFrame = false
presentationTimeUs = 967633
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = -1025604144
size = 880
isKeyFrame = false
presentationTimeUs = 900900
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = -913586520
size = 530
isKeyFrame = false
presentationTimeUs = 867533
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = 1340459242
size = 568
isKeyFrame = false

View File

@ -1,4 +1,15 @@
format 0:
id = 1
sampleMimeType = video/avc
codecs = avc1.64001F
maxInputSize = 36722
width = 1080
height = 720
frameRate = 29.970028
initializationData:
data = length 29, hash 4746B5D9
data = length 10, hash 7A0D0F2B
format 1:
peakBitrate = 200000
id = 2
sampleMimeType = audio/mp4a-latm
@ -10,463 +21,452 @@ format 0:
metadata = entries=[TSSE: description=null: values=[Lavf56.1.0]]
initializationData:
data = length 2, hash 5F7
format 1:
id = 1
sampleMimeType = video/avc
codecs = avc1.64001F
maxInputSize = 36722
width = 1080
height = 720
frameRate = 29.970028
initializationData:
data = length 29, hash 4746B5D9
data = length 10, hash 7A0D0F2B
sample:
trackIndex = 1
dataHashCode = -770308242
size = 36692
isKeyFrame = true
presentationTimeUs = 0
sample:
trackIndex = 1
dataHashCode = -732087136
size = 5312
isKeyFrame = false
presentationTimeUs = 66733
sample:
trackIndex = 1
dataHashCode = 468156717
size = 599
isKeyFrame = false
presentationTimeUs = 33366
sample:
trackIndex = 1
dataHashCode = 1150349584
size = 7735
isKeyFrame = false
presentationTimeUs = 200200
sample:
trackIndex = 1
dataHashCode = 1443582006
size = 987
isKeyFrame = false
presentationTimeUs = 133466
sample:
trackIndex = 1
dataHashCode = -310585145
size = 673
isKeyFrame = false
presentationTimeUs = 100100
sample:
trackIndex = 1
dataHashCode = 807460688
size = 523
isKeyFrame = false
presentationTimeUs = 166833
sample:
trackIndex = 1
dataHashCode = 1936487090
size = 6061
isKeyFrame = false
presentationTimeUs = 333666
sample:
trackIndex = 1
dataHashCode = -32297181
size = 992
isKeyFrame = false
presentationTimeUs = 266933
sample:
trackIndex = 1
dataHashCode = 1529616406
size = 623
isKeyFrame = false
presentationTimeUs = 233566
sample:
trackIndex = 0
dataHashCode = 1205768497
size = 23
isKeyFrame = true
presentationTimeUs = 44000
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 837571078
size = 6
isKeyFrame = true
presentationTimeUs = 67219
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -1991633045
size = 148
isKeyFrame = true
presentationTimeUs = 90439
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -822987359
size = 189
isKeyFrame = true
presentationTimeUs = 113659
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -1141508176
size = 205
isKeyFrame = true
presentationTimeUs = 136879
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -226971245
size = 210
isKeyFrame = true
presentationTimeUs = 160099
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -2099636855
size = 210
isKeyFrame = true
presentationTimeUs = 183319
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 1541550559
size = 207
isKeyFrame = true
presentationTimeUs = 206539
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 411148001
size = 225
isKeyFrame = true
presentationTimeUs = 229759
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -897603973
size = 215
isKeyFrame = true
presentationTimeUs = 252979
sample:
trackIndex = 1
dataHashCode = 1949198785
size = 421
isKeyFrame = false
presentationTimeUs = 300300
sample:
trackIndex = 1
dataHashCode = -147880287
size = 4899
isKeyFrame = false
presentationTimeUs = 433766
sample:
trackIndex = 1
dataHashCode = 1369083472
size = 568
isKeyFrame = false
presentationTimeUs = 400400
sample:
trackIndex = 1
dataHashCode = 965782073
size = 620
isKeyFrame = false
presentationTimeUs = 367033
sample:
trackIndex = 1
dataHashCode = -261176150
size = 5450
isKeyFrame = false
presentationTimeUs = 567233
sample:
trackIndex = 1
dataHashCode = -1830836678
size = 1051
isKeyFrame = false
presentationTimeUs = 500500
sample:
trackIndex = 1
dataHashCode = 1767407540
size = 874
isKeyFrame = false
presentationTimeUs = 467133
sample:
trackIndex = 1
dataHashCode = 918440283
size = 781
isKeyFrame = false
presentationTimeUs = 533866
sample:
trackIndex = 1
dataHashCode = -1408463661
size = 4725
isKeyFrame = false
presentationTimeUs = 700700
sample:
trackIndex = 1
dataHashCode = 1569455924
size = 1022
isKeyFrame = false
presentationTimeUs = 633966
trackIndex = 0
dataHashCode = -770308242
size = 36692
isKeyFrame = true
presentationTimeUs = 0
sample:
trackIndex = 0
dataHashCode = -732087136
size = 5312
isKeyFrame = false
presentationTimeUs = 66733
sample:
trackIndex = 0
dataHashCode = 468156717
size = 599
isKeyFrame = false
presentationTimeUs = 33366
sample:
trackIndex = 0
dataHashCode = 1150349584
size = 7735
isKeyFrame = false
presentationTimeUs = 200200
sample:
trackIndex = 0
dataHashCode = 1443582006
size = 987
isKeyFrame = false
presentationTimeUs = 133466
sample:
trackIndex = 0
dataHashCode = -310585145
size = 673
isKeyFrame = false
presentationTimeUs = 100100
sample:
trackIndex = 0
dataHashCode = 807460688
size = 523
isKeyFrame = false
presentationTimeUs = 166833
sample:
trackIndex = 0
dataHashCode = 1936487090
size = 6061
isKeyFrame = false
presentationTimeUs = 333666
sample:
trackIndex = 0
dataHashCode = -32297181
size = 992
isKeyFrame = false
presentationTimeUs = 266933
sample:
trackIndex = 0
dataHashCode = 1529616406
size = 623
isKeyFrame = false
presentationTimeUs = 233566
sample:
trackIndex = 1
dataHashCode = 1478106136
size = 211
isKeyFrame = true
presentationTimeUs = 276199
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -1380417145
size = 216
isKeyFrame = true
presentationTimeUs = 299419
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 780903644
size = 229
isKeyFrame = true
presentationTimeUs = 322639
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 586204432
size = 232
isKeyFrame = true
presentationTimeUs = 345859
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -2038771492
size = 235
isKeyFrame = true
presentationTimeUs = 369079
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -2065161304
size = 231
isKeyFrame = true
presentationTimeUs = 392299
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 468662933
size = 226
isKeyFrame = true
presentationTimeUs = 415519
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -358398546
size = 216
isKeyFrame = true
presentationTimeUs = 438739
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 1767325983
size = 229
isKeyFrame = true
presentationTimeUs = 461959
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 1093095458
size = 219
isKeyFrame = true
presentationTimeUs = 485179
sample:
trackIndex = 1
dataHashCode = -1723778407
size = 790
trackIndex = 0
dataHashCode = 1949198785
size = 421
isKeyFrame = false
presentationTimeUs = 600600
sample:
trackIndex = 1
dataHashCode = 1578275472
size = 610
isKeyFrame = false
presentationTimeUs = 667333
sample:
trackIndex = 1
dataHashCode = 1989768395
size = 2751
isKeyFrame = false
presentationTimeUs = 834166
sample:
trackIndex = 1
dataHashCode = -1215674502
size = 745
isKeyFrame = false
presentationTimeUs = 767433
sample:
trackIndex = 1
dataHashCode = -814473606
size = 621
isKeyFrame = false
presentationTimeUs = 734066
sample:
trackIndex = 1
dataHashCode = 498370894
size = 505
isKeyFrame = false
presentationTimeUs = 800800
sample:
trackIndex = 1
dataHashCode = -1051506468
size = 1268
isKeyFrame = false
presentationTimeUs = 967633
sample:
trackIndex = 1
dataHashCode = -1025604144
size = 880
isKeyFrame = false
presentationTimeUs = 900900
sample:
trackIndex = 1
dataHashCode = -913586520
size = 530
isKeyFrame = false
presentationTimeUs = 867533
sample:
trackIndex = 1
dataHashCode = 1340459242
size = 568
isKeyFrame = false
presentationTimeUs = 934266
presentationTimeUs = 300300
sample:
trackIndex = 0
dataHashCode = -147880287
size = 4899
isKeyFrame = false
presentationTimeUs = 433766
sample:
trackIndex = 0
dataHashCode = 1369083472
size = 568
isKeyFrame = false
presentationTimeUs = 400400
sample:
trackIndex = 0
dataHashCode = 965782073
size = 620
isKeyFrame = false
presentationTimeUs = 367033
sample:
trackIndex = 0
dataHashCode = -261176150
size = 5450
isKeyFrame = false
presentationTimeUs = 567233
sample:
trackIndex = 0
dataHashCode = -1830836678
size = 1051
isKeyFrame = false
presentationTimeUs = 500500
sample:
trackIndex = 0
dataHashCode = 1767407540
size = 874
isKeyFrame = false
presentationTimeUs = 467133
sample:
trackIndex = 0
dataHashCode = 918440283
size = 781
isKeyFrame = false
presentationTimeUs = 533866
sample:
trackIndex = 0
dataHashCode = -1408463661
size = 4725
isKeyFrame = false
presentationTimeUs = 700700
sample:
trackIndex = 0
dataHashCode = 1569455924
size = 1022
isKeyFrame = false
presentationTimeUs = 633966
sample:
trackIndex = 1
dataHashCode = 1687543702
size = 241
isKeyFrame = true
presentationTimeUs = 508399
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 1675188486
size = 228
isKeyFrame = true
presentationTimeUs = 531619
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 888567545
size = 238
isKeyFrame = true
presentationTimeUs = 554839
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -439631803
size = 234
isKeyFrame = true
presentationTimeUs = 578058
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 1606694497
size = 231
isKeyFrame = true
presentationTimeUs = 601278
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 1747388653
size = 217
isKeyFrame = true
presentationTimeUs = 624498
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -734560004
size = 239
isKeyFrame = true
presentationTimeUs = 647718
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -975079040
size = 243
isKeyFrame = true
presentationTimeUs = 670938
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -1403504710
size = 231
isKeyFrame = true
presentationTimeUs = 694158
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 379512981
size = 230
isKeyFrame = true
presentationTimeUs = 717378
sample:
trackIndex = 0
dataHashCode = -1723778407
size = 790
isKeyFrame = false
presentationTimeUs = 600600
sample:
trackIndex = 0
dataHashCode = 1578275472
size = 610
isKeyFrame = false
presentationTimeUs = 667333
sample:
trackIndex = 0
dataHashCode = 1989768395
size = 2751
isKeyFrame = false
presentationTimeUs = 834166
sample:
trackIndex = 0
dataHashCode = -1215674502
size = 745
isKeyFrame = false
presentationTimeUs = 767433
sample:
trackIndex = 0
dataHashCode = -814473606
size = 621
isKeyFrame = false
presentationTimeUs = 734066
sample:
trackIndex = 0
dataHashCode = 498370894
size = 505
isKeyFrame = false
presentationTimeUs = 800800
sample:
trackIndex = 0
dataHashCode = -1051506468
size = 1268
isKeyFrame = false
presentationTimeUs = 967633
sample:
trackIndex = 0
dataHashCode = -1025604144
size = 880
isKeyFrame = false
presentationTimeUs = 900900
sample:
trackIndex = 0
dataHashCode = -913586520
size = 530
isKeyFrame = false
presentationTimeUs = 867533
sample:
trackIndex = 0
dataHashCode = 1340459242
size = 568
isKeyFrame = false
presentationTimeUs = 934266
sample:
trackIndex = 1
dataHashCode = -997198863
size = 238
isKeyFrame = true
presentationTimeUs = 740598
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 1394492825
size = 225
isKeyFrame = true
presentationTimeUs = 763818
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -885232755
size = 232
isKeyFrame = true
presentationTimeUs = 787038
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 260871367
size = 243
isKeyFrame = true
presentationTimeUs = 810258
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -1505318960
size = 232
isKeyFrame = true
presentationTimeUs = 833478
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -390625371
size = 237
isKeyFrame = true
presentationTimeUs = 856698
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 1067950751
size = 228
isKeyFrame = true
presentationTimeUs = 879918
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -1179436278
size = 235
isKeyFrame = true
presentationTimeUs = 903138
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 1906607774
size = 264
isKeyFrame = true
presentationTimeUs = 926358
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -800475828
size = 257
isKeyFrame = true
presentationTimeUs = 949578
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 1718972977
size = 227
isKeyFrame = true
presentationTimeUs = 972798
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -1120448741
size = 227
isKeyFrame = true
presentationTimeUs = 996018
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -1718323210
size = 235
isKeyFrame = true
presentationTimeUs = 1019238
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -422416
size = 229
isKeyFrame = true
presentationTimeUs = 1042458
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 833757830
size = 6
isKeyFrame = true

View File

@ -1,9 +1,4 @@
format 0:
sampleMimeType = audio/mp4a-latm
channelCount = 2
sampleRate = 12000
pcmEncoding = 2
format 1:
id = 2
sampleMimeType = video/avc
codecs = avc1.64000D
@ -15,332 +10,337 @@ format 1:
initializationData:
data = length 33, hash D3FB879D
data = length 10, hash 7A0D0F2B
format 1:
sampleMimeType = audio/mp4a-latm
channelCount = 2
sampleRate = 12000
pcmEncoding = 2
sample:
trackIndex = 1
dataHashCode = 1949079733
size = 5446
isKeyFrame = true
presentationTimeUs = 0
sample:
trackIndex = 1
dataHashCode = -1397194508
size = 125
isKeyFrame = false
presentationTimeUs = 14000
sample:
trackIndex = 1
dataHashCode = 1147159698
size = 147
isKeyFrame = false
presentationTimeUs = 47333
sample:
trackIndex = 1
dataHashCode = 524634358
size = 149
isKeyFrame = false
presentationTimeUs = 80667
sample:
trackIndex = 1
dataHashCode = 2031178347
size = 149
isKeyFrame = false
presentationTimeUs = 114000
sample:
trackIndex = 1
dataHashCode = -625462168
size = 169
isKeyFrame = false
presentationTimeUs = 147333
sample:
trackIndex = 1
dataHashCode = -973299745
size = 126
isKeyFrame = false
presentationTimeUs = 180667
sample:
trackIndex = 1
dataHashCode = -788426325
size = 120
isKeyFrame = false
presentationTimeUs = 228042
sample:
trackIndex = 1
dataHashCode = 2009515523
size = 126
isKeyFrame = false
presentationTimeUs = 244708
sample:
trackIndex = 1
dataHashCode = -874600600
size = 1180
isKeyFrame = false
presentationTimeUs = 334083
sample:
trackIndex = 0
dataHashCode = -212376212
size = 20
isKeyFrame = true
presentationTimeUs = 0
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -1948569090
size = 72
isKeyFrame = true
presentationTimeUs = 417
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -1316750072
size = 84
isKeyFrame = true
presentationTimeUs = 1917
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 1016428949
size = 88
isKeyFrame = true
presentationTimeUs = 3667
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -1127325245
size = 96
isKeyFrame = true
presentationTimeUs = 5500
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 1148147726
size = 92
isKeyFrame = true
presentationTimeUs = 7500
sample:
trackIndex = 0
dataHashCode = 1949079733
size = 5446
isKeyFrame = true
presentationTimeUs = 0
sample:
trackIndex = 0
dataHashCode = -1397194508
size = 125
isKeyFrame = false
presentationTimeUs = 14000
sample:
trackIndex = 0
dataHashCode = 1147159698
size = 147
isKeyFrame = false
presentationTimeUs = 47333
sample:
trackIndex = 0
dataHashCode = 524634358
size = 149
isKeyFrame = false
presentationTimeUs = 80667
sample:
trackIndex = 0
dataHashCode = 2031178347
size = 149
isKeyFrame = false
presentationTimeUs = 114000
sample:
trackIndex = 0
dataHashCode = -625462168
size = 169
isKeyFrame = false
presentationTimeUs = 147333
sample:
trackIndex = 0
dataHashCode = -973299745
size = 126
isKeyFrame = false
presentationTimeUs = 180667
sample:
trackIndex = 0
dataHashCode = -788426325
size = 120
isKeyFrame = false
presentationTimeUs = 228042
sample:
trackIndex = 0
dataHashCode = 2009515523
size = 126
isKeyFrame = false
presentationTimeUs = 244708
sample:
trackIndex = 0
dataHashCode = -874600600
size = 1180
isKeyFrame = false
presentationTimeUs = 334083
sample:
trackIndex = 1
dataHashCode = -2125685540
size = 76
isKeyFrame = true
presentationTimeUs = 9417
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 473329679
size = 24
isKeyFrame = true
presentationTimeUs = 11000
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 240990900
size = 176
isKeyFrame = true
presentationTimeUs = 11500
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 777637182
size = 196
isKeyFrame = true
presentationTimeUs = 15167
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 1872106264
size = 180
isKeyFrame = true
presentationTimeUs = 19250
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -1520711499
size = 140
isKeyFrame = true
presentationTimeUs = 23000
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 1580199067
size = 232
isKeyFrame = true
presentationTimeUs = 25917
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 475464086
size = 184
isKeyFrame = true
presentationTimeUs = 30750
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -211754132
size = 172
isKeyFrame = true
presentationTimeUs = 34584
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 1236547164
size = 172
isKeyFrame = true
presentationTimeUs = 38167
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -2064216186
size = 188
isKeyFrame = true
presentationTimeUs = 41750
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = 984869991
size = 216
isKeyFrame = false
presentationTimeUs = 267416
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = 2106811176
size = 119
isKeyFrame = false
presentationTimeUs = 234083
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = -1981166365
size = 145
isKeyFrame = false
presentationTimeUs = 300750
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = 1234592714
size = 1274
isKeyFrame = false
presentationTimeUs = 467416
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = -13135608
size = 190
isKeyFrame = false
presentationTimeUs = 400750
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = 1840621658
size = 107
isKeyFrame = false
presentationTimeUs = 367416
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = 1637734271
size = 125
isKeyFrame = false
presentationTimeUs = 434083
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -682950885
size = 260
isKeyFrame = true
presentationTimeUs = 45667
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 1301206627
size = 236
isKeyFrame = true
presentationTimeUs = 51084
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 256580525
size = 236
isKeyFrame = true
presentationTimeUs = 56000
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -1086601304
size = 236
isKeyFrame = true
presentationTimeUs = 60917
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -2046131588
size = 224
isKeyFrame = true
presentationTimeUs = 65834
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 1550955865
size = 224
isKeyFrame = true
presentationTimeUs = 70500
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -274800552
size = 220
isKeyFrame = true
presentationTimeUs = 75167
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = 382420909
size = 224
isKeyFrame = true
presentationTimeUs = 79750
sample:
trackIndex = 0
trackIndex = 1
dataHashCode = -1431575865
size = 232
isKeyFrame = true
presentationTimeUs = 84417
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = 2112365658
size = 1109
isKeyFrame = false
presentationTimeUs = 600750
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = -968901399
size = 250
isKeyFrame = false
presentationTimeUs = 534083
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = -1184738023
size = 124
isKeyFrame = false
presentationTimeUs = 500750
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = 1756300509
size = 134
isKeyFrame = false
presentationTimeUs = 567416
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = 823429273
size = 1201
isKeyFrame = false
presentationTimeUs = 734083
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = 651718599
size = 213
isKeyFrame = false
presentationTimeUs = 667416
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = 846349953
size = 125
isKeyFrame = false
presentationTimeUs = 634083
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = 1331153462
size = 114
isKeyFrame = false
presentationTimeUs = 700750
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = -73358172
size = 1010
isKeyFrame = false
presentationTimeUs = 867416
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = -1395269253
size = 209
isKeyFrame = false
presentationTimeUs = 800750
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = -1001367604
size = 139
isKeyFrame = false
presentationTimeUs = 767416
sample:
trackIndex = 1
trackIndex = 0
dataHashCode = -122569918
size = 138
isKeyFrame = false

View File

@ -21,6 +21,7 @@ import static java.lang.annotation.ElementType.TYPE_USE;
import android.os.Looper;
import androidx.annotation.IntDef;
import androidx.annotation.IntRange;
import androidx.annotation.Nullable;
import androidx.media3.common.Format;
import androidx.media3.common.util.UnstableApi;
import com.google.common.collect.ImmutableMap;
@ -114,17 +115,21 @@ public interface AssetLoader {
* Called when the {@link Format} of samples that will be output by the {@link AssetLoader} is
* known.
*
* <p>Must be called once per {@linkplain #onTrackCount declared} track, and only after that
* track has been {@link #onTrackAdded added}.
* <p>Must be called after the corresponding track has been {@link #onTrackAdded added}.
*
* <p>For each {@link #onTrackAdded added} track, this method must be called regularly until the
* returned {@link SampleConsumer} is non-null.
*
* <p>Must be called from the thread that will be used to call the returned {@link
* SampleConsumer}'s methods. This thread must be the same for all formats output, and is
* generally different from the one used to access the {@link AssetLoader} methods.
*
* @param format The {@link Format} of samples that will be output.
* @return The {@link SampleConsumer} of samples of the given {@link Format}.
* @return The {@link SampleConsumer} of samples of the given {@link Format}, or {@code null} if
* it could not be retrieved yet.
* @throws ExportException If an error occurs configuring the {@link SampleConsumer}.
*/
@Nullable
SampleConsumer onOutputFormat(Format format) throws ExportException;
/**

View File

@ -235,25 +235,31 @@ import java.util.concurrent.atomic.AtomicInteger;
return decodeOutput;
}
@Nullable
@Override
public SampleConsumer onOutputFormat(Format format) throws ExportException {
@C.TrackType int trackType = getProcessedTrackType(format.sampleMimeType);
SampleConsumer sampleConsumer;
if (currentMediaItemIndex.get() == 0) {
sampleConsumer =
new SampleConsumerWrapper(compositeAssetLoaderListener.onOutputFormat(format));
@Nullable
SampleConsumer wrappedSampleConsumer = compositeAssetLoaderListener.onOutputFormat(format);
if (wrappedSampleConsumer == null) {
return null;
}
sampleConsumer = new SampleConsumerWrapper(wrappedSampleConsumer);
sampleConsumersByTrackType.put(trackType, sampleConsumer);
if (forceAudioTrack && nonEndedTracks.get() == 1 && trackType == C.TRACK_TYPE_VIDEO) {
sampleConsumersByTrackType.put(
C.TRACK_TYPE_AUDIO,
new SampleConsumerWrapper(
SampleConsumer wrappedAudioSampleConsumer =
checkStateNotNull(
compositeAssetLoaderListener.onOutputFormat(
FORCE_AUDIO_TRACK_FORMAT
.buildUpon()
.setSampleMimeType(MimeTypes.AUDIO_RAW)
.setPcmEncoding(C.ENCODING_PCM_16BIT)
.build())));
.build()));
sampleConsumersByTrackType.put(
C.TRACK_TYPE_AUDIO, new SampleConsumerWrapper(wrappedAudioSampleConsumer));
}
} else {
// TODO(b/270533049): Remove the check below when implementing blank video frames generation.

View File

@ -46,6 +46,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
protected @MonotonicNonNull Codec decoder;
protected boolean isEnded;
private @MonotonicNonNull Format inputFormat;
private @MonotonicNonNull Format outputFormat;
private final TransformerMediaClock mediaClock;
private final AssetLoader.Listener assetLoaderListener;
@ -244,19 +245,26 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
return true;
}
if (decoder != null
&& getProcessedTrackType(inputFormat.sampleMimeType) == C.TRACK_TYPE_AUDIO) {
@Nullable Format decoderOutputFormat = decoder.getOutputFormat();
if (decoderOutputFormat == null) {
return false;
if (outputFormat == null) {
if (decoder != null
&& getProcessedTrackType(inputFormat.sampleMimeType) == C.TRACK_TYPE_AUDIO) {
@Nullable Format decoderOutputFormat = decoder.getOutputFormat();
if (decoderOutputFormat == null) {
return false;
}
outputFormat = decoderOutputFormat;
} else {
// TODO(b/237674316): Move surface creation out of video sampleConsumer. Init decoder and
// get decoderOutput Format before init sampleConsumer.
outputFormat = inputFormat;
}
sampleConsumer = assetLoaderListener.onOutputFormat(decoderOutputFormat);
} else {
// TODO(b/237674316): Move surface creation out of video sampleConsumer. Init decoder and get
// decoderOutput Format before init sampleConsumer.
sampleConsumer = assetLoaderListener.onOutputFormat(inputFormat);
}
SampleConsumer sampleConsumer = assetLoaderListener.onOutputFormat(outputFormat);
if (sampleConsumer == null) {
return false;
}
this.sampleConsumer = sampleConsumer;
return true;
}

View File

@ -22,22 +22,28 @@ import static androidx.media3.transformer.ExportException.ERROR_CODE_IO_UNSPECIF
import static androidx.media3.transformer.ExportException.ERROR_CODE_UNSPECIFIED;
import static androidx.media3.transformer.Transformer.PROGRESS_STATE_AVAILABLE;
import static androidx.media3.transformer.Transformer.PROGRESS_STATE_NOT_STARTED;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import android.content.Context;
import android.graphics.Bitmap;
import android.os.Looper;
import androidx.annotation.Nullable;
import androidx.media3.common.C;
import androidx.media3.common.Format;
import androidx.media3.common.MediaItem;
import androidx.media3.common.MimeTypes;
import androidx.media3.common.util.BitmapLoader;
import androidx.media3.common.util.UnstableApi;
import androidx.media3.datasource.DataSource;
import androidx.media3.datasource.DataSourceBitmapLoader;
import androidx.media3.datasource.DefaultDataSource;
import com.google.common.collect.ImmutableMap;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
/** An {@link AssetLoader} implementation that loads images into {@link Bitmap} instances. */
@UnstableApi
@ -61,26 +67,36 @@ public final class ImageAssetLoader implements AssetLoader {
public static final String MIME_TYPE_IMAGE_ALL = MimeTypes.BASE_TYPE_IMAGE + "/*";
private final Context context;
private static final int QUEUE_BITMAP_INTERVAL_MS = 10;
private final EditedMediaItem editedMediaItem;
private final DataSource.Factory dataSourceFactory;
private final Listener listener;
private final ScheduledExecutorService scheduledExecutorService;
private @Transformer.ProgressState int progressState;
private int progress;
private volatile int progress;
private ImageAssetLoader(Context context, EditedMediaItem editedMediaItem, Listener listener) {
this.context = context;
checkState(editedMediaItem.durationUs != C.TIME_UNSET);
checkState(editedMediaItem.frameRate != C.RATE_UNSET_INT);
this.editedMediaItem = editedMediaItem;
dataSourceFactory = new DefaultDataSource.Factory(context);
this.listener = listener;
scheduledExecutorService = Executors.newSingleThreadScheduledExecutor();
progressState = PROGRESS_STATE_NOT_STARTED;
}
@Override
@SuppressWarnings("FutureReturnValueIgnored")
public void start() {
progressState = PROGRESS_STATE_AVAILABLE;
listener.onDurationUs(editedMediaItem.durationUs);
listener.onTrackCount(1);
BitmapLoader bitmapLoader = new DataSourceBitmapLoader(context);
BitmapLoader bitmapLoader =
new DataSourceBitmapLoader(
MoreExecutors.listeningDecorator(scheduledExecutorService), dataSourceFactory);
MediaItem.LocalConfiguration localConfiguration =
checkNotNull(editedMediaItem.mediaItem.localConfiguration);
ListenableFuture<Bitmap> future = bitmapLoader.loadBitmap(localConfiguration.uri);
@ -102,21 +118,10 @@ public final class ImageAssetLoader implements AssetLoader {
SUPPORTED_OUTPUT_TYPE_DECODED,
/* streamStartPositionUs= */ 0,
/* streamOffsetUs= */ 0);
SampleConsumer sampleConsumer = listener.onOutputFormat(format);
checkState(editedMediaItem.durationUs != C.TIME_UNSET);
checkState(editedMediaItem.frameRate != C.RATE_UNSET_INT);
// TODO(b/262693274): consider using listener.onDurationUs() or the MediaItem change
// callback (when it's added) rather than setting duration here.
sampleConsumer.queueInputBitmap(
bitmap, editedMediaItem.durationUs, editedMediaItem.frameRate);
sampleConsumer.signalEndOfVideoInput();
} catch (ExportException e) {
listener.onError(e);
scheduledExecutorService.submit(() -> queueBitmapInternal(bitmap, format));
} catch (RuntimeException e) {
listener.onError(ExportException.createForAssetLoader(e, ERROR_CODE_UNSPECIFIED));
}
progress = 100;
}
@Override
@ -124,7 +129,7 @@ public final class ImageAssetLoader implements AssetLoader {
listener.onError(ExportException.createForAssetLoader(t, ERROR_CODE_IO_UNSPECIFIED));
}
},
MoreExecutors.directExecutor());
scheduledExecutorService);
}
@Override
@ -143,5 +148,28 @@ public final class ImageAssetLoader implements AssetLoader {
@Override
public void release() {
progressState = PROGRESS_STATE_NOT_STARTED;
scheduledExecutorService.shutdownNow();
}
@SuppressWarnings("FutureReturnValueIgnored")
private void queueBitmapInternal(Bitmap bitmap, Format format) {
try {
@Nullable SampleConsumer sampleConsumer = listener.onOutputFormat(format);
if (sampleConsumer == null) {
scheduledExecutorService.schedule(
() -> queueBitmapInternal(bitmap, format), QUEUE_BITMAP_INTERVAL_MS, MILLISECONDS);
return;
}
// TODO(b/262693274): consider using listener.onDurationUs() or the MediaItem change
// callback rather than setting duration here.
sampleConsumer.queueInputBitmap(
bitmap, editedMediaItem.durationUs, editedMediaItem.frameRate);
sampleConsumer.signalEndOfVideoInput();
progress = 100;
} catch (ExportException e) {
listener.onError(e);
} catch (RuntimeException e) {
listener.onError(ExportException.createForAssetLoader(e, ERROR_CODE_UNSPECIFIED));
}
}
}

View File

@ -54,6 +54,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
@ -99,8 +100,10 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
private final HandlerThread internalHandlerThread;
private final HandlerWrapper internalHandler;
private final List<CompositeAssetLoader> compositeAssetLoaders;
private final AtomicInteger totalInputTrackCount;
private final AtomicInteger unreportedInputTrackCounts;
private final AtomicInteger trackCountsToReport;
private final AtomicInteger tracksToAdd;
private final AtomicBoolean outputHasAudio;
private final AtomicBoolean outputHasVideo;
private final List<SamplePipeline> samplePipelines;
private final MuxerWrapper muxerWrapper;
private final ConditionVariable transformerConditionVariable;
@ -153,8 +156,10 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
compositeAssetLoaderListener,
clock));
}
totalInputTrackCount = new AtomicInteger();
unreportedInputTrackCounts = new AtomicInteger(composition.sequences.size());
trackCountsToReport = new AtomicInteger(composition.sequences.size());
tracksToAdd = new AtomicInteger();
outputHasAudio = new AtomicBoolean();
outputHasVideo = new AtomicBoolean();
samplePipelines = new ArrayList<>();
transformerConditionVariable = new ConditionVariable();
exportResultBuilder = new ExportResult.Builder();
@ -435,12 +440,8 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
ERROR_CODE_FAILED_RUNTIME_CHECK));
return;
}
totalInputTrackCount.addAndGet(trackCount);
unreportedInputTrackCounts.decrementAndGet();
if (unreportedInputTrackCounts.get() == 0) {
muxerWrapper.setTrackCount(totalInputTrackCount.get());
fallbackListener.setTrackCount(totalInputTrackCount.get());
}
trackCountsToReport.decrementAndGet();
tracksToAdd.addAndGet(trackCount);
}
@Override
@ -449,21 +450,38 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
@AssetLoader.SupportedOutputTypes int supportedOutputTypes,
long streamStartPositionUs,
long streamOffsetUs) {
@C.TrackType
int trackType = getProcessedTrackType(firstAssetLoaderInputFormat.sampleMimeType);
AddedTrackInfo trackInfo =
new AddedTrackInfo(
firstAssetLoaderInputFormat,
supportedOutputTypes,
streamStartPositionUs,
streamOffsetUs);
addedTrackInfoByTrackType.put(trackType, trackInfo);
addedTrackInfoByTrackType.put(
getProcessedTrackType(firstAssetLoaderInputFormat.sampleMimeType), trackInfo);
if (trackType == C.TRACK_TYPE_AUDIO) {
outputHasAudio.set(true);
} else {
outputHasVideo.set(true);
}
if (trackCountsToReport.get() == 0 && tracksToAdd.get() == 1) {
int outputTrackCount = (outputHasAudio.get() ? 1 : 0) + (outputHasVideo.get() ? 1 : 0);
muxerWrapper.setTrackCount(outputTrackCount);
fallbackListener.setTrackCount(outputTrackCount);
}
tracksToAdd.decrementAndGet();
return trackInfo.shouldTranscode;
}
@Nullable
@Override
public SampleConsumer onOutputFormat(Format assetLoaderOutputFormat) throws ExportException {
if (trackCountsToReport.get() > 0 || tracksToAdd.get() > 0) {
return null;
}
@C.TrackType int trackType = getProcessedTrackType(assetLoaderOutputFormat.sampleMimeType);
AddedTrackInfo trackInfo = checkStateNotNull(addedTrackInfoByTrackType.get(trackType));
SamplePipeline samplePipeline = getSamplePipeline(assetLoaderOutputFormat, trackInfo);