diff --git a/libraries/muxer/src/androidTest/java/androidx/media3/muxer/Mp4MuxerEndToEndParameterizedAndroidTest.java b/libraries/muxer/src/androidTest/java/androidx/media3/muxer/Mp4MuxerEndToEndParameterizedAndroidTest.java index f74fb4f523..00f7f2378d 100644 --- a/libraries/muxer/src/androidTest/java/androidx/media3/muxer/Mp4MuxerEndToEndParameterizedAndroidTest.java +++ b/libraries/muxer/src/androidTest/java/androidx/media3/muxer/Mp4MuxerEndToEndParameterizedAndroidTest.java @@ -50,6 +50,8 @@ public class Mp4MuxerEndToEndParameterizedAndroidTest { "bbb_800x640_768kbps_30fps_avc_non_reference_3b.mp4"; private static final String H264_WITH_PYRAMID_B_FRAMES_MP4 = "bbb_800x640_768kbps_30fps_avc_pyramid_3b.mp4"; + private static final String H264_WITH_FIRST_PTS_10_SEC = + "bbb_800x640_768kbps_30fps_avc_2b_firstpts_10_sec.mp4"; private static final String H265_HDR10_MP4 = "hdr10-720p.mp4"; private static final String H265_WITH_METADATA_TRACK_MP4 = "h265_with_metadata_track.mp4"; private static final String AV1_MP4 = "sample_av1.mp4"; @@ -71,6 +73,7 @@ public class Mp4MuxerEndToEndParameterizedAndroidTest { H264_MP4, H264_WITH_NON_REFERENCE_B_FRAMES_MP4, H264_WITH_PYRAMID_B_FRAMES_MP4, + H264_WITH_FIRST_PTS_10_SEC, H265_HDR10_MP4, H265_WITH_METADATA_TRACK_MP4, AV1_MP4, diff --git a/libraries/muxer/src/main/java/androidx/media3/muxer/Boxes.java b/libraries/muxer/src/main/java/androidx/media3/muxer/Boxes.java index 153f423406..1f9b7246f5 100644 --- a/libraries/muxer/src/main/java/androidx/media3/muxer/Boxes.java +++ b/libraries/muxer/src/main/java/androidx/media3/muxer/Boxes.java @@ -21,6 +21,7 @@ import static androidx.media3.common.util.Assertions.checkState; import static androidx.media3.muxer.ColorUtils.MEDIAFORMAT_STANDARD_TO_PRIMARIES_AND_MATRIX; import static androidx.media3.muxer.ColorUtils.MEDIAFORMAT_TRANSFER_TO_MP4_TRANSFER; import static androidx.media3.muxer.MuxerUtil.UNSIGNED_INT_MAX_VALUE; +import static java.lang.Math.abs; import static java.lang.Math.max; import static java.lang.Math.min; import static java.nio.charset.StandardCharsets.UTF_8; @@ -154,7 +155,6 @@ import org.checkerframework.checker.nullness.qual.PolyNull; List sampleDurationsVu = convertPresentationTimestampsToDurationsVu( track.writtenSamples, - minInputPtsUs, track.videoUnitTimebase(), lastSampleDurationBehavior, track.endOfStreamTimestampUs); @@ -164,6 +164,8 @@ import org.checkerframework.checker.nullness.qual.PolyNull; trackDurationInTrackUnitsVu += sampleDurationsVu.get(j); } + long firstInputPtsUs = + track.writtenSamples.isEmpty() ? 0 : track.writtenSamples.get(0).presentationTimeUs; long trackDurationUs = usFromVu(trackDurationInTrackUnitsVu, track.videoUnitTimebase()); @C.TrackType int trackType = MimeTypes.getTrackType(format.sampleMimeType); @@ -224,6 +226,12 @@ import org.checkerframework.checker.nullness.qual.PolyNull; modificationTimestampSeconds, metadataCollector.orientationData.orientation, format), + edts( + firstInputPtsUs, + minInputPtsUs, + trackDurationUs, + MVHD_TIMEBASE, + track.videoUnitTimebase()), mdia( mdhd( trackDurationInTrackUnitsVu, @@ -772,19 +780,77 @@ import org.checkerframework.checker.nullness.qual.PolyNull; return BoxUtils.wrapIntoBox(fourcc, contents); } + /** Returns the edts (edit) box. */ + public static ByteBuffer edts( + long firstInputPtsUs, + long minInputPtsUs, + long trackDurationUs, + long mvhdTimescale, + long trackTimescale) { + // If the minInputPtsUs is positive, then subtract it from all tracks. This ensures that at + // least one track starts at zero, with others starting relative to that. + if (minInputPtsUs > 0) { + firstInputPtsUs -= minInputPtsUs; + } + // Return an empty box if the first presentation timestamp is 0. + return firstInputPtsUs != 0 + ? BoxUtils.wrapIntoBox( + "edts", elst(firstInputPtsUs, trackDurationUs, mvhdTimescale, trackTimescale)) + : ByteBuffer.allocate(0); + } + + /** Returns an elst (edit list) entry. */ + private static ByteBuffer elstEntry( + long editDurationVu, long mediaTimeVu, int mediaRateInt, int mediaRateFraction) { + ByteBuffer contents = ByteBuffer.allocate(20); + contents.putLong(editDurationVu); + contents.putLong(mediaTimeVu); + contents.putShort((short) mediaRateInt); + contents.putShort((short) mediaRateFraction); + contents.flip(); + return contents; + } + + /** Returns the elst (edit list) box. */ + private static ByteBuffer elst( + long firstSamplePtsUs, long trackDurationUs, long mvhdTimescale, long trackTimescale) { + ByteBuffer elstContent = ByteBuffer.allocate(50); + int versionAndFlags = 1 << 24; // version (value 1, 8 bits) + flag (value 0, 24 bits) + elstContent.putInt(versionAndFlags); + if (firstSamplePtsUs > 0) { + elstContent.putInt(2); // Entry count + // Add an empty list to represent starting offset of a track. + elstContent.put( + elstEntry( + /* editDurationVu= */ vuFromUs(firstSamplePtsUs, mvhdTimescale), + /* mediaTimeVu= */ -1, + /* mediaRateInt= */ 1, + /* mediaRateFraction= */ 0)); + elstContent.put( + elstEntry( + /* editDurationVu= */ vuFromUs(trackDurationUs, mvhdTimescale), + /* mediaTimeVu= */ 0, + /* mediaRateInt= */ 1, + /* mediaRateFraction= */ 0)); + } else { + // Indicates that the samples with the negative timestamps should not be rendered. + elstContent.putInt(1); // Entry count + elstContent.put( + elstEntry( + /* editDurationVu= */ vuFromUs( + trackDurationUs - abs(firstSamplePtsUs), mvhdTimescale), + /* mediaTimeVu= */ vuFromUs(abs(firstSamplePtsUs), trackTimescale), + /* mediaRateInt= */ 1, + /* mediaRateFraction= */ 0)); + } + elstContent.flip(); + return BoxUtils.wrapIntoBox("elst", elstContent); + } + /** * Converts sample presentation times (in microseconds) to sample durations (in timebase units). * - *

All the tracks must start from the same time. If all the tracks do not start from the same - * time, then the caller must pass the minimum presentation timestamp across all tracks to be set - * for the first sample. As a result, the duration of that first sample may be larger. - * * @param samplesInfo A list of {@linkplain BufferInfo sample info}. - * @param firstSamplePresentationTimeUs The presentation timestamp to override the first sample's - * presentation timestamp, in microseconds. This should be the minimum presentation timestamp - * across all tracks if the {@code samplesInfo} contains the first sample of the track. - * Otherwise this should be equal to the presentation timestamp of first sample present in the - * {@code samplesInfo} list. * @param videoUnitTimescale The timescale of the track. * @param lastSampleDurationBehavior The behaviour for the last sample duration. * @param endOfStreamTimestampUs The timestamp (in microseconds) of the end of stream sample. @@ -792,7 +858,6 @@ import org.checkerframework.checker.nullness.qual.PolyNull; */ public static List convertPresentationTimestampsToDurationsVu( List samplesInfo, - long firstSamplePresentationTimeUs, int videoUnitTimescale, @Mp4Muxer.LastSampleDurationBehavior int lastSampleDurationBehavior, long endOfStreamTimestampUs) { @@ -818,7 +883,7 @@ import org.checkerframework.checker.nullness.qual.PolyNull; Collections.sort(presentationTimestampsUs); } - long currentSampleTimeUs = firstSamplePresentationTimeUs; + long currentSampleTimeUs = presentationTimestampsUs.get(0); for (int nextSampleId = 1; nextSampleId < presentationTimestampsUs.size(); nextSampleId++) { long nextSampleTimeUs = presentationTimestampsUs.get(nextSampleId); long currentSampleDurationVu = diff --git a/libraries/muxer/src/main/java/androidx/media3/muxer/FragmentedMp4Writer.java b/libraries/muxer/src/main/java/androidx/media3/muxer/FragmentedMp4Writer.java index 35f044c339..4c967ed585 100644 --- a/libraries/muxer/src/main/java/androidx/media3/muxer/FragmentedMp4Writer.java +++ b/libraries/muxer/src/main/java/androidx/media3/muxer/FragmentedMp4Writer.java @@ -326,9 +326,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; List sampleDurations = Boxes.convertPresentationTimestampsToDurationsVu( pendingSamplesBufferInfo, - /* firstSamplePresentationTimeUs= */ currentFragmentSequenceNumber == 1 - ? minInputPresentationTimeUs - : pendingSamplesBufferInfo.get(0).presentationTimeUs, track.videoUnitTimebase(), LAST_SAMPLE_DURATION_BEHAVIOR_SET_FROM_END_OF_STREAM_BUFFER_OR_DUPLICATE_PREVIOUS, track.endOfStreamTimestampUs); diff --git a/libraries/muxer/src/test/java/androidx/media3/muxer/BoxesTest.java b/libraries/muxer/src/test/java/androidx/media3/muxer/BoxesTest.java index db598f46a9..60e191857e 100644 --- a/libraries/muxer/src/test/java/androidx/media3/muxer/BoxesTest.java +++ b/libraries/muxer/src/test/java/androidx/media3/muxer/BoxesTest.java @@ -95,6 +95,49 @@ public class BoxesTest { context, dumpableBox, getExpectedDumpFilePath("audio_track_tkhd_box")); } + @Test + public void createEdtsBox_forZeroStartTimeTrack_matchesExpected() throws IOException { + ByteBuffer edtsBox = + Boxes.edts( + /* firstInputPtsUs= */ 0L, + /* minInputPtsUs= */ 0L, + /* trackDurationUs= */ 1_000_000L, + /* mvhdTimescale= */ 10_000L, + /* trackTimescale= */ 90_000L); + + assertThat(edtsBox.limit()).isEqualTo(0); + } + + @Test + public void createEdtsBox_forPositiveStartTimeTrack_matchesExpected() throws IOException { + ByteBuffer edtsBox = + Boxes.edts( + /* firstInputPtsUs= */ 10_000L, + /* minInputPtsUs= */ 0L, + /* trackDurationUs= */ 1_000_000L, + /* mvhdTimescale= */ 10_000L, + /* trackTimescale= */ 90_000L); + + DumpableMp4Box dumpableBox = new DumpableMp4Box(edtsBox); + DumpFileAsserts.assertOutput( + context, dumpableBox, getExpectedDumpFilePath("positive_start_time_edts_box")); + } + + @Test + public void createEdtsBox_forNegativeStartTimeTrack_matchesExpected() throws IOException { + ByteBuffer edtsBox = + Boxes.edts( + /* firstInputPtsUs= */ -10_000L, + /* minInputPtsUs= */ -20_000L, + /* trackDurationUs= */ 1_000_000L, + /* mvhdTimescale= */ 10_000L, + /* trackTimescale= */ 90_000L); + + DumpableMp4Box dumpableBox = new DumpableMp4Box(edtsBox); + DumpFileAsserts.assertOutput( + context, dumpableBox, getExpectedDumpFilePath("negative_start_time_edts_box")); + } + @Test public void createMvhdBox_matchesExpected() throws IOException { ByteBuffer mvhdBox = @@ -480,7 +523,6 @@ public class BoxesTest { List durationsVu = Boxes.convertPresentationTimestampsToDurationsVu( sampleBufferInfos, - /* firstSamplePresentationTimeUs= */ 0L, VU_TIMEBASE, LAST_SAMPLE_DURATION_BEHAVIOR_SET_TO_ZERO, C.TIME_UNSET); @@ -497,7 +539,6 @@ public class BoxesTest { List durationsVu = Boxes.convertPresentationTimestampsToDurationsVu( sampleBufferInfos, - /* firstSamplePresentationTimeUs= */ 0L, VU_TIMEBASE, LAST_SAMPLE_DURATION_BEHAVIOR_SET_TO_ZERO, C.TIME_UNSET); @@ -514,7 +555,6 @@ public class BoxesTest { List durationsVu = Boxes.convertPresentationTimestampsToDurationsVu( sampleBufferInfos, - /* firstSamplePresentationTimeUs= */ 0L, VU_TIMEBASE, LAST_SAMPLE_DURATION_BEHAVIOR_SET_TO_ZERO, C.TIME_UNSET); @@ -531,7 +571,6 @@ public class BoxesTest { List durationsVu = Boxes.convertPresentationTimestampsToDurationsVu( sampleBufferInfos, - /* firstSamplePresentationTimeUs= */ 0L, VU_TIMEBASE, LAST_SAMPLE_DURATION_BEHAVIOR_SET_FROM_END_OF_STREAM_BUFFER_OR_DUPLICATE_PREVIOUS, C.TIME_UNSET); @@ -548,7 +587,6 @@ public class BoxesTest { List durationsVu = Boxes.convertPresentationTimestampsToDurationsVu( sampleBufferInfos, - /* firstSamplePresentationTimeUs= */ 0L, VU_TIMEBASE, LAST_SAMPLE_DURATION_BEHAVIOR_SET_TO_ZERO, C.TIME_UNSET); @@ -565,7 +603,6 @@ public class BoxesTest { List durationsVu = Boxes.convertPresentationTimestampsToDurationsVu( sampleBufferInfos, - /* firstSamplePresentationTimeUs= */ 0L, VU_TIMEBASE, LAST_SAMPLE_DURATION_BEHAVIOR_SET_FROM_END_OF_STREAM_BUFFER_OR_DUPLICATE_PREVIOUS, /* endOfStreamTimestampUs= */ 10_000); @@ -620,7 +657,6 @@ public class BoxesTest { List durationsVu = Boxes.convertPresentationTimestampsToDurationsVu( sampleBufferInfos, - /* firstSamplePresentationTimeUs= */ 0L, VU_TIMEBASE, LAST_SAMPLE_DURATION_BEHAVIOR_SET_TO_ZERO, C.TIME_UNSET); @@ -638,7 +674,6 @@ public class BoxesTest { List durationsVu = Boxes.convertPresentationTimestampsToDurationsVu( sampleBufferInfos, - /* firstSamplePresentationTimeUs= */ 0L, VU_TIMEBASE, LAST_SAMPLE_DURATION_BEHAVIOR_SET_TO_ZERO, C.TIME_UNSET); @@ -658,7 +693,6 @@ public class BoxesTest { List durationsVu = Boxes.convertPresentationTimestampsToDurationsVu( sampleBufferInfos, - /* firstSamplePresentationTimeUs= */ 0L, VU_TIMEBASE, LAST_SAMPLE_DURATION_BEHAVIOR_SET_TO_ZERO, C.TIME_UNSET); @@ -679,7 +713,6 @@ public class BoxesTest { List durationsVu = Boxes.convertPresentationTimestampsToDurationsVu( sampleBufferInfos, - /* firstSamplePresentationTimeUs= */ 23698215060L, VU_TIMEBASE, LAST_SAMPLE_DURATION_BEHAVIOR_SET_TO_ZERO, C.TIME_UNSET); diff --git a/libraries/muxer/src/test/java/androidx/media3/muxer/Mp4MuxerEndToEndTest.java b/libraries/muxer/src/test/java/androidx/media3/muxer/Mp4MuxerEndToEndTest.java index 82661b8454..c5c4c30c39 100644 --- a/libraries/muxer/src/test/java/androidx/media3/muxer/Mp4MuxerEndToEndTest.java +++ b/libraries/muxer/src/test/java/androidx/media3/muxer/Mp4MuxerEndToEndTest.java @@ -192,7 +192,7 @@ public class Mp4MuxerEndToEndTest { mp4Muxer.close(); } - // The presentation time of second track's first sample is forcefully changed to 0L. + // The presentation time of second track's first sample is retained through edit box. FakeExtractorOutput fakeExtractorOutput = TestUtil.extractAllSamplesFromFilePath( new Mp4Extractor(new DefaultSubtitleParserFactory()), outputFilePath); @@ -202,6 +202,43 @@ public class Mp4MuxerEndToEndTest { MuxerTestUtil.getExpectedDumpFilePath("mp4_with_different_tracks_offset.mp4")); } + @Test + public void createMp4File_withNegativeTracksOffset_matchesExpected() throws Exception { + String outputFilePath = temporaryFolder.newFile().getPath(); + Mp4Muxer mp4Muxer = new Mp4Muxer.Builder(new FileOutputStream(outputFilePath)).build(); + mp4Muxer.addMetadataEntry( + new Mp4TimestampData( + /* creationTimestampSeconds= */ 100_000_000L, + /* modificationTimestampSeconds= */ 500_000_000L)); + Pair track1Sample1 = + getFakeSampleAndSampleInfo(/* presentationTimeUs= */ -100L); + Pair track1Sample2 = + getFakeSampleAndSampleInfo(/* presentationTimeUs= */ 100L); + Pair track1Sample3 = + getFakeSampleAndSampleInfo(/* presentationTimeUs= */ 300L); + + try { + TrackToken track1 = mp4Muxer.addTrack(FAKE_VIDEO_FORMAT); + mp4Muxer.writeSampleData(track1, track1Sample1.first, track1Sample1.second); + mp4Muxer.writeSampleData(track1, track1Sample2.first, track1Sample2.second); + mp4Muxer.writeSampleData(track1, track1Sample3.first, track1Sample3.second); + } finally { + mp4Muxer.close(); + } + + // Presentation timestamps in dump file are: + // Track 1 Sample 1 = -100L + // Track 1 Sample 2 = 100L + // Track 1 Sample 3 = 300L + FakeExtractorOutput fakeExtractorOutput = + TestUtil.extractAllSamplesFromFilePath( + new Mp4Extractor(new DefaultSubtitleParserFactory()), outputFilePath); + DumpFileAsserts.assertOutput( + context, + fakeExtractorOutput, + MuxerTestUtil.getExpectedDumpFilePath("mp4_with_negative_tracks_offset.mp4")); + } + @Test public void createMp4File_withOutOfOrderBframes_matchesExpected() throws Exception { String outputFilePath = temporaryFolder.newFile().getPath(); @@ -254,6 +291,14 @@ public class Mp4MuxerEndToEndTest { getFakeSampleAndSampleInfo(/* presentationTimeUs= */ 23_000_132_928L); Pair track1Sample4 = getFakeSampleAndSampleInfo(/* presentationTimeUs= */ 23_000_033_192L); + Pair track2Sample1 = + getFakeSampleAndSampleInfo(/* presentationTimeUs= */ 23_001_000_000L); + Pair track2Sample2 = + getFakeSampleAndSampleInfo(/* presentationTimeUs= */ 23_001_273_908L); + Pair track2Sample3 = + getFakeSampleAndSampleInfo(/* presentationTimeUs= */ 23_001_132_928L); + Pair track2Sample4 = + getFakeSampleAndSampleInfo(/* presentationTimeUs= */ 23_001_033_192L); try { TrackToken track1 = mp4Muxer.addTrack(FAKE_VIDEO_FORMAT); @@ -261,6 +306,11 @@ public class Mp4MuxerEndToEndTest { mp4Muxer.writeSampleData(track1, track1Sample2.first, track1Sample2.second); mp4Muxer.writeSampleData(track1, track1Sample3.first, track1Sample3.second); mp4Muxer.writeSampleData(track1, track1Sample4.first, track1Sample4.second); + TrackToken track2 = mp4Muxer.addTrack(FAKE_VIDEO_FORMAT); + mp4Muxer.writeSampleData(track2, track2Sample1.first, track2Sample1.second); + mp4Muxer.writeSampleData(track2, track2Sample2.first, track2Sample2.second); + mp4Muxer.writeSampleData(track2, track2Sample3.first, track2Sample3.second); + mp4Muxer.writeSampleData(track2, track2Sample4.first, track2Sample4.second); } finally { mp4Muxer.close(); } diff --git a/libraries/test_data/src/test/assets/media/mp4/bbb_800x640_768kbps_30fps_avc_2b_firstpts_10_sec.mp4 b/libraries/test_data/src/test/assets/media/mp4/bbb_800x640_768kbps_30fps_avc_2b_firstpts_10_sec.mp4 new file mode 100644 index 0000000000..5798258539 Binary files /dev/null and b/libraries/test_data/src/test/assets/media/mp4/bbb_800x640_768kbps_30fps_avc_2b_firstpts_10_sec.mp4 differ diff --git a/libraries/test_data/src/test/assets/muxerdumps/bbb_800x640_768kbps_30fps_avc_2b_firstpts_10_sec.mp4.dump b/libraries/test_data/src/test/assets/muxerdumps/bbb_800x640_768kbps_30fps_avc_2b_firstpts_10_sec.mp4.dump new file mode 100644 index 0000000000..5284a87a06 --- /dev/null +++ b/libraries/test_data/src/test/assets/muxerdumps/bbb_800x640_768kbps_30fps_avc_2b_firstpts_10_sec.mp4.dump @@ -0,0 +1,508 @@ +seekMap: + isSeekable = true + duration = 4000000 + getPosition(0) = [[timeUs=0, position=400052]] + getPosition(1) = [[timeUs=0, position=400052]] + getPosition(2000000) = [[timeUs=0, position=400052]] + getPosition(4000000) = [[timeUs=0, position=400052]] +numberOfTracks = 1 +track 0: + total output bytes = 299922 + sample count = 120 + format 0: + id = 1 + sampleMimeType = video/avc + codecs = avc1.64001F + maxInputSize = 56252 + maxNumReorderSamples = 2 + width = 800 + height = 640 + frameRate = 30.00 + colorInfo: + lumaBitdepth = 8 + chromaBitdepth = 8 + metadata = entries=[Mp4Timestamp: creation time=100000000, modification time=500000000, timescale=10000] + initializationData: + data = length 33, hash E354B60D + data = length 10, hash 7A0D0F2B + sample 0: + time = 0 + flags = 1 + data = length 56222, hash 8B11262A + sample 1: + time = 133333 + flags = 0 + data = length 2309, hash 8BD40493 + sample 2: + time = 66666 + flags = 0 + data = length 1072, hash 1C517FCB + sample 3: + time = 33333 + flags = 0 + data = length 341, hash CEAA2DBB + sample 4: + time = 100000 + flags = 0 + data = length 721, hash 358E2671 + sample 5: + time = 166666 + flags = 0 + data = length 792, hash 5F79CA7C + sample 6: + time = 200000 + flags = 0 + data = length 34513, hash 99B0B4D7 + sample 7: + time = 333333 + flags = 0 + data = length 617, hash 7299D29D + sample 8: + time = 266666 + flags = 0 + data = length 177, hash 763D378 + sample 9: + time = 233333 + flags = 0 + data = length 119, hash 3DB07F2 + sample 10: + time = 300000 + flags = 0 + data = length 116, hash 17427DB + sample 11: + time = 466666 + flags = 0 + data = length 563, hash CA9E382B + sample 12: + time = 400000 + flags = 0 + data = length 257, hash 759A3120 + sample 13: + time = 366666 + flags = 0 + data = length 98, hash 7ECAA85C + sample 14: + time = 433333 + flags = 0 + data = length 128, hash 4A19D0E4 + sample 15: + time = 600000 + flags = 0 + data = length 2293, hash 1E30DD74 + sample 16: + time = 533333 + flags = 0 + data = length 1168, hash 414B6A20 + sample 17: + time = 500000 + flags = 0 + data = length 400, hash 5341224E + sample 18: + time = 566666 + flags = 0 + data = length 632, hash 8F1AF258 + sample 19: + time = 700000 + flags = 0 + data = length 1777, hash 9C9ADBD + sample 20: + time = 633333 + flags = 0 + data = length 638, hash BA291A36 + sample 21: + time = 666666 + flags = 0 + data = length 433, hash 2DE4D9CA + sample 22: + time = 733333 + flags = 0 + data = length 2423, hash 3DC4FE1B + sample 23: + time = 833333 + flags = 0 + data = length 4702, hash D0EF6816 + sample 24: + time = 766666 + flags = 0 + data = length 824, hash AE138727 + sample 25: + time = 800000 + flags = 0 + data = length 897, hash 96F4B8C9 + sample 26: + time = 866666 + flags = 0 + data = length 3600, hash 67877CF6 + sample 27: + time = 966666 + flags = 0 + data = length 3641, hash B8CDE0D6 + sample 28: + time = 900000 + flags = 0 + data = length 552, hash 8A1DC9BC + sample 29: + time = 933333 + flags = 0 + data = length 347, hash 54092001 + sample 30: + time = 1066666 + flags = 0 + data = length 2889, hash 652A194F + sample 31: + time = 1000000 + flags = 0 + data = length 417, hash 28831907 + sample 32: + time = 1033333 + flags = 0 + data = length 210, hash 1E356FE5 + sample 33: + time = 1166666 + flags = 0 + data = length 2228, hash 710E8D3F + sample 34: + time = 1100000 + flags = 0 + data = length 416, hash 3D730845 + sample 35: + time = 1133333 + flags = 0 + data = length 226, hash 4FAC0407 + sample 36: + time = 1300000 + flags = 0 + data = length 18728, hash BF70415D + sample 37: + time = 1233333 + flags = 0 + data = length 1335, hash 16B3AFB3 + sample 38: + time = 1200000 + flags = 0 + data = length 810, hash 6DD80172 + sample 39: + time = 1266666 + flags = 0 + data = length 333, hash 5344DC3A + sample 40: + time = 1400000 + flags = 0 + data = length 3476, hash 7642AE9C + sample 41: + time = 1333333 + flags = 0 + data = length 572, hash 4B05FB5F + sample 42: + time = 1366666 + flags = 0 + data = length 252, hash C0BBBE0 + sample 43: + time = 1500000 + flags = 0 + data = length 3150, hash 5CF827A2 + sample 44: + time = 1433333 + flags = 0 + data = length 443, hash FE17394D + sample 45: + time = 1466666 + flags = 0 + data = length 234, hash C08793EE + sample 46: + time = 1633333 + flags = 0 + data = length 3109, hash 91C22057 + sample 47: + time = 1566666 + flags = 0 + data = length 672, hash E07EAEAC + sample 48: + time = 1533333 + flags = 0 + data = length 409, hash 860C229E + sample 49: + time = 1600000 + flags = 0 + data = length 393, hash 593D091E + sample 50: + time = 1766666 + flags = 0 + data = length 4499, hash 768963B4 + sample 51: + time = 1700000 + flags = 0 + data = length 758, hash 78AF296A + sample 52: + time = 1666666 + flags = 0 + data = length 262, hash 1BD840DE + sample 53: + time = 1733333 + flags = 0 + data = length 570, hash D720DDCE + sample 54: + time = 1900000 + flags = 0 + data = length 4975, hash 2D0B435A + sample 55: + time = 1833333 + flags = 0 + data = length 1512, hash 15AD5ED1 + sample 56: + time = 1800000 + flags = 0 + data = length 1211, hash 240D4D76 + sample 57: + time = 1866666 + flags = 0 + data = length 555, hash 7165F0E1 + sample 58: + time = 2000000 + flags = 0 + data = length 6906, hash A76ED09E + sample 59: + time = 1933333 + flags = 0 + data = length 1324, hash 6630341C + sample 60: + time = 1966666 + flags = 0 + data = length 1113, hash 2CE419CB + sample 61: + time = 2100000 + flags = 0 + data = length 6594, hash 4EBDF858 + sample 62: + time = 2033333 + flags = 0 + data = length 1658, hash 6FD30E25 + sample 63: + time = 2066666 + flags = 0 + data = length 711, hash 1BFD9623 + sample 64: + time = 2166666 + flags = 0 + data = length 2389, hash DA32F47A + sample 65: + time = 2133333 + flags = 0 + data = length 924, hash A52273EB + sample 66: + time = 2300000 + flags = 0 + data = length 18090, hash F9B61BB4 + sample 67: + time = 2233333 + flags = 0 + data = length 1722, hash 21765422 + sample 68: + time = 2200000 + flags = 0 + data = length 1002, hash ECD9E400 + sample 69: + time = 2266666 + flags = 0 + data = length 483, hash 7D7026EF + sample 70: + time = 2366666 + flags = 0 + data = length 3148, hash 36BC693B + sample 71: + time = 2333333 + flags = 0 + data = length 751, hash 4128839C + sample 72: + time = 2466666 + flags = 0 + data = length 5143, hash 29EB5CBF + sample 73: + time = 2400000 + flags = 0 + data = length 1262, hash 2E678B4A + sample 74: + time = 2433333 + flags = 0 + data = length 2051, hash 673F7005 + sample 75: + time = 2500000 + flags = 0 + data = length 5527, hash 63E719BB + sample 76: + time = 2633333 + flags = 0 + data = length 9411, hash 7EB7F147 + sample 77: + time = 2566666 + flags = 0 + data = length 1644, hash 6890A9E + sample 78: + time = 2533333 + flags = 0 + data = length 2066, hash 3E108A79 + sample 79: + time = 2600000 + flags = 0 + data = length 357, hash 9F3F46CA + sample 80: + time = 2733333 + flags = 0 + data = length 3240, hash EAB2D17E + sample 81: + time = 2666666 + flags = 0 + data = length 552, hash 9EB5AB6F + sample 82: + time = 2700000 + flags = 0 + data = length 267, hash 4DE266C7 + sample 83: + time = 2833333 + flags = 0 + data = length 2412, hash F7E0D2E3 + sample 84: + time = 2766666 + flags = 0 + data = length 442, hash 84A6016C + sample 85: + time = 2800000 + flags = 0 + data = length 246, hash 15E324CB + sample 86: + time = 2933333 + flags = 0 + data = length 2859, hash A5F29E33 + sample 87: + time = 2866666 + flags = 0 + data = length 456, hash AE0BFF63 + sample 88: + time = 2900000 + flags = 0 + data = length 329, hash A7C440BB + sample 89: + time = 3033333 + flags = 0 + data = length 3575, hash 854F101F + sample 90: + time = 2966666 + flags = 0 + data = length 644, hash 3971EF67 + sample 91: + time = 3000000 + flags = 0 + data = length 379, hash 957A7C64 + sample 92: + time = 3166666 + flags = 0 + data = length 3171, hash E6980453 + sample 93: + time = 3100000 + flags = 0 + data = length 571, hash 68AEF974 + sample 94: + time = 3066666 + flags = 0 + data = length 515, hash 4AF1201B + sample 95: + time = 3133333 + flags = 0 + data = length 314, hash 2FC434E9 + sample 96: + time = 3300000 + flags = 0 + data = length 12330, hash 3163E200 + sample 97: + time = 3233333 + flags = 0 + data = length 954, hash 4C595D28 + sample 98: + time = 3200000 + flags = 0 + data = length 543, hash 254B4BFA + sample 99: + time = 3266666 + flags = 0 + data = length 288, hash A34C978F + sample 100: + time = 3433333 + flags = 0 + data = length 3475, hash 45B06B96 + sample 101: + time = 3366666 + flags = 0 + data = length 703, hash DAFBF3D0 + sample 102: + time = 3333333 + flags = 0 + data = length 455, hash A17E5A07 + sample 103: + time = 3400000 + flags = 0 + data = length 348, hash A6260498 + sample 104: + time = 3566666 + flags = 0 + data = length 2441, hash 5E47866A + sample 105: + time = 3500000 + flags = 0 + data = length 492, hash 44DCDBBA + sample 106: + time = 3466666 + flags = 0 + data = length 349, hash 603A6F91 + sample 107: + time = 3533333 + flags = 0 + data = length 180, hash B6EA9F51 + sample 108: + time = 3700000 + flags = 0 + data = length 1032, hash B8014F9A + sample 109: + time = 3633333 + flags = 0 + data = length 331, hash C02F3C83 + sample 110: + time = 3600000 + flags = 0 + data = length 167, hash 9824D4E8 + sample 111: + time = 3666666 + flags = 0 + data = length 194, hash 2DC7F1D7 + sample 112: + time = 3833333 + flags = 0 + data = length 1149, hash 3471EA3E + sample 113: + time = 3766666 + flags = 0 + data = length 484, hash B33D9C67 + sample 114: + time = 3733333 + flags = 0 + data = length 264, hash 8E6C96EF + sample 115: + time = 3800000 + flags = 0 + data = length 294, hash 36C8898C + sample 116: + time = 3966666 + flags = 0 + data = length 1023, hash AB618F21 + sample 117: + time = 3900000 + flags = 0 + data = length 559, hash 91CA32EA + sample 118: + time = 3866666 + flags = 0 + data = length 197, hash AA87B8D8 + sample 119: + time = 3933333 + flags = 536870912 + data = length 406, hash 2DE88209 +tracksEnded = true diff --git a/libraries/test_data/src/test/assets/muxerdumps/bbb_mono_16kHz_23.05kbps_amrwb.3gp.dump b/libraries/test_data/src/test/assets/muxerdumps/bbb_mono_16kHz_23.05kbps_amrwb.3gp.dump index c91c0aa549..c8eb4cfb14 100644 --- a/libraries/test_data/src/test/assets/muxerdumps/bbb_mono_16kHz_23.05kbps_amrwb.3gp.dump +++ b/libraries/test_data/src/test/assets/muxerdumps/bbb_mono_16kHz_23.05kbps_amrwb.3gp.dump @@ -15,6 +15,7 @@ track 0: maxInputSize = 89 channelCount = 1 sampleRate = 16000 + encoderDelay = 80 language = und metadata = entries=[Mp4Timestamp: creation time=100000000, modification time=500000000, timescale=10000] sample 0: diff --git a/libraries/test_data/src/test/assets/muxerdumps/bbb_mono_8kHz_12.2kbps_amrnb.3gp.dump b/libraries/test_data/src/test/assets/muxerdumps/bbb_mono_8kHz_12.2kbps_amrnb.3gp.dump index bb7c3c74f3..db6b3b6940 100644 --- a/libraries/test_data/src/test/assets/muxerdumps/bbb_mono_8kHz_12.2kbps_amrnb.3gp.dump +++ b/libraries/test_data/src/test/assets/muxerdumps/bbb_mono_8kHz_12.2kbps_amrnb.3gp.dump @@ -18,607 +18,607 @@ track 0: language = und metadata = entries=[Mp4Timestamp: creation time=100000000, modification time=500000000, timescale=10000] sample 0: - time = 0 + time = -6250 flags = 1 data = length 32, hash 53582FC7 sample 1: - time = 20000 + time = 13750 flags = 1 data = length 32, hash 5685F9D6 sample 2: - time = 40000 + time = 33750 flags = 1 data = length 32, hash 979442D3 sample 3: - time = 60000 + time = 53750 flags = 1 data = length 32, hash D6C2D2B3 sample 4: - time = 80000 + time = 73750 flags = 1 data = length 32, hash 4D7A467C sample 5: - time = 100000 + time = 93750 flags = 1 data = length 32, hash D24FBF21 sample 6: - time = 120000 + time = 113750 flags = 1 data = length 32, hash 39A010D0 sample 7: - time = 140000 + time = 133750 flags = 1 data = length 32, hash 238FB065 sample 8: - time = 160000 + time = 153750 flags = 1 data = length 32, hash 7F460D8F sample 9: - time = 180000 + time = 173750 flags = 1 data = length 32, hash 4144D57A sample 10: - time = 200000 + time = 193750 flags = 1 data = length 32, hash 17FAFC32 sample 11: - time = 220000 + time = 213750 flags = 1 data = length 32, hash BBB92AF1 sample 12: - time = 240000 + time = 233750 flags = 1 data = length 32, hash 8662DF11 sample 13: - time = 260000 + time = 253750 flags = 1 data = length 32, hash ADE12517 sample 14: - time = 280000 + time = 273750 flags = 1 data = length 32, hash 42A2F90 sample 15: - time = 300000 + time = 293750 flags = 1 data = length 32, hash BA4736EE sample 16: - time = 320000 + time = 313750 flags = 1 data = length 32, hash DC3899EE sample 17: - time = 340000 + time = 333750 flags = 1 data = length 32, hash 9680E057 sample 18: - time = 360000 + time = 353750 flags = 1 data = length 32, hash 9DD4439A sample 19: - time = 380000 + time = 373750 flags = 1 data = length 32, hash A187A2E8 sample 20: - time = 400000 + time = 393750 flags = 1 data = length 32, hash 2181AFA7 sample 21: - time = 420000 + time = 413750 flags = 1 data = length 32, hash 2C46A44 sample 22: - time = 440000 + time = 433750 flags = 1 data = length 32, hash 45492E08 sample 23: - time = 460000 + time = 453750 flags = 1 data = length 32, hash 7E8B40BC sample 24: - time = 480000 + time = 473750 flags = 1 data = length 32, hash 8A572FB6 sample 25: - time = 500000 + time = 493750 flags = 1 data = length 32, hash 271382F7 sample 26: - time = 520000 + time = 513750 flags = 1 data = length 32, hash 31B52A2C sample 27: - time = 540000 + time = 533750 flags = 1 data = length 32, hash 1C0C6ACD sample 28: - time = 560000 + time = 553750 flags = 1 data = length 32, hash 12AF988B sample 29: - time = 580000 + time = 573750 flags = 1 data = length 32, hash 1EC318A2 sample 30: - time = 600000 + time = 593750 flags = 1 data = length 32, hash F0082E10 sample 31: - time = 620000 + time = 613750 flags = 1 data = length 32, hash 6F21FBC4 sample 32: - time = 640000 + time = 633750 flags = 1 data = length 32, hash A52D353D sample 33: - time = 660000 + time = 653750 flags = 1 data = length 32, hash C1B9C8E2 sample 34: - time = 680000 + time = 673750 flags = 1 data = length 32, hash 3BC2F23F sample 35: - time = 700000 + time = 693750 flags = 1 data = length 32, hash 7ACFCF02 sample 36: - time = 720000 + time = 713750 flags = 1 data = length 32, hash 296A9084 sample 37: - time = 740000 + time = 733750 flags = 1 data = length 32, hash 87B5C8E2 sample 38: - time = 760000 + time = 753750 flags = 1 data = length 32, hash C1C5851 sample 39: - time = 780000 + time = 773750 flags = 1 data = length 32, hash AD17B487 sample 40: - time = 800000 + time = 793750 flags = 1 data = length 32, hash E6806069 sample 41: - time = 820000 + time = 813750 flags = 1 data = length 32, hash AB5007B5 sample 42: - time = 840000 + time = 833750 flags = 1 data = length 32, hash 29DA3044 sample 43: - time = 860000 + time = 853750 flags = 1 data = length 32, hash 680DE283 sample 44: - time = 880000 + time = 873750 flags = 1 data = length 32, hash E5BB6CEF sample 45: - time = 900000 + time = 893750 flags = 1 data = length 32, hash 654EFBD4 sample 46: - time = 920000 + time = 913750 flags = 1 data = length 32, hash 3BFBC4E5 sample 47: - time = 940000 + time = 933750 flags = 1 data = length 32, hash 10F1217A sample 48: - time = 960000 + time = 953750 flags = 1 data = length 32, hash E37EF991 sample 49: - time = 980000 + time = 973750 flags = 1 data = length 32, hash 42723B2D sample 50: - time = 1000000 + time = 993750 flags = 1 data = length 32, hash 2D52F18B sample 51: - time = 1020000 + time = 1013750 flags = 1 data = length 32, hash 6F62245B sample 52: - time = 1040000 + time = 1033750 flags = 1 data = length 32, hash BA89ADED sample 53: - time = 1060000 + time = 1053750 flags = 1 data = length 32, hash FCF8C5E2 sample 54: - time = 1080000 + time = 1073750 flags = 1 data = length 32, hash F9AEEE3D sample 55: - time = 1100000 + time = 1093750 flags = 1 data = length 32, hash 2E465113 sample 56: - time = 1120000 + time = 1113750 flags = 1 data = length 32, hash 59CF2666 sample 57: - time = 1140000 + time = 1133750 flags = 1 data = length 32, hash 3AB7A8D9 sample 58: - time = 1160000 + time = 1153750 flags = 1 data = length 32, hash EB9D3A8E sample 59: - time = 1180000 + time = 1173750 flags = 1 data = length 32, hash 6539E15F sample 60: - time = 1200000 + time = 1193750 flags = 1 data = length 32, hash 2CAB1170 sample 61: - time = 1220000 + time = 1213750 flags = 1 data = length 32, hash D0CA4456 sample 62: - time = 1240000 + time = 1233750 flags = 1 data = length 32, hash DB3DBEE6 sample 63: - time = 1260000 + time = 1253750 flags = 1 data = length 32, hash 6D094AC4 sample 64: - time = 1280000 + time = 1273750 flags = 1 data = length 32, hash 2D6471B sample 65: - time = 1300000 + time = 1293750 flags = 1 data = length 32, hash 86D257FB sample 66: - time = 1320000 + time = 1313750 flags = 1 data = length 32, hash D8733063 sample 67: - time = 1340000 + time = 1333750 flags = 1 data = length 32, hash C975C837 sample 68: - time = 1360000 + time = 1353750 flags = 1 data = length 32, hash 2D548A68 sample 69: - time = 1380000 + time = 1373750 flags = 1 data = length 32, hash 7A4907BA sample 70: - time = 1400000 + time = 1393750 flags = 1 data = length 32, hash 6BDFDEB5 sample 71: - time = 1420000 + time = 1413750 flags = 1 data = length 32, hash 272D422E sample 72: - time = 1440000 + time = 1433750 flags = 1 data = length 32, hash BBFDCD7B sample 73: - time = 1460000 + time = 1453750 flags = 1 data = length 32, hash 81F7CBF2 sample 74: - time = 1480000 + time = 1473750 flags = 1 data = length 32, hash C18523A sample 75: - time = 1500000 + time = 1493750 flags = 1 data = length 32, hash E062FDDB sample 76: - time = 1520000 + time = 1513750 flags = 1 data = length 32, hash A756C4C8 sample 77: - time = 1540000 + time = 1533750 flags = 1 data = length 32, hash A4FA6865 sample 78: - time = 1560000 + time = 1553750 flags = 1 data = length 32, hash 6BC22B sample 79: - time = 1580000 + time = 1573750 flags = 1 data = length 32, hash 37041F06 sample 80: - time = 1600000 + time = 1593750 flags = 1 data = length 32, hash A9049020 sample 81: - time = 1620000 + time = 1613750 flags = 1 data = length 32, hash E3C9552A sample 82: - time = 1640000 + time = 1633750 flags = 1 data = length 32, hash 6EB2559 sample 83: - time = 1660000 + time = 1653750 flags = 1 data = length 32, hash 988FD295 sample 84: - time = 1680000 + time = 1673750 flags = 1 data = length 32, hash 6E0FFFA8 sample 85: - time = 1700000 + time = 1693750 flags = 1 data = length 32, hash 4A16A2E5 sample 86: - time = 1720000 + time = 1713750 flags = 1 data = length 32, hash 8526E110 sample 87: - time = 1740000 + time = 1733750 flags = 1 data = length 32, hash 9C0F881C sample 88: - time = 1760000 + time = 1753750 flags = 1 data = length 32, hash 68DF67F7 sample 89: - time = 1780000 + time = 1773750 flags = 1 data = length 32, hash A789F088 sample 90: - time = 1800000 + time = 1793750 flags = 1 data = length 32, hash B9CF3A20 sample 91: - time = 1820000 + time = 1813750 flags = 1 data = length 32, hash 2AFD3C01 sample 92: - time = 1840000 + time = 1833750 flags = 1 data = length 32, hash 3F61D3F4 sample 93: - time = 1860000 + time = 1853750 flags = 1 data = length 32, hash 2D210ECA sample 94: - time = 1880000 + time = 1873750 flags = 1 data = length 32, hash B8143A84 sample 95: - time = 1900000 + time = 1893750 flags = 1 data = length 32, hash FE8EBC16 sample 96: - time = 1920000 + time = 1913750 flags = 1 data = length 32, hash 85A9EE5D sample 97: - time = 1940000 + time = 1933750 flags = 1 data = length 32, hash 3BDF48D1 sample 98: - time = 1960000 + time = 1953750 flags = 1 data = length 32, hash 8EBCE992 sample 99: - time = 1980000 + time = 1973750 flags = 1 data = length 32, hash B22AFFF sample 100: - time = 2000000 + time = 1993750 flags = 1 data = length 32, hash 5F01BAC9 sample 101: - time = 2020000 + time = 2013750 flags = 1 data = length 32, hash C6B7BD37 sample 102: - time = 2040000 + time = 2033750 flags = 1 data = length 32, hash 5102216 sample 103: - time = 2060000 + time = 2053750 flags = 1 data = length 32, hash 8FE06144 sample 104: - time = 2080000 + time = 2073750 flags = 1 data = length 32, hash ED90D421 sample 105: - time = 2100000 + time = 2093750 flags = 1 data = length 32, hash 15971BF0 sample 106: - time = 2120000 + time = 2113750 flags = 1 data = length 32, hash 1B2D1ADE sample 107: - time = 2140000 + time = 2133750 flags = 1 data = length 32, hash A8A54AD2 sample 108: - time = 2160000 + time = 2153750 flags = 1 data = length 32, hash 270646A2 sample 109: - time = 2180000 + time = 2173750 flags = 1 data = length 32, hash 27DB772F sample 110: - time = 2200000 + time = 2193750 flags = 1 data = length 32, hash FBD3938 sample 111: - time = 2220000 + time = 2213750 flags = 1 data = length 32, hash FA27CAFB sample 112: - time = 2240000 + time = 2233750 flags = 1 data = length 32, hash 828AB2A4 sample 113: - time = 2260000 + time = 2253750 flags = 1 data = length 32, hash 5788D8F1 sample 114: - time = 2280000 + time = 2273750 flags = 1 data = length 32, hash B7A5AEB0 sample 115: - time = 2300000 + time = 2293750 flags = 1 data = length 32, hash 272DC4BC sample 116: - time = 2320000 + time = 2313750 flags = 1 data = length 32, hash 56C2540E sample 117: - time = 2340000 + time = 2333750 flags = 1 data = length 32, hash 3236D8C sample 118: - time = 2360000 + time = 2353750 flags = 1 data = length 32, hash 6C0650B sample 119: - time = 2380000 + time = 2373750 flags = 1 data = length 32, hash 1EA3E6C3 sample 120: - time = 2400000 + time = 2393750 flags = 1 data = length 32, hash 6512496C sample 121: - time = 2420000 + time = 2413750 flags = 1 data = length 32, hash 82CD3C74 sample 122: - time = 2440000 + time = 2433750 flags = 1 data = length 32, hash 7EDFB3A4 sample 123: - time = 2460000 + time = 2453750 flags = 1 data = length 32, hash AAFD22AB sample 124: - time = 2480000 + time = 2473750 flags = 1 data = length 32, hash 8577D9D1 sample 125: - time = 2500000 + time = 2493750 flags = 1 data = length 32, hash B8A22921 sample 126: - time = 2520000 + time = 2513750 flags = 1 data = length 32, hash 5E4EFC87 sample 127: - time = 2540000 + time = 2533750 flags = 1 data = length 32, hash 35A5463F sample 128: - time = 2560000 + time = 2553750 flags = 1 data = length 32, hash 3EBC0376 sample 129: - time = 2580000 + time = 2573750 flags = 1 data = length 32, hash F515CB86 sample 130: - time = 2600000 + time = 2593750 flags = 1 data = length 32, hash B113F72C sample 131: - time = 2620000 + time = 2613750 flags = 1 data = length 32, hash 420AE0 sample 132: - time = 2640000 + time = 2633750 flags = 1 data = length 32, hash 86D53F0F sample 133: - time = 2660000 + time = 2653750 flags = 1 data = length 32, hash 5600867C sample 134: - time = 2680000 + time = 2673750 flags = 1 data = length 32, hash EB4D89B6 sample 135: - time = 2700000 + time = 2693750 flags = 1 data = length 32, hash 9BCD0B44 sample 136: - time = 2720000 + time = 2713750 flags = 1 data = length 32, hash 4629F424 sample 137: - time = 2740000 + time = 2733750 flags = 1 data = length 32, hash DFAA65F7 sample 138: - time = 2760000 + time = 2753750 flags = 1 data = length 32, hash 9CF2BD6A sample 139: - time = 2780000 + time = 2773750 flags = 1 data = length 32, hash 7A36CAB4 sample 140: - time = 2800000 + time = 2793750 flags = 1 data = length 32, hash 1B9BCD43 sample 141: - time = 2820000 + time = 2813750 flags = 1 data = length 32, hash 409B739C sample 142: - time = 2840000 + time = 2833750 flags = 1 data = length 32, hash 126CAB5A sample 143: - time = 2860000 + time = 2853750 flags = 1 data = length 32, hash 58173930 sample 144: - time = 2880000 + time = 2873750 flags = 1 data = length 32, hash 32F281F sample 145: - time = 2900000 + time = 2893750 flags = 1 data = length 32, hash D3F26DE sample 146: - time = 2920000 + time = 2913750 flags = 1 data = length 32, hash C13BE9A7 sample 147: - time = 2940000 + time = 2933750 flags = 1 data = length 32, hash 854B6181 sample 148: - time = 2960000 + time = 2953750 flags = 1 data = length 32, hash 1E217D84 sample 149: - time = 2980000 + time = 2973750 flags = 1 data = length 32, hash B121F36A sample 150: - time = 3000000 + time = 2993750 flags = 536870913 data = length 32, hash 67FBC502 tracksEnded = true diff --git a/libraries/test_data/src/test/assets/muxerdumps/hdr10-720p.mp4.dump b/libraries/test_data/src/test/assets/muxerdumps/hdr10-720p.mp4.dump index c0edf7493b..3524f1833b 100644 --- a/libraries/test_data/src/test/assets/muxerdumps/hdr10-720p.mp4.dump +++ b/libraries/test_data/src/test/assets/muxerdumps/hdr10-720p.mp4.dump @@ -552,7 +552,7 @@ track 1: initializationData: data = length 2, hash 560 sample 0: - time = 0 + time = 43000 flags = 1 data = length 682, hash 34C58E7C sample 1: diff --git a/libraries/test_data/src/test/assets/muxerdumps/hdr10-720p.mp4_fragmented.dump b/libraries/test_data/src/test/assets/muxerdumps/hdr10-720p.mp4_fragmented.dump index 73b44e616a..929a624049 100644 --- a/libraries/test_data/src/test/assets/muxerdumps/hdr10-720p.mp4_fragmented.dump +++ b/libraries/test_data/src/test/assets/muxerdumps/hdr10-720p.mp4_fragmented.dump @@ -548,779 +548,779 @@ track 1: flags = 1 data = length 682, hash 34C58E7C sample 1: - time = 64333 + time = 21333 flags = 1 data = length 846, hash 22FB31EF sample 2: - time = 85666 + time = 42666 flags = 1 data = length 757, hash F55DC63E sample 3: - time = 107000 + time = 64000 flags = 1 data = length 690, hash BD26CD74 sample 4: - time = 128333 + time = 85333 flags = 1 data = length 660, hash 5713CCCB sample 5: - time = 149666 + time = 106666 flags = 1 data = length 646, hash 74C2D10F sample 6: - time = 171000 + time = 128000 flags = 1 data = length 652, hash B49BACA1 sample 7: - time = 192333 + time = 149333 flags = 1 data = length 658, hash BF36BC46 sample 8: - time = 213666 + time = 170666 flags = 1 data = length 666, hash 69CBADD8 sample 9: - time = 235000 + time = 192000 flags = 1 data = length 668, hash 99204158 sample 10: - time = 256333 + time = 213333 flags = 1 data = length 671, hash AE181AC8 sample 11: - time = 277666 + time = 234666 flags = 1 data = length 678, hash C432ACF0 sample 12: - time = 299000 + time = 256000 flags = 1 data = length 682, hash C23E1F17 sample 13: - time = 320333 + time = 277333 flags = 1 data = length 685, hash B22AB49 sample 14: - time = 341666 + time = 298666 flags = 1 data = length 683, hash B073F447 sample 15: - time = 363000 + time = 320000 flags = 1 data = length 675, hash C7614E26 sample 16: - time = 384333 + time = 341333 flags = 1 data = length 679, hash 5B075ADF sample 17: - time = 405666 + time = 362666 flags = 1 data = length 687, hash E260C35B sample 18: - time = 427000 + time = 384000 flags = 1 data = length 687, hash 3C316334 sample 19: - time = 448333 + time = 405333 flags = 1 data = length 680, hash BCD8469 sample 20: - time = 469666 + time = 426666 flags = 1 data = length 681, hash CBD0BF0F sample 21: - time = 491000 + time = 448000 flags = 1 data = length 719, hash F7594265 sample 22: - time = 512333 + time = 469333 flags = 1 data = length 699, hash 4975812A sample 23: - time = 533666 + time = 490666 flags = 1 data = length 723, hash 11C7327E sample 24: - time = 555000 + time = 512000 flags = 1 data = length 765, hash DED05454 sample 25: - time = 576333 + time = 533333 flags = 1 data = length 785, hash 9E7C3FDD sample 26: - time = 597666 + time = 554666 flags = 1 data = length 728, hash B433E15E sample 27: - time = 619000 + time = 576000 flags = 1 data = length 708, hash ED0B3337 sample 28: - time = 640333 + time = 597333 flags = 1 data = length 642, hash 6B447435 sample 29: - time = 661666 + time = 618666 flags = 1 data = length 628, hash D59CB28F sample 30: - time = 683000 + time = 640000 flags = 1 data = length 594, hash BCC990B5 sample 31: - time = 704333 + time = 661333 flags = 1 data = length 622, hash C9AE9991 sample 32: - time = 725645 + time = 682645 flags = 1 data = length 633, hash 4B7D59B8 sample 33: - time = 746979 + time = 703979 flags = 1 data = length 661, hash A98CE814 sample 34: - time = 768312 + time = 725312 flags = 1 data = length 662, hash 9A3E0D79 sample 35: - time = 789645 + time = 746645 flags = 1 data = length 669, hash 2A0B67AC sample 36: - time = 810979 + time = 767979 flags = 1 data = length 691, hash C339C4EE sample 37: - time = 832312 + time = 789312 flags = 1 data = length 678, hash CF770B8C sample 38: - time = 853645 + time = 810645 flags = 1 data = length 678, hash 685F97BC sample 39: - time = 874979 + time = 831979 flags = 1 data = length 688, hash 7DC1FBD3 sample 40: - time = 896312 + time = 853312 flags = 1 data = length 684, hash F7D9FE89 sample 41: - time = 917645 + time = 874645 flags = 1 data = length 683, hash 5E3EA281 sample 42: - time = 938979 + time = 895979 flags = 1 data = length 675, hash F576AE6 sample 43: - time = 960312 + time = 917312 flags = 1 data = length 697, hash B0EBE204 sample 44: - time = 981645 + time = 938645 flags = 1 data = length 675, hash 3C928CCA sample 45: - time = 1002979 + time = 959979 flags = 1 data = length 680, hash 34650DF5 sample 46: - time = 1024312 + time = 981312 flags = 1 data = length 685, hash 564F62A sample 47: - time = 1045645 + time = 1002645 flags = 1 data = length 691, hash 71BBA88D sample 48: - time = 1066979 + time = 1023979 flags = 1 data = length 736, hash C8F0D575 sample 49: - time = 1088312 + time = 1045312 flags = 1 data = length 718, hash 2F13561A sample 50: - time = 1109645 + time = 1066645 flags = 1 data = length 692, hash CF153F84 sample 51: - time = 1130979 + time = 1087979 flags = 1 data = length 673, hash 30357B83 sample 52: - time = 1152312 + time = 1109312 flags = 1 data = length 690, hash 5FB65B72 sample 53: - time = 1173645 + time = 1130645 flags = 1 data = length 769, hash F5E1AAEA sample 54: - time = 1194979 + time = 1151979 flags = 1 data = length 733, hash 9327D738 sample 55: - time = 1216312 + time = 1173312 flags = 1 data = length 627, hash 203CFA24 sample 56: - time = 1237645 + time = 1194645 flags = 1 data = length 697, hash 1FCE39D0 sample 57: - time = 1258979 + time = 1215979 flags = 1 data = length 585, hash B53A076B sample 58: - time = 1280312 + time = 1237312 flags = 1 data = length 650, hash FDFCA752 sample 59: - time = 1301645 + time = 1258645 flags = 1 data = length 725, hash 4D4FA788 sample 60: - time = 1322979 + time = 1279979 flags = 1 data = length 788, hash 6D883F0B sample 61: - time = 1344312 + time = 1301312 flags = 1 data = length 649, hash 9125CC1A sample 62: - time = 1365645 + time = 1322645 flags = 1 data = length 616, hash C02AB7EA sample 63: - time = 1386979 + time = 1343979 flags = 1 data = length 624, hash D49000E1 sample 64: - time = 1408312 + time = 1365312 flags = 1 data = length 664, hash 482C9994 sample 65: - time = 1429645 + time = 1386645 flags = 1 data = length 656, hash A234172A sample 66: - time = 1450979 + time = 1407979 flags = 1 data = length 649, hash BCCAD04D sample 67: - time = 1472312 + time = 1429312 flags = 1 data = length 655, hash B961E395 sample 68: - time = 1493645 + time = 1450645 flags = 1 data = length 673, hash 5BD56013 sample 69: - time = 1514979 + time = 1471979 flags = 1 data = length 700, hash FE25D834 sample 70: - time = 1536312 + time = 1493312 flags = 1 data = length 668, hash 45203245 sample 71: - time = 1557645 + time = 1514645 flags = 1 data = length 672, hash F9269558 sample 72: - time = 1578979 + time = 1535979 flags = 1 data = length 682, hash C205B4DF sample 73: - time = 1600312 + time = 1557312 flags = 1 data = length 686, hash A4632474 sample 74: - time = 1621645 + time = 1578645 flags = 1 data = length 747, hash B2F3AA1D sample 75: - time = 1642979 + time = 1599979 flags = 1 data = length 711, hash B3A33D80 sample 76: - time = 1664312 + time = 1621312 flags = 1 data = length 652, hash 37A9B9BF sample 77: - time = 1685645 + time = 1642645 flags = 1 data = length 675, hash F6BE4CAC sample 78: - time = 1706979 + time = 1663979 flags = 1 data = length 672, hash 22A12DFC sample 79: - time = 1728312 + time = 1685312 flags = 1 data = length 674, hash E740F44 sample 80: - time = 1749645 + time = 1706645 flags = 1 data = length 680, hash A065804 sample 81: - time = 1770979 + time = 1727979 flags = 1 data = length 663, hash 805CE20 sample 82: - time = 1792312 + time = 1749312 flags = 1 data = length 688, hash C2E28B22 sample 83: - time = 1813645 + time = 1770645 flags = 1 data = length 672, hash BF738F27 sample 84: - time = 1834979 + time = 1791979 flags = 1 data = length 673, hash AFE85361 sample 85: - time = 1856312 + time = 1813312 flags = 1 data = length 679, hash C9D68F4F sample 86: - time = 1877645 + time = 1834645 flags = 1 data = length 676, hash 42C67933 sample 87: - time = 1898979 + time = 1855979 flags = 1 data = length 748, hash 16944018 sample 88: - time = 1920312 + time = 1877312 flags = 1 data = length 730, hash D592050C sample 89: - time = 1941645 + time = 1898645 flags = 1 data = length 785, hash DB11A4E8 sample 90: - time = 1962979 + time = 1919979 flags = 1 data = length 708, hash 445F4443 sample 91: - time = 1984312 + time = 1941312 flags = 1 data = length 630, hash BD57EF90 sample 92: - time = 2005645 + time = 1962645 flags = 1 data = length 621, hash FB977F1F sample 93: - time = 2026979 + time = 1983979 flags = 1 data = length 656, hash 53E25FBE sample 94: - time = 2048291 + time = 2005291 flags = 1 data = length 664, hash A9D0717 sample 95: - time = 2069625 + time = 2026625 flags = 1 data = length 672, hash 6F2663EA sample 96: - time = 2090958 + time = 2047958 flags = 1 data = length 677, hash 6EBB686B sample 97: - time = 2112291 + time = 2069291 flags = 1 data = length 679, hash BF29A1EC sample 98: - time = 2133625 + time = 2090625 flags = 1 data = length 683, hash 69F6750D sample 99: - time = 2154958 + time = 2111958 flags = 1 data = length 691, hash A79A804F sample 100: - time = 2176291 + time = 2133291 flags = 1 data = length 734, hash 31FB39E8 sample 101: - time = 2197625 + time = 2154625 flags = 1 data = length 657, hash F99E1ADC sample 102: - time = 2218958 + time = 2175958 flags = 1 data = length 659, hash FDC16724 sample 103: - time = 2240291 + time = 2197291 flags = 1 data = length 795, hash 23302539 sample 104: - time = 2261625 + time = 2218625 flags = 1 data = length 691, hash 5AA01A0 sample 105: - time = 2282958 + time = 2239958 flags = 1 data = length 640, hash A9A214AB sample 106: - time = 2304291 + time = 2261291 flags = 1 data = length 651, hash F3253A0E sample 107: - time = 2325625 + time = 2282625 flags = 1 data = length 652, hash 2D4DE02 sample 108: - time = 2346958 + time = 2303958 flags = 1 data = length 772, hash 16817D3A sample 109: - time = 2368291 + time = 2325291 flags = 1 data = length 756, hash 738E4C8D sample 110: - time = 2389625 + time = 2346625 flags = 1 data = length 781, hash 61372EAE sample 111: - time = 2410958 + time = 2367958 flags = 1 data = length 658, hash 83B5A955 sample 112: - time = 2432291 + time = 2389291 flags = 1 data = length 667, hash C3CF8AEF sample 113: - time = 2453625 + time = 2410625 flags = 1 data = length 768, hash C6534483 sample 114: - time = 2474958 + time = 2431958 flags = 1 data = length 688, hash 1C14B263 sample 115: - time = 2496291 + time = 2453291 flags = 1 data = length 599, hash 51CF483 sample 116: - time = 2517625 + time = 2474625 flags = 1 data = length 594, hash F290D460 sample 117: - time = 2538958 + time = 2495958 flags = 1 data = length 633, hash 262E26E6 sample 118: - time = 2560291 + time = 2517291 flags = 1 data = length 656, hash 9158E6A1 sample 119: - time = 2581625 + time = 2538625 flags = 1 data = length 668, hash 3AC6C8DF sample 120: - time = 2602958 + time = 2559958 flags = 1 data = length 667, hash DB111C93 sample 121: - time = 2624291 + time = 2581291 flags = 1 data = length 670, hash 5EA45C5E sample 122: - time = 2645625 + time = 2602625 flags = 1 data = length 663, hash 1CF1EC34 sample 123: - time = 2666958 + time = 2623958 flags = 1 data = length 673, hash 9609104 sample 124: - time = 2688291 + time = 2645291 flags = 1 data = length 704, hash D274E425 sample 125: - time = 2709625 + time = 2666625 flags = 1 data = length 681, hash 4D720ACE sample 126: - time = 2730958 + time = 2687958 flags = 1 data = length 682, hash C49E4619 sample 127: - time = 2752291 + time = 2709291 flags = 1 data = length 680, hash 1AB4733A sample 128: - time = 2773625 + time = 2730625 flags = 1 data = length 675, hash BA047E60 sample 129: - time = 2794958 + time = 2751958 flags = 1 data = length 688, hash 9679B8E9 sample 130: - time = 2816291 + time = 2773291 flags = 1 data = length 687, hash 57DBCD4 sample 131: - time = 2837625 + time = 2794625 flags = 1 data = length 680, hash 91BA9BF2 sample 132: - time = 2858958 + time = 2815958 flags = 1 data = length 757, hash 741D6330 sample 133: - time = 2880291 + time = 2837291 flags = 1 data = length 651, hash 60508D7D sample 134: - time = 2901625 + time = 2858625 flags = 1 data = length 679, hash 7A32FD22 sample 135: - time = 2922958 + time = 2879958 flags = 1 data = length 666, hash 98C3F963 sample 136: - time = 2944291 + time = 2901291 flags = 1 data = length 694, hash 59D9B67B sample 137: - time = 2965625 + time = 2922625 flags = 1 data = length 680, hash 6FA356DD sample 138: - time = 2986958 + time = 2943958 flags = 1 data = length 665, hash 3D7E32D9 sample 139: - time = 3008291 + time = 2965291 flags = 1 data = length 681, hash 2592B0DF sample 140: - time = 3029625 + time = 2986625 flags = 1 data = length 680, hash 2BA659D7 sample 141: - time = 3050958 + time = 3007958 flags = 1 data = length 667, hash 1E21B749 sample 142: - time = 3072291 + time = 3029291 flags = 1 data = length 683, hash 57E1A624 sample 143: - time = 3093625 + time = 3050625 flags = 1 data = length 673, hash B7216D34 sample 144: - time = 3114958 + time = 3071958 flags = 1 data = length 684, hash 2FDBEB3A sample 145: - time = 3136291 + time = 3093291 flags = 1 data = length 707, hash 1D528F18 sample 146: - time = 3157625 + time = 3114625 flags = 1 data = length 693, hash 24148721 sample 147: - time = 3178958 + time = 3135958 flags = 1 data = length 660, hash C89F9451 sample 148: - time = 3200291 + time = 3157291 flags = 1 data = length 679, hash 67C16179 sample 149: - time = 3221625 + time = 3178625 flags = 1 data = length 685, hash 6EF9DD57 sample 150: - time = 3242958 + time = 3199958 flags = 1 data = length 672, hash CFF4E296 sample 151: - time = 3264291 + time = 3221291 flags = 1 data = length 681, hash 994F630 sample 152: - time = 3285625 + time = 3242625 flags = 1 data = length 684, hash 3118D2E9 sample 153: - time = 3306958 + time = 3263958 flags = 1 data = length 677, hash 3628592F sample 154: - time = 3328291 + time = 3285291 flags = 1 data = length 689, hash 309E58A0 sample 155: - time = 3349625 + time = 3306625 flags = 1 data = length 677, hash D1F3255B sample 156: - time = 3370958 + time = 3327958 flags = 1 data = length 689, hash B3E864BA sample 157: - time = 3392270 + time = 3349270 flags = 1 data = length 680, hash 469FA2FF sample 158: - time = 3413604 + time = 3370604 flags = 1 data = length 688, hash DC9FC31B sample 159: - time = 3434937 + time = 3391937 flags = 1 data = length 675, hash E2396CC7 sample 160: - time = 3456270 + time = 3413270 flags = 1 data = length 738, hash C1B7A30A sample 161: - time = 3477604 + time = 3434604 flags = 1 data = length 723, hash CEABDA70 sample 162: - time = 3498937 + time = 3455937 flags = 1 data = length 698, hash 59E1B5D8 sample 163: - time = 3520270 + time = 3477270 flags = 1 data = length 671, hash 71CD7BFA sample 164: - time = 3541604 + time = 3498604 flags = 1 data = length 652, hash 45894636 sample 165: - time = 3562937 + time = 3519937 flags = 1 data = length 667, hash E98A528A sample 166: - time = 3584270 + time = 3541270 flags = 1 data = length 682, hash 8AA9E761 sample 167: - time = 3605604 + time = 3562604 flags = 1 data = length 670, hash 7D071859 sample 168: - time = 3626937 + time = 3583937 flags = 1 data = length 672, hash 4FA7BDBB sample 169: - time = 3648270 + time = 3605270 flags = 1 data = length 779, hash 85D8FF74 sample 170: - time = 3669604 + time = 3626604 flags = 1 data = length 699, hash CABC0AF6 sample 171: - time = 3690937 + time = 3647937 flags = 1 data = length 635, hash 35BD0FED sample 172: - time = 3712270 + time = 3669270 flags = 1 data = length 646, hash D4960FAC sample 173: - time = 3733604 + time = 3690604 flags = 1 data = length 669, hash 4DAC2897 sample 174: - time = 3754937 + time = 3711937 flags = 1 data = length 675, hash FD60998A sample 175: - time = 3776270 + time = 3733270 flags = 1 data = length 677, hash FED0180B sample 176: - time = 3797604 + time = 3754604 flags = 1 data = length 668, hash C6183862 sample 177: - time = 3818937 + time = 3775937 flags = 1 data = length 671, hash EBA9EF22 sample 178: - time = 3840270 + time = 3797270 flags = 1 data = length 668, hash CF88A2FF sample 179: - time = 3861604 + time = 3818604 flags = 1 data = length 727, hash A9311311 sample 180: - time = 3882937 + time = 3839937 flags = 1 data = length 701, hash C6351159 sample 181: - time = 3904270 + time = 3861270 flags = 1 data = length 847, hash 1864F774 sample 182: - time = 3925604 + time = 3882604 flags = 1 data = length 765, hash 616DD2EA sample 183: - time = 3946937 + time = 3903937 flags = 1 data = length 674, hash 671D4342 sample 184: - time = 3968270 + time = 3925270 flags = 1 data = length 723, hash 567566A2 sample 185: - time = 3989604 + time = 3946604 flags = 1 data = length 580, hash B38C9C63 sample 186: - time = 4010937 + time = 3967937 flags = 1 data = length 583, hash 5668BFCE sample 187: - time = 4032270 + time = 3989270 flags = 1 data = length 631, hash 7E86C98E sample 188: - time = 4053604 + time = 4010604 flags = 1 data = length 656, hash 95A41C9B sample 189: - time = 4074937 + time = 4031937 flags = 1 data = length 822, hash 2A045560 sample 190: - time = 4096270 + time = 4053270 flags = 1 data = length 643, hash 551E7C72 sample 191: - time = 4117604 + time = 4074604 flags = 1 data = length 617, hash 463482D9 sample 192: - time = 4138937 + time = 4095937 flags = 1 data = length 640, hash E714454F sample 193: - time = 4160270 + time = 4117270 flags = 1 data = length 646, hash 6DD5E81B sample 194: - time = 4181604 + time = 4138604 flags = 1 data = length 690, hash 407EC299 tracksEnded = true diff --git a/libraries/test_data/src/test/assets/muxerdumps/hdr10-720p.mp4_fragmented_box_structure.dump b/libraries/test_data/src/test/assets/muxerdumps/hdr10-720p.mp4_fragmented_box_structure.dump index 1c1ea09ec0..e8a679b355 100644 --- a/libraries/test_data/src/test/assets/muxerdumps/hdr10-720p.mp4_fragmented_box_structure.dump +++ b/libraries/test_data/src/test/assets/muxerdumps/hdr10-720p.mp4_fragmented_box_structure.dump @@ -70,7 +70,7 @@ moof (2876 bytes): tfhd (24 bytes): Data = length 16, hash 67B5C2D5 trun (1688 bytes): - Data = length 1680, hash 4310989E + Data = length 1680, hash 9B4F1796 mdat (5712387 bytes): Data = length 5712379, hash 86B2819D moof (1244 bytes): diff --git a/libraries/test_data/src/test/assets/muxerdumps/mp4_with_b_frame_large_pts.mp4.dump b/libraries/test_data/src/test/assets/muxerdumps/mp4_with_b_frame_large_pts.mp4.dump index 83d28b7c37..4d981ef61f 100644 --- a/libraries/test_data/src/test/assets/muxerdumps/mp4_with_b_frame_large_pts.mp4.dump +++ b/libraries/test_data/src/test/assets/muxerdumps/mp4_with_b_frame_large_pts.mp4.dump @@ -5,7 +5,7 @@ seekMap: getPosition(1) = [[timeUs=0, position=400052], [timeUs=273911, position=400108]] getPosition(207450) = [[timeUs=0, position=400052], [timeUs=273911, position=400108]] getPosition(414900) = [[timeUs=33188, position=400220]] -numberOfTracks = 1 +numberOfTracks = 2 track 0: total output bytes = 224 sample count = 4 @@ -42,4 +42,40 @@ track 0: time = 33188 flags = 536870913 data = length 56, hash C4551A2E +track 1: + total output bytes = 224 + sample count = 4 + format 0: + id = 2 + sampleMimeType = video/avc + codecs = avc1.F4000A + maxInputSize = 86 + maxNumReorderSamples = 2 + width = 12 + height = 10 + frameRate = 9.64 + colorInfo: + colorRange = 1 + lumaBitdepth = 8 + chromaBitdepth = 8 + metadata = entries=[Mp4Timestamp: creation time=100000000, modification time=500000000, timescale=10000] + initializationData: + data = length 28, hash 410B510 + data = length 9, hash FBADD682 + sample 0: + time = 1000000 + flags = 1 + data = length 56, hash C4551A2E + sample 1: + time = 1273911 + flags = 1 + data = length 56, hash C4551A2E + sample 2: + time = 1132933 + flags = 1 + data = length 56, hash C4551A2E + sample 3: + time = 1033188 + flags = 536870913 + data = length 56, hash C4551A2E tracksEnded = true diff --git a/libraries/test_data/src/test/assets/muxerdumps/mp4_with_different_tracks_offset.mp4.dump b/libraries/test_data/src/test/assets/muxerdumps/mp4_with_different_tracks_offset.mp4.dump index ce044b9f9a..ca2ab52898 100644 --- a/libraries/test_data/src/test/assets/muxerdumps/mp4_with_different_tracks_offset.mp4.dump +++ b/libraries/test_data/src/test/assets/muxerdumps/mp4_with_different_tracks_offset.mp4.dump @@ -1,10 +1,10 @@ seekMap: isSeekable = true - duration = 200 + duration = 100 getPosition(0) = [[timeUs=0, position=400052]] getPosition(1) = [[timeUs=0, position=400052], [timeUs=100, position=400108]] + getPosition(50) = [[timeUs=0, position=400052], [timeUs=100, position=400108]] getPosition(100) = [[timeUs=100, position=400108]] - getPosition(200) = [[timeUs=100, position=400108]] numberOfTracks = 2 track 0: total output bytes = 112 @@ -45,7 +45,7 @@ track 1: maxNumReorderSamples = 2 width = 12 height = 10 - frameRate = 10000.00 + frameRate = 20000.00 colorInfo: colorRange = 1 lumaBitdepth = 8 @@ -55,7 +55,7 @@ track 1: data = length 28, hash 410B510 data = length 9, hash FBADD682 sample 0: - time = 0 + time = 100 flags = 1 data = length 56, hash C4551A2E sample 1: diff --git a/libraries/test_data/src/test/assets/muxerdumps/mp4_with_negative_tracks_offset.mp4.dump b/libraries/test_data/src/test/assets/muxerdumps/mp4_with_negative_tracks_offset.mp4.dump new file mode 100644 index 0000000000..fe253fbc38 --- /dev/null +++ b/libraries/test_data/src/test/assets/muxerdumps/mp4_with_negative_tracks_offset.mp4.dump @@ -0,0 +1,41 @@ +seekMap: + isSeekable = true + duration = 600 + getPosition(0) = [[timeUs=-100, position=400052], [timeUs=100, position=400108]] + getPosition(1) = [[timeUs=-100, position=400052], [timeUs=100, position=400108]] + getPosition(300) = [[timeUs=300, position=400164]] + getPosition(600) = [[timeUs=300, position=400164]] +numberOfTracks = 1 +track 0: + total output bytes = 168 + sample count = 3 + format 0: + id = 1 + sampleMimeType = video/avc + codecs = avc1.F4000A + maxInputSize = 86 + maxNumReorderSamples = 2 + width = 12 + height = 10 + frameRate = 5000.00 + colorInfo: + colorRange = 1 + lumaBitdepth = 8 + chromaBitdepth = 8 + metadata = entries=[Mp4Timestamp: creation time=100000000, modification time=500000000, timescale=10000] + initializationData: + data = length 28, hash 410B510 + data = length 9, hash FBADD682 + sample 0: + time = -100 + flags = 1 + data = length 56, hash C4551A2E + sample 1: + time = 100 + flags = 1 + data = length 56, hash C4551A2E + sample 2: + time = 300 + flags = 536870913 + data = length 56, hash C4551A2E +tracksEnded = true diff --git a/libraries/test_data/src/test/assets/muxerdumps/negative_start_time_edts_box.dump b/libraries/test_data/src/test/assets/muxerdumps/negative_start_time_edts_box.dump new file mode 100644 index 0000000000..89afcc0cc5 --- /dev/null +++ b/libraries/test_data/src/test/assets/muxerdumps/negative_start_time_edts_box.dump @@ -0,0 +1,3 @@ +edts (44 bytes): + elst (36 bytes): + Data = length 28, hash 68F2D7C9 diff --git a/libraries/test_data/src/test/assets/muxerdumps/partial_hdr10-720p.mp4.dump b/libraries/test_data/src/test/assets/muxerdumps/partial_hdr10-720p.mp4.dump index 7aadce1d00..24b8ae2a00 100644 --- a/libraries/test_data/src/test/assets/muxerdumps/partial_hdr10-720p.mp4.dump +++ b/libraries/test_data/src/test/assets/muxerdumps/partial_hdr10-720p.mp4.dump @@ -544,7 +544,7 @@ track 1: initializationData: data = length 2, hash 560 sample 0: - time = 0 + time = 43000 flags = 1 data = length 682, hash 34C58E7C sample 1: diff --git a/libraries/test_data/src/test/assets/muxerdumps/positive_start_time_edts_box.dump b/libraries/test_data/src/test/assets/muxerdumps/positive_start_time_edts_box.dump new file mode 100644 index 0000000000..fdf2b2d557 --- /dev/null +++ b/libraries/test_data/src/test/assets/muxerdumps/positive_start_time_edts_box.dump @@ -0,0 +1,3 @@ +edts (64 bytes): + elst (56 bytes): + Data = length 48, hash 9EC46E11 diff --git a/libraries/test_data/src/test/assets/muxerdumps/sample_av1.mp4.dump b/libraries/test_data/src/test/assets/muxerdumps/sample_av1.mp4.dump index 290e59d11c..ec659290d8 100644 --- a/libraries/test_data/src/test/assets/muxerdumps/sample_av1.mp4.dump +++ b/libraries/test_data/src/test/assets/muxerdumps/sample_av1.mp4.dump @@ -1,10 +1,10 @@ seekMap: isSeekable = true - duration = 1088300 + duration = 1045300 getPosition(0) = [[timeUs=0, position=400052]] getPosition(1) = [[timeUs=0, position=400052]] - getPosition(544150) = [[timeUs=0, position=400052]] - getPosition(1088300) = [[timeUs=0, position=400052]] + getPosition(522650) = [[timeUs=0, position=400052]] + getPosition(1045300) = [[timeUs=0, position=400052]] numberOfTracks = 2 track 0: total output bytes = 69084 @@ -159,183 +159,183 @@ track 1: initializationData: data = length 5, hash 2B7623A sample 0: - time = 0 + time = 43000 flags = 1 data = length 21, hash 77102128 sample 1: - time = 66208 + time = 66229 flags = 1 data = length 17, hash BA75F5D4 sample 2: - time = 89437 + time = 89458 flags = 1 data = length 582, hash B5064B53 sample 3: - time = 112666 + time = 112687 flags = 1 data = length 218, hash 46000EEF sample 4: - time = 135895 + time = 135916 flags = 1 data = length 206, hash 7B12EC38 sample 5: - time = 159125 + time = 159145 flags = 1 data = length 215, hash C05E2F91 sample 6: - time = 182354 + time = 182375 flags = 1 data = length 217, hash 1E457BBF sample 7: - time = 205583 + time = 205604 flags = 1 data = length 195, hash DFD6F480 sample 8: - time = 228812 + time = 228833 flags = 1 data = length 198, hash 2BC702E sample 9: - time = 252041 + time = 252062 flags = 1 data = length 216, hash ED964B3D sample 10: - time = 275270 + time = 275291 flags = 1 data = length 204, hash DAF6FDC6 sample 11: - time = 298500 + time = 298520 flags = 1 data = length 205, hash D249FD76 sample 12: - time = 321729 + time = 321750 flags = 1 data = length 200, hash C8F844E4 sample 13: - time = 344958 + time = 344979 flags = 1 data = length 196, hash FDD0CA03 sample 14: - time = 368187 + time = 368208 flags = 1 data = length 196, hash E4E3A7B0 sample 15: - time = 391416 + time = 391437 flags = 1 data = length 207, hash 157773E3 sample 16: - time = 414645 + time = 414666 flags = 1 data = length 207, hash C9F46F0F sample 17: - time = 437875 + time = 437895 flags = 1 data = length 210, hash 127AC739 sample 18: - time = 461104 + time = 461125 flags = 1 data = length 217, hash B2649830 sample 19: - time = 484333 + time = 484354 flags = 1 data = length 188, hash 4D280759 sample 20: - time = 507562 + time = 507583 flags = 1 data = length 205, hash EAE6D6AD sample 21: - time = 530791 + time = 530812 flags = 1 data = length 226, hash BDD0EC44 sample 22: - time = 554020 + time = 554041 flags = 1 data = length 199, hash 60C719A2 sample 23: - time = 577250 + time = 577270 flags = 1 data = length 215, hash EDDE842F sample 24: - time = 600479 + time = 600500 flags = 1 data = length 201, hash D17187B sample 25: - time = 623708 + time = 623729 flags = 1 data = length 217, hash 58DD698C sample 26: - time = 646937 + time = 646958 flags = 1 data = length 202, hash 5168D405 sample 27: - time = 670166 + time = 670187 flags = 1 data = length 194, hash 7139AF8 sample 28: - time = 693395 + time = 693416 flags = 1 data = length 203, hash F775D9ED sample 29: - time = 716625 + time = 716645 flags = 1 data = length 200, hash 774C5045 sample 30: - time = 739854 + time = 739875 flags = 1 data = length 211, hash ED3C6FBC sample 31: - time = 763083 + time = 763104 flags = 1 data = length 205, hash FC4754A9 sample 32: - time = 786312 + time = 786333 flags = 1 data = length 216, hash 72F4AF29 sample 33: - time = 809541 + time = 809562 flags = 1 data = length 204, hash 1AF98D40 sample 34: - time = 832770 + time = 832791 flags = 1 data = length 200, hash E0004171 sample 35: - time = 856000 + time = 856020 flags = 1 data = length 215, hash B413079A sample 36: - time = 879229 + time = 879250 flags = 1 data = length 211, hash 107CEE52 sample 37: - time = 902458 + time = 902479 flags = 1 data = length 214, hash 1E588A0D sample 38: - time = 925687 + time = 925708 flags = 1 data = length 210, hash 84E5BBBD sample 39: - time = 948916 + time = 948937 flags = 1 data = length 211, hash 32D7ACAB sample 40: - time = 972145 + time = 972166 flags = 1 data = length 201, hash 1567F919 sample 41: - time = 995375 + time = 995395 flags = 1 data = length 196, hash 2F050463 sample 42: - time = 1018604 + time = 1018625 flags = 1 data = length 215, hash 4BDD9C81 sample 43: - time = 1041833 + time = 1041854 flags = 1 data = length 242, hash DD6FD967 sample 44: - time = 1065062 + time = 1065083 flags = 536870913 data = length 184, hash DAFC330D tracksEnded = true diff --git a/libraries/test_data/src/test/assets/muxerdumps/sample_no_bframes.mp4.dump b/libraries/test_data/src/test/assets/muxerdumps/sample_no_bframes.mp4.dump index f59985586f..85d10973b7 100644 --- a/libraries/test_data/src/test/assets/muxerdumps/sample_no_bframes.mp4.dump +++ b/libraries/test_data/src/test/assets/muxerdumps/sample_no_bframes.mp4.dump @@ -1,10 +1,10 @@ seekMap: isSeekable = true - duration = 1089300 + duration = 1045300 getPosition(0) = [[timeUs=0, position=400052]] getPosition(1) = [[timeUs=0, position=400052]] - getPosition(544650) = [[timeUs=0, position=400052]] - getPosition(1089300) = [[timeUs=0, position=400052]] + getPosition(522650) = [[timeUs=0, position=400052]] + getPosition(1045300) = [[timeUs=0, position=400052]] numberOfTracks = 2 track 0: total output bytes = 9529 @@ -21,183 +21,183 @@ track 0: initializationData: data = length 2, hash 5F7 sample 0: - time = 0 + time = 44000 flags = 1 data = length 23, hash 47DE9131 sample 1: - time = 67208 + time = 67229 flags = 1 data = length 6, hash 31EC5206 sample 2: - time = 90437 + time = 90458 flags = 1 data = length 148, hash 894A176B sample 3: - time = 113666 + time = 113687 flags = 1 data = length 189, hash CEF235A1 sample 4: - time = 136895 + time = 136916 flags = 1 data = length 205, hash BBF5F7B0 sample 5: - time = 160125 + time = 160145 flags = 1 data = length 210, hash F278B193 sample 6: - time = 183354 + time = 183375 flags = 1 data = length 210, hash 82DA1589 sample 7: - time = 206583 + time = 206604 flags = 1 data = length 207, hash 5BE231DF sample 8: - time = 229812 + time = 229833 flags = 1 data = length 225, hash 18819EE1 sample 9: - time = 253041 + time = 253062 flags = 1 data = length 215, hash CA7FA67B sample 10: - time = 276270 + time = 276291 flags = 1 data = length 211, hash 581A1C18 sample 11: - time = 299500 + time = 299520 flags = 1 data = length 216, hash ADB88187 sample 12: - time = 322729 + time = 322750 flags = 1 data = length 229, hash 2E8BA4DC sample 13: - time = 345958 + time = 345979 flags = 1 data = length 232, hash 22F0C510 sample 14: - time = 369187 + time = 369208 flags = 1 data = length 235, hash 867AD0DC sample 15: - time = 392416 + time = 392437 flags = 1 data = length 231, hash 84E823A8 sample 16: - time = 415645 + time = 415666 flags = 1 data = length 226, hash 1BEF3A95 sample 17: - time = 438875 + time = 438895 flags = 1 data = length 216, hash EAA345AE sample 18: - time = 462104 + time = 462125 flags = 1 data = length 229, hash 6957411F sample 19: - time = 485333 + time = 485354 flags = 1 data = length 219, hash 41275022 sample 20: - time = 508562 + time = 508583 flags = 1 data = length 241, hash 6495DF96 sample 21: - time = 531791 + time = 531812 flags = 1 data = length 228, hash 63D95906 sample 22: - time = 555020 + time = 555041 flags = 1 data = length 238, hash 34F676F9 sample 23: - time = 578250 + time = 578270 flags = 1 data = length 234, hash E5CBC045 sample 24: - time = 601479 + time = 601500 flags = 1 data = length 231, hash 5FC43661 sample 25: - time = 624708 + time = 624729 flags = 1 data = length 217, hash 682708ED sample 26: - time = 647937 + time = 647958 flags = 1 data = length 239, hash D43780FC sample 27: - time = 671166 + time = 671187 flags = 1 data = length 243, hash C5E17980 sample 28: - time = 694395 + time = 694416 flags = 1 data = length 231, hash AC5837BA sample 29: - time = 717625 + time = 717645 flags = 1 data = length 230, hash 169EE895 sample 30: - time = 740854 + time = 740875 flags = 1 data = length 238, hash C48FF3F1 sample 31: - time = 764083 + time = 764104 flags = 1 data = length 225, hash 531E4599 sample 32: - time = 787312 + time = 787333 flags = 1 data = length 232, hash CB3C6B8D sample 33: - time = 810541 + time = 810562 flags = 1 data = length 243, hash F8C94C7 sample 34: - time = 833770 + time = 833791 flags = 1 data = length 232, hash A646A7D0 sample 35: - time = 857000 + time = 857020 flags = 1 data = length 237, hash E8B787A5 sample 36: - time = 880229 + time = 880250 flags = 1 data = length 228, hash 3FA7A29F sample 37: - time = 903458 + time = 903479 flags = 1 data = length 235, hash B9B33B0A sample 38: - time = 926687 + time = 926708 flags = 1 data = length 264, hash 71A4869E sample 39: - time = 949916 + time = 949937 flags = 1 data = length 257, hash D049B54C sample 40: - time = 973145 + time = 973166 flags = 1 data = length 227, hash 66757231 sample 41: - time = 996375 + time = 996395 flags = 1 data = length 227, hash BD374F1B sample 42: - time = 1019604 + time = 1019625 flags = 1 data = length 235, hash 999477F6 sample 43: - time = 1042833 + time = 1042854 flags = 1 data = length 229, hash FFF98DF0 sample 44: - time = 1066062 + time = 1066083 flags = 536870913 data = length 6, hash 31B22286 track 1: diff --git a/libraries/test_data/src/test/assets/transformerdumps/mp4/sample_av1.mp4/transmuxed_with_inappmuxer.dump b/libraries/test_data/src/test/assets/transformerdumps/mp4/sample_av1.mp4/transmuxed_with_inappmuxer.dump index 490b36d332..83170fd09c 100644 --- a/libraries/test_data/src/test/assets/transformerdumps/mp4/sample_av1.mp4/transmuxed_with_inappmuxer.dump +++ b/libraries/test_data/src/test/assets/transformerdumps/mp4/sample_av1.mp4/transmuxed_with_inappmuxer.dump @@ -1,10 +1,10 @@ seekMap: isSeekable = true - duration = 1088300 + duration = 1045300 getPosition(0) = [[timeUs=0, position=400052]] getPosition(1) = [[timeUs=0, position=400052]] - getPosition(544150) = [[timeUs=0, position=400052]] - getPosition(1088300) = [[timeUs=0, position=400052]] + getPosition(522650) = [[timeUs=0, position=400052]] + getPosition(1045300) = [[timeUs=0, position=400052]] numberOfTracks = 2 track 0: total output bytes = 69084 @@ -160,7 +160,7 @@ track 1: initializationData: data = length 5, hash 2B7623A sample 0: - time = 0 + time = 43000 flags = 1 data = length 21, hash 77102128 sample 1: diff --git a/libraries/test_data/src/test/assets/transformerdumps/mp4/sample_no_bframes.mp4/transmuxed_with_inappmuxer.dump b/libraries/test_data/src/test/assets/transformerdumps/mp4/sample_no_bframes.mp4/transmuxed_with_inappmuxer.dump index b4f617e257..cdbdf364a2 100644 --- a/libraries/test_data/src/test/assets/transformerdumps/mp4/sample_no_bframes.mp4/transmuxed_with_inappmuxer.dump +++ b/libraries/test_data/src/test/assets/transformerdumps/mp4/sample_no_bframes.mp4/transmuxed_with_inappmuxer.dump @@ -1,10 +1,10 @@ seekMap: isSeekable = true - duration = 1089300 + duration = 1045300 getPosition(0) = [[timeUs=0, position=400052]] getPosition(1) = [[timeUs=0, position=400052]] - getPosition(544650) = [[timeUs=0, position=400052]] - getPosition(1089300) = [[timeUs=0, position=400052]] + getPosition(522650) = [[timeUs=0, position=400052]] + getPosition(1045300) = [[timeUs=0, position=400052]] numberOfTracks = 2 track 0: total output bytes = 301213 @@ -163,7 +163,7 @@ track 1: initializationData: data = length 2, hash 5F7 sample 0: - time = 0 + time = 44000 flags = 1 data = length 23, hash 47DE9131 sample 1: diff --git a/libraries/transformer/src/androidTest/java/androidx/media3/transformer/TransformerEndToEndTest.java b/libraries/transformer/src/androidTest/java/androidx/media3/transformer/TransformerEndToEndTest.java index 4f60662a4c..075dace516 100644 --- a/libraries/transformer/src/androidTest/java/androidx/media3/transformer/TransformerEndToEndTest.java +++ b/libraries/transformer/src/androidTest/java/androidx/media3/transformer/TransformerEndToEndTest.java @@ -2025,19 +2025,15 @@ public class TransformerEndToEndTest { FakeTrackOutput audioTrack = fakeExtractorOutput.trackOutputs.get(0); int expectedSampleCount = 68; audioTrack.assertSampleCount(expectedSampleCount); - // TODO: b/324903070 - InAppMuxer doesn't write edit lists to support gapless audio muxing. - // Output incorrectly starts at encoderDelay 0, PTS 0 assertThat(audioTrack.lastFormat.encoderDelay).isEqualTo(0); - assertThat(audioTrack.getSampleTimeUs(/* index= */ 0)).isEqualTo(0); + assertThat(audioTrack.getSampleTimeUs(/* index= */ 0)).isEqualTo(-16833); // TODO: b/270583563 - InAppMuxer always uses 1 / 48_000 timebase for audio. // The audio file in this test is 44_100 Hz, with timebase for audio of 1 / 44_100 and // each sample duration is exactly 1024 / 44_100, with no rounding errors. // Since InAppMuxer uses a different timebase for audio, some rounding errors are introduced // and MP4 sample durations are off. - // TODO: b/324903070 - expectedLastSampleTimeUs & expectedDurationUs are incorrect. - // Last sample time cannot be greater than total duration. assertThat(audioTrack.getSampleTimeUs(/* index= */ expectedSampleCount - 1)) - .isEqualTo(1_556_354); + .isEqualTo(1_539_520); } @Test