diff --git a/libraries/muxer/src/androidTest/java/androidx/media3/muxer/Mp4MuxerEndToEndAndroidTest.java b/libraries/muxer/src/androidTest/java/androidx/media3/muxer/Mp4MuxerEndToEndAndroidTest.java index 11a47f10b9..679808d3be 100644 --- a/libraries/muxer/src/androidTest/java/androidx/media3/muxer/Mp4MuxerEndToEndAndroidTest.java +++ b/libraries/muxer/src/androidTest/java/androidx/media3/muxer/Mp4MuxerEndToEndAndroidTest.java @@ -45,13 +45,23 @@ import org.junit.runners.Parameterized.Parameters; @RunWith(Parameterized.class) public class Mp4MuxerEndToEndAndroidTest { private static final String H264_MP4 = "sample_no_bframes.mp4"; + private static final String H264_WITH_NON_REFERENCE_B_FRAMES_MP4 = + "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 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"; @Parameters(name = "{0}") public static ImmutableList mediaSamples() { - return ImmutableList.of(H264_MP4, H265_HDR10_MP4, H265_WITH_METADATA_TRACK_MP4, AV1_MP4); + return ImmutableList.of( + H264_MP4, + H264_WITH_NON_REFERENCE_B_FRAMES_MP4, + H264_WITH_PYRAMID_B_FRAMES_MP4, + H265_HDR10_MP4, + H265_WITH_METADATA_TRACK_MP4, + AV1_MP4); } @Parameter public @MonotonicNonNull String inputFile; 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 94d31c0748..c1d986fe40 100644 --- a/libraries/muxer/src/main/java/androidx/media3/muxer/Boxes.java +++ b/libraries/muxer/src/main/java/androidx/media3/muxer/Boxes.java @@ -637,14 +637,14 @@ import java.util.Locale; } boolean hasBframe = false; - long lastSamplePresentationTimeUs = 0L; + long lastSampleCompositionTimeUs = 0L; for (int sampleId = 0; sampleId < samplesInfo.size(); sampleId++) { - long currentSamplePresentationTimeUs = samplesInfo.get(sampleId).presentationTimeUs; - presentationTimestampsUs.add(currentSamplePresentationTimeUs); - if (currentSamplePresentationTimeUs < lastSamplePresentationTimeUs) { + long currentSampleCompositionTimeUs = samplesInfo.get(sampleId).presentationTimeUs; + presentationTimestampsUs.add(currentSampleCompositionTimeUs); + if (currentSampleCompositionTimeUs < lastSampleCompositionTimeUs) { hasBframe = true; } - lastSamplePresentationTimeUs = currentSamplePresentationTimeUs; + lastSampleCompositionTimeUs = currentSampleCompositionTimeUs; } if (hasBframe) { @@ -713,6 +713,96 @@ import java.util.Locale; return BoxUtils.wrapIntoBox("stts", contents); } + /** Returns the ctts (composition time to sample) box. */ + public static ByteBuffer ctts( + List samplesInfo, List durationVu, int videoUnitTimescale) { + // Generate the sample composition offsets list to create ctts box. + List compositionOffsets = + Boxes.calculateSampleCompositionTimeOffsets(samplesInfo, durationVu, videoUnitTimescale); + + if (compositionOffsets.isEmpty()) { + return ByteBuffer.allocate(0); + } + + ByteBuffer contents = + ByteBuffer.allocate( + 2 * BYTES_PER_INTEGER + 2 * compositionOffsets.size() * BYTES_PER_INTEGER); + + contents.putInt(1); // version and flags. + + // We will know total entry count only after processing all the composition offsets, so put in a + // placeholder for total entry count and store its index. + int totalEntryCountIndex = contents.position(); + contents.putInt(0x0); // entry_count. + + int totalEntryCount = 0; + int lastCompositionOffset = -1; + int lastSampleCountIndex = -1; + + for (int i = 0; i < compositionOffsets.size(); i++) { + int currentCompositionOffset = compositionOffsets.get(i); + if (lastCompositionOffset != currentCompositionOffset) { + lastCompositionOffset = currentCompositionOffset; + lastSampleCountIndex = contents.position(); + + // sample_count; this will be updated instead of adding a new entry if the next sample has + // the same composition offset. + contents.putInt(1); // sample_count + contents.putInt(currentCompositionOffset); // sample_offset + totalEntryCount++; + } else { + contents.putInt(lastSampleCountIndex, contents.getInt(lastSampleCountIndex) + 1); + } + } + + contents.putInt(totalEntryCountIndex, totalEntryCount); + + contents.flip(); + return BoxUtils.wrapIntoBox("ctts", contents); + } + + /** + * Calculate sample composition time offsets (in timebase units). + * + *

The sample composition time offset gives offset between composition time (CT) and decoding + * time (DT), such that {@code CT(n) = DT(n) + sample_offset(n)}. + * + * @param samplesInfo A list of {@linkplain BufferInfo sample info}. + * @param durationVu A list of all the sample durations. + * @param videoUnitTimescale The timescale of the track. + * @return A list of all the sample composition time offsets. + */ + private static List calculateSampleCompositionTimeOffsets( + List samplesInfo, List durationVu, int videoUnitTimescale) { + List compositionOffsets = new ArrayList<>(samplesInfo.size()); + if (samplesInfo.isEmpty()) { + return compositionOffsets; + } + + long currentSampleDecodeTime = 0L; + boolean hasBframe = false; + long lastSampleCompositionTimeUs = 0L; + + for (int sampleId = 0; sampleId < samplesInfo.size(); sampleId++) { + long currentSampleCompositionTimeUs = samplesInfo.get(sampleId).presentationTimeUs; + long currentCompositionOffsetVu = + vuFromUs(currentSampleCompositionTimeUs, videoUnitTimescale) - currentSampleDecodeTime; + checkState(currentCompositionOffsetVu <= Integer.MAX_VALUE, "Only 32-bit offset is allowed"); + currentSampleDecodeTime += durationVu.get(sampleId); // DT(n+1) = DT(n) + STTS(n) + compositionOffsets.add((int) currentCompositionOffsetVu); + + if (currentSampleCompositionTimeUs < lastSampleCompositionTimeUs) { + hasBframe = true; + } + lastSampleCompositionTimeUs = currentSampleCompositionTimeUs; + } + + if (!hasBframe) { + compositionOffsets.clear(); + } + return compositionOffsets; + } + /** Returns the stsz (sample size) box. */ public static ByteBuffer stsz(List writtenSamples) { ByteBuffer contents = ByteBuffer.allocate(writtenSamples.size() * 4 + MAX_FIXED_LEAF_BOX_SIZE); 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 d74a9a2abb..5ab40933db 100644 --- a/libraries/muxer/src/main/java/androidx/media3/muxer/FragmentedMp4Writer.java +++ b/libraries/muxer/src/main/java/androidx/media3/muxer/FragmentedMp4Writer.java @@ -29,6 +29,7 @@ import static java.lang.Math.min; import android.media.MediaCodec; import android.media.MediaCodec.BufferInfo; +import androidx.media3.common.C; import androidx.media3.common.Format; import androidx.media3.common.MimeTypes; import androidx.media3.common.util.Util; @@ -73,6 +74,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; private boolean headerCreated; private long minInputPresentationTimeUs; private long maxTrackDurationUs; + private long lastSamplePresentationTimeUs; /** * Creates an instance. @@ -100,6 +102,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; this.fragmentDurationUs = fragmentDurationMs * 1_000; minInputPresentationTimeUs = Long.MAX_VALUE; currentFragmentSequenceNumber = 1; + lastSamplePresentationTimeUs = C.TIME_UNSET; } public TrackToken addTrack(int sortKey, Format format) { @@ -115,6 +118,9 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; TrackToken token, ByteBuffer byteBuffer, MediaCodec.BufferInfo bufferInfo) throws IOException { checkArgument(token instanceof Track); + checkArgument( + bufferInfo.presentationTimeUs > lastSamplePresentationTimeUs, + "Out of order B-frames are not supported"); if (!headerCreated) { createHeader(); headerCreated = true; @@ -124,6 +130,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; createFragment(); } track.writeSampleData(byteBuffer, bufferInfo); + lastSamplePresentationTimeUs = bufferInfo.presentationTimeUs; BufferInfo firstPendingSample = checkNotNull(track.pendingSamplesBufferInfo.peekFirst()); BufferInfo lastPendingSample = checkNotNull(track.pendingSamplesBufferInfo.peekLast()); minInputPresentationTimeUs = diff --git a/libraries/muxer/src/main/java/androidx/media3/muxer/Mp4MoovStructure.java b/libraries/muxer/src/main/java/androidx/media3/muxer/Mp4MoovStructure.java index e6ca9ec7cb..8565430ee7 100644 --- a/libraries/muxer/src/main/java/androidx/media3/muxer/Mp4MoovStructure.java +++ b/libraries/muxer/src/main/java/androidx/media3/muxer/Mp4MoovStructure.java @@ -95,6 +95,10 @@ import org.checkerframework.checker.nullness.qual.PolyNull; @C.TrackType int trackType = MimeTypes.getTrackType(format.sampleMimeType); ByteBuffer stts = Boxes.stts(sampleDurationsVu); + ByteBuffer ctts = + MimeTypes.isVideo(format.sampleMimeType) + ? Boxes.ctts(track.writtenSamples(), sampleDurationsVu, track.videoUnitTimebase()) + : ByteBuffer.allocate(0); ByteBuffer stsz = Boxes.stsz(track.writtenSamples()); ByteBuffer stsc = Boxes.stsc(track.writtenChunkSampleCounts()); ByteBuffer chunkOffsetBox = @@ -118,7 +122,13 @@ import org.checkerframework.checker.nullness.qual.PolyNull; stsdBox = Boxes.stsd(sampleEntryBox); stblBox = Boxes.stbl( - stsdBox, stts, stsz, stsc, chunkOffsetBox, Boxes.stss(track.writtenSamples())); + stsdBox, + stts, + ctts, + stsz, + stsc, + chunkOffsetBox, + Boxes.stss(track.writtenSamples())); break; case C.TRACK_TYPE_AUDIO: handlerType = "soun"; diff --git a/libraries/muxer/src/main/java/androidx/media3/muxer/Mp4Muxer.java b/libraries/muxer/src/main/java/androidx/media3/muxer/Mp4Muxer.java index 44a8a8d5e0..c6bef1a661 100644 --- a/libraries/muxer/src/main/java/androidx/media3/muxer/Mp4Muxer.java +++ b/libraries/muxer/src/main/java/androidx/media3/muxer/Mp4Muxer.java @@ -214,8 +214,6 @@ public final class Mp4Muxer implements Muxer { * modified after calling this method. Otherwise, they are copied and it is safe to modify them * after this method returns. * - *

Note: Out of order B-frames are currently not supported. - * * @param trackToken The {@link TrackToken} for which this sample is being written. * @param byteBuffer The encoded sample. The muxer takes ownership of the buffer if {@link * Builder#setSampleCopyEnabled(boolean) sample copying} is disabled. Otherwise, the position diff --git a/libraries/muxer/src/main/java/androidx/media3/muxer/Track.java b/libraries/muxer/src/main/java/androidx/media3/muxer/Track.java index afdfd11ede..38ead557f9 100644 --- a/libraries/muxer/src/main/java/androidx/media3/muxer/Track.java +++ b/libraries/muxer/src/main/java/androidx/media3/muxer/Track.java @@ -15,11 +15,8 @@ */ package androidx.media3.muxer; -import static androidx.media3.common.util.Assertions.checkArgument; - import android.media.MediaCodec; import android.media.MediaCodec.BufferInfo; -import androidx.media3.common.C; import androidx.media3.common.Format; import androidx.media3.common.MimeTypes; import androidx.media3.muxer.Muxer.TrackToken; @@ -42,7 +39,6 @@ import java.util.List; public boolean hadKeyframe; private final boolean sampleCopyEnabled; - private long lastSamplePresentationTimeUs; /** Creates an instance with {@code sortKey} set to 1. */ public Track(Format format, boolean sampleCopyEnabled) { @@ -65,13 +61,9 @@ import java.util.List; writtenChunkSampleCounts = new ArrayList<>(); pendingSamplesBufferInfo = new ArrayDeque<>(); pendingSamplesByteBuffer = new ArrayDeque<>(); - lastSamplePresentationTimeUs = C.TIME_UNSET; } public void writeSampleData(ByteBuffer byteBuffer, BufferInfo bufferInfo) { - checkArgument( - bufferInfo.presentationTimeUs > lastSamplePresentationTimeUs, - "Out of order B-frames are not supported"); // TODO: b/279931840 - Confirm whether muxer should throw when writing empty samples. // Skip empty samples. if (bufferInfo.size == 0 || byteBuffer.remaining() == 0) { @@ -106,7 +98,6 @@ import java.util.List; pendingSamplesBufferInfo.addLast(bufferInfoToAdd); pendingSamplesByteBuffer.addLast(byteBufferToAdd); - lastSamplePresentationTimeUs = bufferInfoToAdd.presentationTimeUs; } @Override 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 b93dc7fc52..9bc095bf30 100644 --- a/libraries/muxer/src/test/java/androidx/media3/muxer/BoxesTest.java +++ b/libraries/muxer/src/test/java/androidx/media3/muxer/BoxesTest.java @@ -517,6 +517,60 @@ public class BoxesTest { MuxerTestUtil.getExpectedDumpFilePath("stts_box_few_same_sample_durations")); } + @Test + public void createCttsBox_withSingleSampleTimestamp_returnsEmptyBox() { + List sampleBufferInfos = + createBufferInfoListWithSamplePresentationTimestamps(400); + List durationsVu = + Boxes.convertPresentationTimestampsToDurationsVu( + sampleBufferInfos, + /* firstSamplePresentationTimeUs= */ 0L, + VU_TIMEBASE, + LAST_FRAME_DURATION_BEHAVIOR_INSERT_SHORT_FRAME); + + ByteBuffer cttsBox = Boxes.ctts(sampleBufferInfos, durationsVu, VU_TIMEBASE); + + // Create empty box in case of 1 sample. + assertThat(cttsBox.hasRemaining()).isFalse(); + } + + @Test + public void createCttsBox_withNoBframesSampleTimestamps_returnsEmptyBox() throws IOException { + List sampleBufferInfos = + createBufferInfoListWithSamplePresentationTimestamps(0L, 1000L, 2000L); + List durationsVu = + Boxes.convertPresentationTimestampsToDurationsVu( + sampleBufferInfos, + /* firstSamplePresentationTimeUs= */ 0L, + VU_TIMEBASE, + LAST_FRAME_DURATION_BEHAVIOR_INSERT_SHORT_FRAME); + + ByteBuffer cttsBox = Boxes.ctts(sampleBufferInfos, durationsVu, VU_TIMEBASE); + + // Create empty ctts box in case samples does not contain B-frames. + assertThat(cttsBox.hasRemaining()).isFalse(); + } + + @Test + public void createCttsBox_withBFramesSampleTimestamps_matchesExpected() throws IOException { + List sampleBufferInfos = + createBufferInfoListWithSamplePresentationTimestamps( + 0, 400, 200, 100, 300, 800, 600, 500, 700); + + List durationsVu = + Boxes.convertPresentationTimestampsToDurationsVu( + sampleBufferInfos, + /* firstSamplePresentationTimeUs= */ 0L, + VU_TIMEBASE, + LAST_FRAME_DURATION_BEHAVIOR_INSERT_SHORT_FRAME); + + ByteBuffer cttsBox = Boxes.ctts(sampleBufferInfos, durationsVu, VU_TIMEBASE); + + DumpableMp4Box dumpableBox = new DumpableMp4Box(cttsBox); + DumpFileAsserts.assertOutput( + context, dumpableBox, MuxerTestUtil.getExpectedDumpFilePath("ctts_box")); + } + @Test public void createStszBox_matchesExpected() throws IOException { List sampleBufferInfos = 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 e4c18d0578..2d5c61e2d5 100644 --- a/libraries/muxer/src/test/java/androidx/media3/muxer/Mp4MuxerEndToEndTest.java +++ b/libraries/muxer/src/test/java/androidx/media3/muxer/Mp4MuxerEndToEndTest.java @@ -19,7 +19,6 @@ import static androidx.media3.muxer.MuxerTestUtil.FAKE_VIDEO_FORMAT; import static androidx.media3.muxer.MuxerTestUtil.XMP_SAMPLE_DATA; import static androidx.media3.muxer.MuxerTestUtil.getFakeSampleAndSampleInfo; import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertThrows; import android.content.Context; import android.media.MediaCodec.BufferInfo; @@ -31,6 +30,7 @@ import androidx.media3.container.Mp4OrientationData; import androidx.media3.container.Mp4TimestampData; import androidx.media3.container.XmpData; import androidx.media3.extractor.mp4.Mp4Extractor; +import androidx.media3.extractor.text.DefaultSubtitleParserFactory; import androidx.media3.muxer.Muxer.TrackToken; import androidx.media3.test.utils.DumpFileAsserts; import androidx.media3.test.utils.DumpableMp4Box; @@ -157,26 +157,38 @@ public class Mp4MuxerEndToEndTest { } @Test - public void writeSampleData_withOutOfOrderSampleTimestamps_throws() throws IOException { + public void createMp4File_withOutOfOrderBframes_matchesExpected() throws IOException { String outputFilePath = temporaryFolder.newFile().getPath(); Mp4Muxer mp4Muxer = new Mp4Muxer.Builder(new FileOutputStream(outputFilePath)).build(); + mp4Muxer.addMetadata( + new Mp4TimestampData( + /* creationTimestampSeconds= */ 100_000_000L, + /* modificationTimestampSeconds= */ 500_000_000L)); Pair track1Sample1 = getFakeSampleAndSampleInfo(/* presentationTimeUs= */ 0L); Pair track1Sample2 = - getFakeSampleAndSampleInfo(/* presentationTimeUs= */ 2000L); + getFakeSampleAndSampleInfo(/* presentationTimeUs= */ 3000L); Pair track1Sample3 = getFakeSampleAndSampleInfo(/* presentationTimeUs= */ 1000L); + Pair track1Sample4 = + getFakeSampleAndSampleInfo(/* presentationTimeUs= */ 2000L); + try { TrackToken track1 = mp4Muxer.addTrack(/* sortKey= */ 0, FAKE_VIDEO_FORMAT); mp4Muxer.writeSampleData(track1, track1Sample1.first, track1Sample1.second); mp4Muxer.writeSampleData(track1, track1Sample2.first, track1Sample2.second); - - assertThrows( - IllegalArgumentException.class, - () -> mp4Muxer.writeSampleData(track1, track1Sample3.first, track1Sample3.second)); + mp4Muxer.writeSampleData(track1, track1Sample3.first, track1Sample3.second); + mp4Muxer.writeSampleData(track1, track1Sample4.first, track1Sample4.second); } finally { mp4Muxer.close(); } + FakeExtractorOutput fakeExtractorOutput = + TestUtil.extractAllSamplesFromFilePath( + new Mp4Extractor(new DefaultSubtitleParserFactory()), outputFilePath); + DumpFileAsserts.assertOutput( + context, + fakeExtractorOutput, + MuxerTestUtil.getExpectedDumpFilePath("mp4_with_b_frame.mp4")); } @Test diff --git a/libraries/test_data/src/test/assets/media/mp4/bbb_800x640_768kbps_30fps_avc_non_reference_3b.mp4 b/libraries/test_data/src/test/assets/media/mp4/bbb_800x640_768kbps_30fps_avc_non_reference_3b.mp4 new file mode 100644 index 0000000000..2ca801027e Binary files /dev/null and b/libraries/test_data/src/test/assets/media/mp4/bbb_800x640_768kbps_30fps_avc_non_reference_3b.mp4 differ diff --git a/libraries/test_data/src/test/assets/media/mp4/bbb_800x640_768kbps_30fps_avc_pyramid_3b.mp4 b/libraries/test_data/src/test/assets/media/mp4/bbb_800x640_768kbps_30fps_avc_pyramid_3b.mp4 new file mode 100644 index 0000000000..d97e61dbe0 Binary files /dev/null and b/libraries/test_data/src/test/assets/media/mp4/bbb_800x640_768kbps_30fps_avc_pyramid_3b.mp4 differ diff --git a/libraries/test_data/src/test/assets/media/ts/sample_no_bframes.ts b/libraries/test_data/src/test/assets/media/ts/sample_no_bframes.ts deleted file mode 100644 index 6514dd6772..0000000000 Binary files a/libraries/test_data/src/test/assets/media/ts/sample_no_bframes.ts and /dev/null differ diff --git a/libraries/test_data/src/test/assets/muxerdumps/bbb_800x640_768kbps_30fps_avc_non_reference_3b.mp4.dump b/libraries/test_data/src/test/assets/muxerdumps/bbb_800x640_768kbps_30fps_avc_non_reference_3b.mp4.dump new file mode 100644 index 0000000000..7b2174c424 --- /dev/null +++ b/libraries/test_data/src/test/assets/muxerdumps/bbb_800x640_768kbps_30fps_avc_non_reference_3b.mp4.dump @@ -0,0 +1,507 @@ +seekMap: + isSeekable = true + duration = 3966600 + getPosition(0) = [[timeUs=0, position=44]] + getPosition(1) = [[timeUs=0, position=44], [timeUs=1000000, position=152546]] + getPosition(1983300) = [[timeUs=1000000, position=152546], [timeUs=2000000, position=238309]] + getPosition(3966600) = [[timeUs=3000000, position=353603]] +numberOfTracks = 1 +track 0: + total output bytes = 416333 + sample count = 120 + format 0: + id = 1 + sampleMimeType = video/avc + codecs = avc1.64001F + maxInputSize = 74696 + width = 800 + height = 640 + frameRate = 30.25261 + colorInfo: + lumaBitdepth = 8 + chromaBitdepth = 8 + metadata = entries=[Mp4Timestamp: creation time=100000000, modification time=500000000, timescale=10000] + initializationData: + data = length 33, hash 800C8D16 + data = length 9, hash FBAE9B2D + sample 0: + time = 0 + flags = 1 + data = length 74666, hash D583C47C + sample 1: + time = 133322 + flags = 0 + data = length 3689, hash C17F9AAD + sample 2: + time = 33322 + flags = 0 + data = length 573, hash AE0E0278 + sample 3: + time = 66655 + flags = 0 + data = length 1219, hash D94D73C6 + sample 4: + time = 100000 + flags = 0 + data = length 1575, hash 84E86A1D + sample 5: + time = 266655 + flags = 0 + data = length 23470, hash F5757CD0 + sample 6: + time = 166655 + flags = 0 + data = length 974, hash E45D44A4 + sample 7: + time = 200000 + flags = 0 + data = length 129, hash 21B833C0 + sample 8: + time = 233322 + flags = 0 + data = length 109, hash 1DBB1436 + sample 9: + time = 400000 + flags = 0 + data = length 716, hash 75873FC1 + sample 10: + time = 300000 + flags = 0 + data = length 226, hash 289041D3 + sample 11: + time = 333322 + flags = 0 + data = length 237, hash 4C108F08 + sample 12: + time = 366655 + flags = 0 + data = length 131, hash 8F6A446D + sample 13: + time = 533322 + flags = 0 + data = length 2303, hash 54F5847D + sample 14: + time = 433322 + flags = 0 + data = length 185, hash 5109747F + sample 15: + time = 466655 + flags = 0 + data = length 262, hash 24BD065A + sample 16: + time = 500000 + flags = 0 + data = length 421, hash F9F1FE52 + sample 17: + time = 666655 + flags = 0 + data = length 4384, hash 62A87795 + sample 18: + time = 566655 + flags = 0 + data = length 2370, hash F0A5ED86 + sample 19: + time = 600000 + flags = 0 + data = length 2204, hash B7522E5E + sample 20: + time = 633322 + flags = 0 + data = length 1780, hash 4C8582ED + sample 21: + time = 800000 + flags = 0 + data = length 5879, hash FE4332DA + sample 22: + time = 700000 + flags = 0 + data = length 2204, hash 9AB285B2 + sample 23: + time = 733322 + flags = 0 + data = length 2877, hash 139BF1F4 + sample 24: + time = 766655 + flags = 0 + data = length 2982, hash E9ADDDFA + sample 25: + time = 933322 + flags = 0 + data = length 7925, hash 177E51B5 + sample 26: + time = 833322 + flags = 0 + data = length 3139, hash 10486834 + sample 27: + time = 866655 + flags = 0 + data = length 2843, hash 78AF658C + sample 28: + time = 900000 + flags = 0 + data = length 1252, hash 5933C8B8 + sample 29: + time = 966655 + flags = 0 + data = length 1778, hash 4B8CF7CE + sample 30: + time = 1000000 + flags = 1 + data = length 29827, hash A8B8D740 + sample 31: + time = 1133322 + flags = 0 + data = length 2572, hash 7D158CDD + sample 32: + time = 1033322 + flags = 0 + data = length 713, hash F3649370 + sample 33: + time = 1066655 + flags = 0 + data = length 789, hash DFDC8672 + sample 34: + time = 1100000 + flags = 0 + data = length 587, hash A095E207 + sample 35: + time = 1266655 + flags = 0 + data = length 9906, hash A8997416 + sample 36: + time = 1166655 + flags = 0 + data = length 703, hash 653E1AAF + sample 37: + time = 1200000 + flags = 0 + data = length 1925, hash AC147859 + sample 38: + time = 1233322 + flags = 0 + data = length 1128, hash 39EB8BCE + sample 39: + time = 1400000 + flags = 0 + data = length 3082, hash E011B328 + sample 40: + time = 1300000 + flags = 0 + data = length 775, hash 67AE4345 + sample 41: + time = 1333322 + flags = 0 + data = length 702, hash AF1F22E6 + sample 42: + time = 1366655 + flags = 0 + data = length 392, hash FE873AA + sample 43: + time = 1533322 + flags = 0 + data = length 3293, hash 7DA83640 + sample 44: + time = 1433322 + flags = 0 + data = length 721, hash 896D4F13 + sample 45: + time = 1466655 + flags = 0 + data = length 725, hash 95CBF946 + sample 46: + time = 1500000 + flags = 0 + data = length 776, hash 5EB11334 + sample 47: + time = 1666655 + flags = 0 + data = length 1956, hash 80B2B533 + sample 48: + time = 1566655 + flags = 0 + data = length 592, hash 7C7832BF + sample 49: + time = 1600000 + flags = 0 + data = length 731, hash 92AA1FD2 + sample 50: + time = 1633322 + flags = 0 + data = length 518, hash 18E84AFC + sample 51: + time = 1800000 + flags = 0 + data = length 5411, hash DF6B9A19 + sample 52: + time = 1700000 + flags = 0 + data = length 565, hash A18215E + sample 53: + time = 1733322 + flags = 0 + data = length 916, hash 4F4089C8 + sample 54: + time = 1766655 + flags = 0 + data = length 1651, hash 893D58B4 + sample 55: + time = 1933322 + flags = 0 + data = length 5170, hash 3D0964F5 + sample 56: + time = 1833322 + flags = 0 + data = length 1448, hash 3978CED5 + sample 57: + time = 1866655 + flags = 0 + data = length 1797, hash BB343C33 + sample 58: + time = 1900000 + flags = 0 + data = length 1650, hash BDB93BB + sample 59: + time = 1966655 + flags = 0 + data = length 4742, hash C905018E + sample 60: + time = 2000000 + flags = 1 + data = length 30426, hash 12B69F22 + sample 61: + time = 2133322 + flags = 0 + data = length 7531, hash 1768FC1C + sample 62: + time = 2033322 + flags = 0 + data = length 2405, hash 82938115 + sample 63: + time = 2066655 + flags = 0 + data = length 2377, hash 5677E8DB + sample 64: + time = 2100000 + flags = 0 + data = length 2135, hash B0F9E72D + sample 65: + time = 2266655 + flags = 0 + data = length 12031, hash 4F954746 + sample 66: + time = 2166655 + flags = 0 + data = length 1790, hash 517CF8F5 + sample 67: + time = 2200000 + flags = 0 + data = length 2014, hash CC430DAF + sample 68: + time = 2233322 + flags = 0 + data = length 1192, hash 343BF233 + sample 69: + time = 2400000 + flags = 0 + data = length 5118, hash A4CA24FB + sample 70: + time = 2300000 + flags = 0 + data = length 1060, hash 4116AF37 + sample 71: + time = 2333322 + flags = 0 + data = length 1345, hash E94F739C + sample 72: + time = 2366655 + flags = 0 + data = length 1558, hash 2FB36B5A + sample 73: + time = 2533322 + flags = 0 + data = length 8004, hash 79ACB806 + sample 74: + time = 2433322 + flags = 0 + data = length 2858, hash EBE6B4A4 + sample 75: + time = 2466655 + flags = 0 + data = length 4289, hash FEBF0899 + sample 76: + time = 2500000 + flags = 0 + data = length 4678, hash 758EE78D + sample 77: + time = 2666655 + flags = 0 + data = length 6554, hash 6717D949 + sample 78: + time = 2566655 + flags = 0 + data = length 2376, hash F768DB52 + sample 79: + time = 2600000 + flags = 0 + data = length 1532, hash E205FE8A + sample 80: + time = 2633322 + flags = 0 + data = length 1366, hash 4202F62D + sample 81: + time = 2800000 + flags = 0 + data = length 3253, hash F406909B + sample 82: + time = 2700000 + flags = 0 + data = length 749, hash 68F6F14C + sample 83: + time = 2733322 + flags = 0 + data = length 946, hash 43364529 + sample 84: + time = 2766655 + flags = 0 + data = length 593, hash 6E23A558 + sample 85: + time = 2933322 + flags = 0 + data = length 2917, hash 1789092B + sample 86: + time = 2833322 + flags = 0 + data = length 644, hash 6C511C36 + sample 87: + time = 2866655 + flags = 0 + data = length 719, hash 6E2C34E3 + sample 88: + time = 2900000 + flags = 0 + data = length 594, hash F4C056C4 + sample 89: + time = 2966655 + flags = 0 + data = length 2240, hash D24BA33 + sample 90: + time = 3000000 + flags = 1 + data = length 33075, hash 16D07BC4 + sample 91: + time = 3133322 + flags = 0 + data = length 3349, hash C1D93B2C + sample 92: + time = 3033322 + flags = 0 + data = length 863, hash EC21EA13 + sample 93: + time = 3066655 + flags = 0 + data = length 807, hash C5533997 + sample 94: + time = 3100000 + flags = 0 + data = length 430, hash 918D1401 + sample 95: + time = 3266655 + flags = 0 + data = length 4883, hash 342581AD + sample 96: + time = 3166655 + flags = 0 + data = length 431, hash 84FF1E7C + sample 97: + time = 3200000 + flags = 0 + data = length 1272, hash C7833EE5 + sample 98: + time = 3233322 + flags = 0 + data = length 821, hash 2F5B3EC3 + sample 99: + time = 3400000 + flags = 0 + data = length 2214, hash 1F4632E2 + sample 100: + time = 3300000 + flags = 0 + data = length 530, hash AF4AC2BE + sample 101: + time = 3333322 + flags = 0 + data = length 681, hash 557F3F5F + sample 102: + time = 3366655 + flags = 0 + data = length 447, hash 8A6157D2 + sample 103: + time = 3533322 + flags = 0 + data = length 2523, hash 4D9C62B1 + sample 104: + time = 3433322 + flags = 0 + data = length 559, hash 7E751737 + sample 105: + time = 3466655 + flags = 0 + data = length 650, hash 66286CB2 + sample 106: + time = 3500000 + flags = 0 + data = length 603, hash 9948D320 + sample 107: + time = 3666655 + flags = 0 + data = length 1203, hash BEDA938F + sample 108: + time = 3566655 + flags = 0 + data = length 287, hash 97219C89 + sample 109: + time = 3600000 + flags = 0 + data = length 401, hash 524D4D75 + sample 110: + time = 3633322 + flags = 0 + data = length 403, hash C138F2A + sample 111: + time = 3800000 + flags = 0 + data = length 1328, hash F1B32991 + sample 112: + time = 3700000 + flags = 0 + data = length 453, hash 1FCC9636 + sample 113: + time = 3733322 + flags = 0 + data = length 422, hash 19573075 + sample 114: + time = 3766655 + flags = 0 + data = length 322, hash 6752D2AB + sample 115: + time = 3933322 + flags = 0 + data = length 1128, hash 3B04FE26 + sample 116: + time = 3833322 + flags = 0 + data = length 404, hash F0BF973E + sample 117: + time = 3866655 + flags = 0 + data = length 511, hash FB98417B + sample 118: + time = 3900000 + flags = 0 + data = length 458, hash 2440801E + sample 119: + time = 3966655 + flags = 536870912 + data = length 1316, hash 7DDE435E +tracksEnded = true diff --git a/libraries/test_data/src/test/assets/muxerdumps/bbb_800x640_768kbps_30fps_avc_pyramid_3b.mp4.dump b/libraries/test_data/src/test/assets/muxerdumps/bbb_800x640_768kbps_30fps_avc_pyramid_3b.mp4.dump new file mode 100644 index 0000000000..8c476003f0 --- /dev/null +++ b/libraries/test_data/src/test/assets/muxerdumps/bbb_800x640_768kbps_30fps_avc_pyramid_3b.mp4.dump @@ -0,0 +1,507 @@ +seekMap: + isSeekable = true + duration = 3966600 + getPosition(0) = [[timeUs=0, position=44]] + getPosition(1) = [[timeUs=0, position=44], [timeUs=1000000, position=147439]] + getPosition(1983300) = [[timeUs=1000000, position=147439], [timeUs=2000000, position=231666]] + getPosition(3966600) = [[timeUs=3000000, position=343992]] +numberOfTracks = 1 +track 0: + total output bytes = 406132 + sample count = 120 + format 0: + id = 1 + sampleMimeType = video/avc + codecs = avc1.64001F + maxInputSize = 74696 + width = 800 + height = 640 + frameRate = 30.25261 + colorInfo: + lumaBitdepth = 8 + chromaBitdepth = 8 + metadata = entries=[Mp4Timestamp: creation time=100000000, modification time=500000000, timescale=10000] + initializationData: + data = length 33, hash A51E6AF9 + data = length 9, hash FBAE9B2D + sample 0: + time = 0 + flags = 1 + data = length 74666, hash 9AF2BE5A + sample 1: + time = 133322 + flags = 0 + data = length 3689, hash 23BF8CA2 + sample 2: + time = 66655 + flags = 0 + data = length 1319, hash 7E6541DB + sample 3: + time = 33322 + flags = 0 + data = length 466, hash ECD93C68 + sample 4: + time = 100000 + flags = 0 + data = length 785, hash 3E824588 + sample 5: + time = 266655 + flags = 0 + data = length 23472, hash 4A790E9B + sample 6: + time = 200000 + flags = 0 + data = length 169, hash B408CF0C + sample 7: + time = 166655 + flags = 0 + data = length 1008, hash 558016DF + sample 8: + time = 233322 + flags = 0 + data = length 60, hash A5220F0F + sample 9: + time = 400000 + flags = 0 + data = length 718, hash 56CA9233 + sample 10: + time = 333322 + flags = 0 + data = length 277, hash F27B77B0 + sample 11: + time = 300000 + flags = 0 + data = length 204, hash 451A7EF8 + sample 12: + time = 366655 + flags = 0 + data = length 100, hash 72CCF451 + sample 13: + time = 533322 + flags = 0 + data = length 2305, hash EE8EAD07 + sample 14: + time = 466655 + flags = 0 + data = length 313, hash 23FD6C99 + sample 15: + time = 433322 + flags = 0 + data = length 161, hash F9082751 + sample 16: + time = 500000 + flags = 0 + data = length 512, hash F0317F7B + sample 17: + time = 666655 + flags = 0 + data = length 4386, hash 536E4530 + sample 18: + time = 600000 + flags = 0 + data = length 2418, hash 3CA55886 + sample 19: + time = 566655 + flags = 0 + data = length 818, hash CF732FE9 + sample 20: + time = 633322 + flags = 0 + data = length 931, hash 9307BF9B + sample 21: + time = 800000 + flags = 0 + data = length 5881, hash 95D65FB + sample 22: + time = 733322 + flags = 0 + data = length 3241, hash C3722BD2 + sample 23: + time = 700000 + flags = 0 + data = length 1957, hash 54FE72A0 + sample 24: + time = 766655 + flags = 0 + data = length 943, hash 467A1DB1 + sample 25: + time = 933322 + flags = 0 + data = length 7927, hash 20EB2632 + sample 26: + time = 866655 + flags = 0 + data = length 3313, hash B854BF3E + sample 27: + time = 833322 + flags = 0 + data = length 2729, hash FC827FEE + sample 28: + time = 900000 + flags = 0 + data = length 847, hash 739EFD75 + sample 29: + time = 966655 + flags = 0 + data = length 1780, hash 8C1AF0B1 + sample 30: + time = 1000000 + flags = 1 + data = length 29827, hash B287A700 + sample 31: + time = 1133322 + flags = 0 + data = length 2572, hash AB201EC8 + sample 32: + time = 1066655 + flags = 0 + data = length 980, hash BD0ADFF1 + sample 33: + time = 1033322 + flags = 0 + data = length 343, hash 645A3973 + sample 34: + time = 1100000 + flags = 0 + data = length 476, hash 89BF903C + sample 35: + time = 1266655 + flags = 0 + data = length 9908, hash BDFEA8A4 + sample 36: + time = 1200000 + flags = 0 + data = length 2422, hash 863FCD89 + sample 37: + time = 1166655 + flags = 0 + data = length 718, hash E21DB793 + sample 38: + time = 1233322 + flags = 0 + data = length 475, hash 6E2B14C6 + sample 39: + time = 1400000 + flags = 0 + data = length 3084, hash 92862A1A + sample 40: + time = 1333322 + flags = 0 + data = length 825, hash 978654C8 + sample 41: + time = 1300000 + flags = 0 + data = length 705, hash 28D04FCA + sample 42: + time = 1366655 + flags = 0 + data = length 335, hash D736EAC1 + sample 43: + time = 1533322 + flags = 0 + data = length 3295, hash 2FCFA14A + sample 44: + time = 1466655 + flags = 0 + data = length 897, hash 6C76AFF1 + sample 45: + time = 1433322 + flags = 0 + data = length 499, hash DDBE39E + sample 46: + time = 1500000 + flags = 0 + data = length 565, hash D269272C + sample 47: + time = 1666655 + flags = 0 + data = length 1958, hash 4A334D4E + sample 48: + time = 1600000 + flags = 0 + data = length 871, hash 21A0191A + sample 49: + time = 1566655 + flags = 0 + data = length 363, hash 376C3CBE + sample 50: + time = 1633322 + flags = 0 + data = length 398, hash BA958C19 + sample 51: + time = 1800000 + flags = 0 + data = length 5413, hash 83EA9FBA + sample 52: + time = 1733322 + flags = 0 + data = length 1124, hash D7ADA732 + sample 53: + time = 1700000 + flags = 0 + data = length 579, hash B6D6A34F + sample 54: + time = 1766655 + flags = 0 + data = length 1206, hash 1C5174A3 + sample 55: + time = 1933322 + flags = 0 + data = length 5172, hash C4EBB198 + sample 56: + time = 1866655 + flags = 0 + data = length 2045, hash 81261E50 + sample 57: + time = 1833322 + flags = 0 + data = length 915, hash FFEDB29E + sample 58: + time = 1900000 + flags = 0 + data = length 1513, hash C03809BF + sample 59: + time = 1966655 + flags = 0 + data = length 4744, hash D0E55AF1 + sample 60: + time = 2000000 + flags = 1 + data = length 30426, hash E5A29561 + sample 61: + time = 2133322 + flags = 0 + data = length 7531, hash 756AE4D1 + sample 62: + time = 2066655 + flags = 0 + data = length 2740, hash 669E4DF1 + sample 63: + time = 2033322 + flags = 0 + data = length 1829, hash 66A7C400 + sample 64: + time = 2100000 + flags = 0 + data = length 1423, hash DD6288B3 + sample 65: + time = 2266655 + flags = 0 + data = length 12033, hash 244DD978 + sample 66: + time = 2200000 + flags = 0 + data = length 2481, hash 9302A030 + sample 67: + time = 2166655 + flags = 0 + data = length 1770, hash 86E54271 + sample 68: + time = 2233322 + flags = 0 + data = length 636, hash B0BB7A9D + sample 69: + time = 2400000 + flags = 0 + data = length 5120, hash 8381F6ED + sample 70: + time = 2333322 + flags = 0 + data = length 1610, hash E9A0711D + sample 71: + time = 2300000 + flags = 0 + data = length 961, hash 494E3770 + sample 72: + time = 2366655 + flags = 0 + data = length 1402, hash 3D40A6D1 + sample 73: + time = 2533322 + flags = 0 + data = length 8006, hash A8C425BC + sample 74: + time = 2466655 + flags = 0 + data = length 4620, hash 18719317 + sample 75: + time = 2433322 + flags = 0 + data = length 2507, hash 104771A0 + sample 76: + time = 2500000 + flags = 0 + data = length 3970, hash B52DD9E + sample 77: + time = 2666655 + flags = 0 + data = length 6556, hash 173F0724 + sample 78: + time = 2600000 + flags = 0 + data = length 1824, hash 8BB687AC + sample 79: + time = 2566655 + flags = 0 + data = length 1851, hash 29CD7E58 + sample 80: + time = 2633322 + flags = 0 + data = length 731, hash 4E6BD69C + sample 81: + time = 2800000 + flags = 0 + data = length 3255, hash FCDDDFFC + sample 82: + time = 2733322 + flags = 0 + data = length 1118, hash 77E855CA + sample 83: + time = 2700000 + flags = 0 + data = length 413, hash E83C433F + sample 84: + time = 2766655 + flags = 0 + data = length 514, hash 9ED8EF4B + sample 85: + time = 2933322 + flags = 0 + data = length 2919, hash 93BC27A8 + sample 86: + time = 2866655 + flags = 0 + data = length 833, hash 213B7EAB + sample 87: + time = 2833322 + flags = 0 + data = length 574, hash 554020E9 + sample 88: + time = 2900000 + flags = 0 + data = length 431, hash 6C3E69F6 + sample 89: + time = 2966655 + flags = 0 + data = length 2242, hash 8EC9C1D6 + sample 90: + time = 3000000 + flags = 1 + data = length 33075, hash C0FCCB84 + sample 91: + time = 3133322 + flags = 0 + data = length 3349, hash ADE2C1A1 + sample 92: + time = 3066655 + flags = 0 + data = length 890, hash C384FE6A + sample 93: + time = 3033322 + flags = 0 + data = length 822, hash 2897A348 + sample 94: + time = 3100000 + flags = 0 + data = length 347, hash 968D3ED1 + sample 95: + time = 3266655 + flags = 0 + data = length 4885, hash 57E006DF + sample 96: + time = 3200000 + flags = 0 + data = length 1714, hash 10B49A30 + sample 97: + time = 3166655 + flags = 0 + data = length 502, hash B0FDBCA + sample 98: + time = 3233322 + flags = 0 + data = length 378, hash AFCB47B5 + sample 99: + time = 3400000 + flags = 0 + data = length 2216, hash 102B8AD4 + sample 100: + time = 3333322 + flags = 0 + data = length 785, hash 10C1C847 + sample 101: + time = 3300000 + flags = 0 + data = length 499, hash F11DD54 + sample 102: + time = 3366655 + flags = 0 + data = length 352, hash 32BD14FA + sample 103: + time = 3533322 + flags = 0 + data = length 2525, hash F426C83B + sample 104: + time = 3466655 + flags = 0 + data = length 732, hash 6BD8DF40 + sample 105: + time = 3433322 + flags = 0 + data = length 466, hash F2253523 + sample 106: + time = 3500000 + flags = 0 + data = length 519, hash 457EB20F + sample 107: + time = 3666655 + flags = 0 + data = length 1205, hash A8894214 + sample 108: + time = 3600000 + flags = 0 + data = length 483, hash 3C3E6CBA + sample 109: + time = 3566655 + flags = 0 + data = length 157, hash E3D5E025 + sample 110: + time = 3633322 + flags = 0 + data = length 237, hash A7217EC5 + sample 111: + time = 3800000 + flags = 0 + data = length 1330, hash 6CDE1190 + sample 112: + time = 3733322 + flags = 0 + data = length 475, hash B9925752 + sample 113: + time = 3700000 + flags = 0 + data = length 392, hash 2709B2E0 + sample 114: + time = 3766655 + flags = 0 + data = length 258, hash 900651AF + sample 115: + time = 3933322 + flags = 0 + data = length 1130, hash 9C8E9289 + sample 116: + time = 3866655 + flags = 0 + data = length 581, hash 79FAD374 + sample 117: + time = 3833322 + flags = 0 + data = length 285, hash B460CF8A + sample 118: + time = 3900000 + flags = 0 + data = length 277, hash A40F948C + sample 119: + time = 3966655 + flags = 536870912 + data = length 1318, hash 9A6E5D81 +tracksEnded = true diff --git a/libraries/test_data/src/test/assets/muxerdumps/ctts_box.dump b/libraries/test_data/src/test/assets/muxerdumps/ctts_box.dump new file mode 100644 index 0000000000..a676a1b5ed --- /dev/null +++ b/libraries/test_data/src/test/assets/muxerdumps/ctts_box.dump @@ -0,0 +1,2 @@ +ctts (88 bytes): + Data = length 80, hash FC850C18 diff --git a/libraries/test_data/src/test/assets/muxerdumps/mp4_with_b_frame.mp4.dump b/libraries/test_data/src/test/assets/muxerdumps/mp4_with_b_frame.mp4.dump new file mode 100644 index 0000000000..40803c280c --- /dev/null +++ b/libraries/test_data/src/test/assets/muxerdumps/mp4_with_b_frame.mp4.dump @@ -0,0 +1,44 @@ +seekMap: + isSeekable = true + duration = 3000 + getPosition(0) = [[timeUs=0, position=44]] + getPosition(1) = [[timeUs=0, position=44], [timeUs=3000, position=100]] + getPosition(1500) = [[timeUs=0, position=44], [timeUs=3000, position=100]] + getPosition(3000) = [[timeUs=3000, position=100]] +numberOfTracks = 1 +track 0: + total output bytes = 224 + sample count = 4 + format 0: + id = 1 + sampleMimeType = video/avc + codecs = avc1.F4000A + maxInputSize = 86 + width = 12 + height = 10 + frameRate = 1333.3334 + 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 = 0 + flags = 1 + data = length 56, hash C4551A2E + sample 1: + time = 3000 + flags = 1 + data = length 56, hash C4551A2E + sample 2: + time = 1000 + flags = 1 + data = length 56, hash C4551A2E + sample 3: + time = 2000 + flags = 536870913 + data = length 56, hash C4551A2E +tracksEnded = true diff --git a/libraries/test_data/src/test/assets/transformerdumps/ts/sample_h264.ts/transmuxed_with_inappmuxer.dump b/libraries/test_data/src/test/assets/transformerdumps/ts/sample_h264.ts/transmuxed_with_inappmuxer.dump new file mode 100644 index 0000000000..a755737f50 --- /dev/null +++ b/libraries/test_data/src/test/assets/transformerdumps/ts/sample_h264.ts/transmuxed_with_inappmuxer.dump @@ -0,0 +1,144 @@ +seekMap: + isSeekable = true + duration = 933300 + getPosition(0) = [[timeUs=66655, position=44]] + getPosition(1) = [[timeUs=66655, position=44]] + getPosition(466650) = [[timeUs=400000, position=16035], [timeUs=733322, position=28785]] + getPosition(933300) = [[timeUs=733322, position=28785]] +numberOfTracks = 1 +track 0: + total output bytes = 41412 + sample count = 29 + format 0: + id = 1 + sampleMimeType = video/avc + codecs = avc1.64001F + maxInputSize = 11267 + width = 854 + height = 480 + frameRate = 31.072538 + colorInfo: + colorRange = 2 + lumaBitdepth = 8 + chromaBitdepth = 8 + metadata = entries=[Mp4Timestamp: creation time=3000000000, modification time=4000000000, timescale=10000] + initializationData: + data = length 30, hash B65D1A82 + data = length 10, hash 7A0D0F2B + sample 0: + time = 66655 + flags = 1 + data = length 859, hash 202E188E + sample 1: + time = 100000 + flags = 0 + data = length 3331, hash 88D7E46A + sample 2: + time = 166655 + flags = 0 + data = length 6850, hash FAE2363A + sample 3: + time = 133322 + flags = 0 + data = length 795, hash EE994ED1 + sample 4: + time = 233322 + flags = 0 + data = length 1875, hash C1B4CECB + sample 5: + time = 200000 + flags = 0 + data = length 1210, hash 8FA2B5B1 + sample 6: + time = 366655 + flags = 0 + data = length 477, hash 555E99C + sample 7: + time = 300000 + flags = 0 + data = length 326, hash 8FAE3F64 + sample 8: + time = 266655 + flags = 0 + data = length 90, hash 84A60B02 + sample 9: + time = 333322 + flags = 0 + data = length 178, hash A0B30D59 + sample 10: + time = 400000 + flags = 1 + data = length 11056, hash 52E2FD8B + sample 11: + time = 533322 + flags = 0 + data = length 303, hash 10D3A3FA + sample 12: + time = 466655 + flags = 0 + data = length 303, hash 5242D82E + sample 13: + time = 433322 + flags = 0 + data = length 97, hash 2410F3D6 + sample 14: + time = 500000 + flags = 0 + data = length 199, hash F354477 + sample 15: + time = 666655 + flags = 0 + data = length 304, hash 9A3B0F38 + sample 16: + time = 600000 + flags = 0 + data = length 169, hash 6B89B7E8 + sample 17: + time = 566655 + flags = 0 + data = length 99, hash D4764152 + sample 18: + time = 633322 + flags = 0 + data = length 109, hash AED6C216 + sample 19: + time = 700000 + flags = 0 + data = length 111, hash A17F272F + sample 20: + time = 733322 + flags = 1 + data = length 11237, hash 2914241B + sample 21: + time = 866655 + flags = 0 + data = length 359, hash 2A03C082 + sample 22: + time = 800000 + flags = 0 + data = length 337, hash 1BA612F7 + sample 23: + time = 766655 + flags = 0 + data = length 106, hash F4FD66B4 + sample 24: + time = 833322 + flags = 0 + data = length 107, hash 64941FF0 + sample 25: + time = 1000000 + flags = 0 + data = length 236, hash 8ECD7B9F + sample 26: + time = 933322 + flags = 0 + data = length 110, hash 77532841 + sample 27: + time = 900000 + flags = 0 + data = length 85, hash E29A31D2 + sample 28: + time = 966655 + flags = 536870912 + data = length 94, hash F3C32DE +tracksEnded = true diff --git a/libraries/test_data/src/test/assets/transformerdumps/ts/sample_no_bframes.ts/transmuxed_with_inappmuxer.dump b/libraries/test_data/src/test/assets/transformerdumps/ts/sample_no_bframes.ts/transmuxed_with_inappmuxer.dump deleted file mode 100644 index cb0f759fed..0000000000 --- a/libraries/test_data/src/test/assets/transformerdumps/ts/sample_no_bframes.ts/transmuxed_with_inappmuxer.dump +++ /dev/null @@ -1,340 +0,0 @@ -seekMap: - isSeekable = true - duration = 1065600 - getPosition(0) = [[timeUs=0, position=44]] - getPosition(1) = [[timeUs=0, position=44]] - getPosition(532800) = [[timeUs=0, position=44]] - getPosition(1065600) = [[timeUs=0, position=44]] -numberOfTracks = 2 -track 0: - total output bytes = 287190 - sample count = 29 - format 0: - id = 1 - sampleMimeType = video/avc - codecs = avc1.640034 - maxInputSize = 22910 - width = 1080 - height = 720 - frameRate = 31.042604 - colorInfo: - colorSpace = 1 - colorRange = 2 - colorTransfer = 3 - lumaBitdepth = 8 - chromaBitdepth = 8 - metadata = entries=[Mp4Timestamp: creation time=3000000000, modification time=4000000000, timescale=10000] - initializationData: - data = length 24, hash 489E4AD2 - data = length 9, hash FBAFBC0C - sample 0: - time = 0 - flags = 1 - data = length 7773, hash 97BEE8E7 - sample 1: - time = 33355 - flags = 0 - data = length 1175, hash 875A0AD8 - sample 2: - time = 66722 - flags = 0 - data = length 961, hash 39E26608 - sample 3: - time = 100100 - flags = 0 - data = length 979, hash 9843943C - sample 4: - time = 133455 - flags = 0 - data = length 1367, hash C795AD6F - sample 5: - time = 166822 - flags = 0 - data = length 2295, hash 90C61830 - sample 6: - time = 200200 - flags = 0 - data = length 3856, hash E5178FCE - sample 7: - time = 233555 - flags = 0 - data = length 4055, hash DC2E0B64 - sample 8: - time = 266922 - flags = 0 - data = length 6143, hash 6C8C0E1B - sample 9: - time = 300300 - flags = 0 - data = length 7639, hash 40ABA1B0 - sample 10: - time = 333655 - flags = 0 - data = length 9795, hash 824B4D8D - sample 11: - time = 367022 - flags = 0 - data = length 14496, hash D3EEBA42 - sample 12: - time = 400400 - flags = 0 - data = length 17658, hash 12A7A1A6 - sample 13: - time = 433755 - flags = 0 - data = length 5709, hash ACD2349 - sample 14: - time = 467122 - flags = 0 - data = length 9772, hash B00DF832 - sample 15: - time = 500500 - flags = 0 - data = length 17710, hash 366FC3DC - sample 16: - time = 533855 - flags = 0 - data = length 11442, hash 9B226194 - sample 17: - time = 567222 - flags = 0 - data = length 8546, hash D86DF08E - sample 18: - time = 600600 - flags = 0 - data = length 19900, hash C6748B4C - sample 19: - time = 633955 - flags = 0 - data = length 14348, hash D91E9EAB - sample 20: - time = 667322 - flags = 0 - data = length 9561, hash 819E9692 - sample 21: - time = 700700 - flags = 0 - data = length 12195, hash 895ADC1E - sample 22: - time = 734055 - flags = 0 - data = length 22880, hash A618D42 - sample 23: - time = 767422 - flags = 0 - data = length 16827, hash 4E6A74F5 - sample 24: - time = 800800 - flags = 0 - data = length 5120, hash 3EF0149C - sample 25: - time = 834155 - flags = 0 - data = length 9890, hash 32BAC346 - sample 26: - time = 867522 - flags = 0 - data = length 17017, hash 2D24A3B8 - sample 27: - time = 900900 - flags = 0 - data = length 20866, hash 219DA8C0 - sample 28: - time = 934255 - flags = 536870912 - data = length 7215, hash A853B1A9 -track 1: - total output bytes = 9529 - sample count = 45 - format 0: - id = 2 - sampleMimeType = audio/mp4a-latm - codecs = mp4a.40.2 - maxInputSize = 294 - channelCount = 1 - sampleRate = 44100 - language = und - metadata = entries=[Mp4Timestamp: creation time=3000000000, modification time=4000000000, timescale=10000] - initializationData: - data = length 2, hash 5F7 - sample 0: - time = 0 - flags = 1 - data = length 23, hash 47DE9131 - sample 1: - time = 67187 - flags = 1 - data = length 6, hash 31EC5206 - sample 2: - time = 90416 - flags = 1 - data = length 148, hash 894A176B - sample 3: - time = 113625 - flags = 1 - data = length 189, hash CEF235A1 - sample 4: - time = 136854 - flags = 1 - data = length 205, hash BBF5F7B0 - sample 5: - time = 160062 - flags = 1 - data = length 210, hash F278B193 - sample 6: - time = 183291 - flags = 1 - data = length 210, hash 82DA1589 - sample 7: - time = 206520 - flags = 1 - data = length 207, hash 5BE231DF - sample 8: - time = 229729 - flags = 1 - data = length 225, hash 18819EE1 - sample 9: - time = 252958 - flags = 1 - data = length 215, hash CA7FA67B - sample 10: - time = 276166 - flags = 1 - data = length 211, hash 581A1C18 - sample 11: - time = 299395 - flags = 1 - data = length 216, hash ADB88187 - sample 12: - time = 322604 - flags = 1 - data = length 229, hash 2E8BA4DC - sample 13: - time = 345833 - flags = 1 - data = length 232, hash 22F0C510 - sample 14: - time = 369041 - flags = 1 - data = length 235, hash 867AD0DC - sample 15: - time = 392270 - flags = 1 - data = length 231, hash 84E823A8 - sample 16: - time = 415500 - flags = 1 - data = length 226, hash 1BEF3A95 - sample 17: - time = 438708 - flags = 1 - data = length 216, hash EAA345AE - sample 18: - time = 461937 - flags = 1 - data = length 229, hash 6957411F - sample 19: - time = 485145 - flags = 1 - data = length 219, hash 41275022 - sample 20: - time = 508375 - flags = 1 - data = length 241, hash 6495DF96 - sample 21: - time = 531583 - flags = 1 - data = length 228, hash 63D95906 - sample 22: - time = 554812 - flags = 1 - data = length 238, hash 34F676F9 - sample 23: - time = 578020 - flags = 1 - data = length 234, hash E5CBC045 - sample 24: - time = 601250 - flags = 1 - data = length 231, hash 5FC43661 - sample 25: - time = 624458 - flags = 1 - data = length 217, hash 682708ED - sample 26: - time = 647687 - flags = 1 - data = length 239, hash D43780FC - sample 27: - time = 670916 - flags = 1 - data = length 243, hash C5E17980 - sample 28: - time = 694145 - flags = 1 - data = length 231, hash AC5837BA - sample 29: - time = 717354 - flags = 1 - data = length 230, hash 169EE895 - sample 30: - time = 740583 - flags = 1 - data = length 238, hash C48FF3F1 - sample 31: - time = 763791 - flags = 1 - data = length 225, hash 531E4599 - sample 32: - time = 787020 - flags = 1 - data = length 232, hash CB3C6B8D - sample 33: - time = 810229 - flags = 1 - data = length 243, hash F8C94C7 - sample 34: - time = 833458 - flags = 1 - data = length 232, hash A646A7D0 - sample 35: - time = 856666 - flags = 1 - data = length 237, hash E8B787A5 - sample 36: - time = 879895 - flags = 1 - data = length 228, hash 3FA7A29F - sample 37: - time = 903104 - flags = 1 - data = length 235, hash B9B33B0A - sample 38: - time = 926333 - flags = 1 - data = length 264, hash 71A4869E - sample 39: - time = 949562 - flags = 1 - data = length 257, hash D049B54C - sample 40: - time = 972770 - flags = 1 - data = length 227, hash 66757231 - sample 41: - time = 996000 - flags = 1 - data = length 227, hash BD374F1B - sample 42: - time = 1019208 - flags = 1 - data = length 235, hash 999477F6 - sample 43: - time = 1042437 - flags = 1 - data = length 229, hash FFF98DF0 - sample 44: - time = 1065645 - flags = 536870913 - data = length 6, hash 31B22286 -tracksEnded = true diff --git a/libraries/transformer/src/test/java/androidx/media3/transformer/TransformerWithInAppMuxerEndToEndTest.java b/libraries/transformer/src/test/java/androidx/media3/transformer/TransformerWithInAppMuxerEndToEndTest.java index 0f86a6323b..a7241d8622 100644 --- a/libraries/transformer/src/test/java/androidx/media3/transformer/TransformerWithInAppMuxerEndToEndTest.java +++ b/libraries/transformer/src/test/java/androidx/media3/transformer/TransformerWithInAppMuxerEndToEndTest.java @@ -99,8 +99,8 @@ public class TransformerWithInAppMuxerEndToEndTest { @Test public void transmux_tsFileHavingThreeByteNalStartCode_outputMatchesExpected() throws Exception { - String tsFilePath = "asset:///media/ts/sample_no_bframes.ts"; - String tsFileName = "ts/sample_no_bframes.ts"; + String tsFilePath = "asset:///media/ts/sample_h264.ts"; + String tsFileName = "ts/sample_h264.ts"; Muxer.Factory inAppMuxerFactory = new InAppMuxer.Factory.Builder() .setMetadataProvider(