Add Mp4Extractor test for interleaved editable video tracks file

PiperOrigin-RevId: 665800463
This commit is contained in:
sheenachhabra 2024-08-21 03:32:03 -07:00 committed by Copybara-Service
parent 1bb48b1c47
commit 875953f971
14 changed files with 595 additions and 0 deletions

View File

@ -139,6 +139,24 @@ public final class Mp4ExtractorNonParameterizedTest {
DumpFileAsserts.assertOutput(context, editableTracksOutput, dumpFilePath);
}
@Test
public void
extract_fileHavingEditableVideoTracksInterleavedWithPrimaryVideoTracksWithReadEditableVideoTracksFlag_extractsEditableVideoTracks()
throws Exception {
Context context = ApplicationProvider.getApplicationContext();
String inputFilePath =
"media/mp4/sample_with_fake_editable_video_tracks_interleaved_with_primary_video_tracks.mp4";
Mp4Extractor mp4Extractor =
new Mp4Extractor(
new DefaultSubtitleParserFactory(), Mp4Extractor.FLAG_READ_EDITABLE_VIDEO_TRACKS);
FakeExtractorOutput editableTracksOutput =
TestUtil.extractAllSamplesFromFile(mp4Extractor, context, inputFilePath);
String dumpFilePath = getDumpFilePath(inputFilePath, "_with_flag_read_Editable_video_tracks");
DumpFileAsserts.assertOutput(context, editableTracksOutput, dumpFilePath);
}
private static String getDumpFilePath(String inputFilePath, String suffix) {
return inputFilePath.replaceFirst("media", "extractordumps") + suffix;
}

View File

@ -223,6 +223,12 @@ public final class Mp4ExtractorParameterizedTest {
assertExtractorBehavior("media/mp4/sample_with_fake_editable_video_tracks.mp4");
}
@Test
public void mp4WithEditableVideoTracksInterleavedWithPrimaryVideoTracks() throws Exception {
assertExtractorBehavior(
"media/mp4/sample_with_fake_editable_video_tracks_interleaved_with_primary_video_tracks.mp4");
}
private void assertExtractorBehavior(String file) throws IOException {
ExtractorAsserts.AssertionConfig.Builder assertionConfigBuilder =
new ExtractorAsserts.AssertionConfig.Builder();

View File

@ -0,0 +1,48 @@
seekMap:
isSeekable = true
duration = 0
getPosition(0) = [[timeUs=0, position=400052]]
getPosition(1) = [[timeUs=0, position=400276]]
getPosition(0) = [[timeUs=0, position=400052]]
getPosition(0) = [[timeUs=0, position=400052]]
numberOfTracks = 1
track 0:
total output bytes = 280
sample count = 5
format 0:
id = 1
sampleMimeType = video/avc
codecs = avc1.F4000A
maxInputSize = 86
maxNumReorderSamples = 2
width = 12
height = 10
colorInfo:
colorRange = 1
lumaBitdepth = 8
chromaBitdepth = 8
metadata = entries=[mdta: key=editable.tracks.length, value=1493, mdta: key=editable.tracks.offset, value=400892, Mp4Timestamp: creation time=1000000, modification time=5000000, 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 = 0
flags = 1
data = length 56, hash C4551A2E
sample 2:
time = 0
flags = 1
data = length 56, hash C4551A2E
sample 3:
time = 0
flags = 1
data = length 56, hash C4551A2E
sample 4:
time = 0
flags = 536870913
data = length 56, hash C4551A2E
tracksEnded = true

View File

@ -0,0 +1,48 @@
seekMap:
isSeekable = true
duration = 0
getPosition(0) = [[timeUs=0, position=400052]]
getPosition(1) = [[timeUs=0, position=400276]]
getPosition(0) = [[timeUs=0, position=400052]]
getPosition(0) = [[timeUs=0, position=400052]]
numberOfTracks = 1
track 0:
total output bytes = 280
sample count = 5
format 0:
id = 1
sampleMimeType = video/avc
codecs = avc1.F4000A
maxInputSize = 86
maxNumReorderSamples = 2
width = 12
height = 10
colorInfo:
colorRange = 1
lumaBitdepth = 8
chromaBitdepth = 8
metadata = entries=[mdta: key=editable.tracks.length, value=1493, mdta: key=editable.tracks.offset, value=400892, Mp4Timestamp: creation time=1000000, modification time=5000000, 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 = 0
flags = 1
data = length 56, hash C4551A2E
sample 2:
time = 0
flags = 1
data = length 56, hash C4551A2E
sample 3:
time = 0
flags = 1
data = length 56, hash C4551A2E
sample 4:
time = 0
flags = 536870913
data = length 56, hash C4551A2E
tracksEnded = true

View File

@ -0,0 +1,48 @@
seekMap:
isSeekable = true
duration = 0
getPosition(0) = [[timeUs=0, position=400052]]
getPosition(1) = [[timeUs=0, position=400276]]
getPosition(0) = [[timeUs=0, position=400052]]
getPosition(0) = [[timeUs=0, position=400052]]
numberOfTracks = 1
track 0:
total output bytes = 280
sample count = 5
format 0:
id = 1
sampleMimeType = video/avc
codecs = avc1.F4000A
maxInputSize = 86
maxNumReorderSamples = 2
width = 12
height = 10
colorInfo:
colorRange = 1
lumaBitdepth = 8
chromaBitdepth = 8
metadata = entries=[mdta: key=editable.tracks.length, value=1493, mdta: key=editable.tracks.offset, value=400892, Mp4Timestamp: creation time=1000000, modification time=5000000, 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 = 0
flags = 1
data = length 56, hash C4551A2E
sample 2:
time = 0
flags = 1
data = length 56, hash C4551A2E
sample 3:
time = 0
flags = 1
data = length 56, hash C4551A2E
sample 4:
time = 0
flags = 536870913
data = length 56, hash C4551A2E
tracksEnded = true

View File

@ -0,0 +1,48 @@
seekMap:
isSeekable = true
duration = 0
getPosition(0) = [[timeUs=0, position=400052]]
getPosition(1) = [[timeUs=0, position=400276]]
getPosition(0) = [[timeUs=0, position=400052]]
getPosition(0) = [[timeUs=0, position=400052]]
numberOfTracks = 1
track 0:
total output bytes = 280
sample count = 5
format 0:
id = 1
sampleMimeType = video/avc
codecs = avc1.F4000A
maxInputSize = 86
maxNumReorderSamples = 2
width = 12
height = 10
colorInfo:
colorRange = 1
lumaBitdepth = 8
chromaBitdepth = 8
metadata = entries=[mdta: key=editable.tracks.length, value=1493, mdta: key=editable.tracks.offset, value=400892, Mp4Timestamp: creation time=1000000, modification time=5000000, 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 = 0
flags = 1
data = length 56, hash C4551A2E
sample 2:
time = 0
flags = 1
data = length 56, hash C4551A2E
sample 3:
time = 0
flags = 1
data = length 56, hash C4551A2E
sample 4:
time = 0
flags = 536870913
data = length 56, hash C4551A2E
tracksEnded = true

View File

@ -0,0 +1,48 @@
seekMap:
isSeekable = true
duration = 0
getPosition(0) = [[timeUs=0, position=400052]]
getPosition(1) = [[timeUs=0, position=400276]]
getPosition(0) = [[timeUs=0, position=400052]]
getPosition(0) = [[timeUs=0, position=400052]]
numberOfTracks = 1
track 0:
total output bytes = 280
sample count = 5
format 0:
id = 1
sampleMimeType = video/avc
codecs = avc1.F4000A
maxInputSize = 86
maxNumReorderSamples = 2
width = 12
height = 10
colorInfo:
colorRange = 1
lumaBitdepth = 8
chromaBitdepth = 8
metadata = entries=[mdta: key=editable.tracks.length, value=1493, mdta: key=editable.tracks.offset, value=400892, Mp4Timestamp: creation time=1000000, modification time=5000000, 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 = 0
flags = 1
data = length 56, hash C4551A2E
sample 2:
time = 0
flags = 1
data = length 56, hash C4551A2E
sample 3:
time = 0
flags = 1
data = length 56, hash C4551A2E
sample 4:
time = 0
flags = 536870913
data = length 56, hash C4551A2E
tracksEnded = true

View File

@ -0,0 +1,48 @@
seekMap:
isSeekable = true
duration = 0
getPosition(0) = [[timeUs=0, position=400052]]
getPosition(1) = [[timeUs=0, position=400276]]
getPosition(0) = [[timeUs=0, position=400052]]
getPosition(0) = [[timeUs=0, position=400052]]
numberOfTracks = 1
track 0:
total output bytes = 280
sample count = 5
format 0:
id = 1
sampleMimeType = video/avc
codecs = avc1.F4000A
maxInputSize = 86
maxNumReorderSamples = 2
width = 12
height = 10
colorInfo:
colorRange = 1
lumaBitdepth = 8
chromaBitdepth = 8
metadata = entries=[mdta: key=editable.tracks.length, value=1493, mdta: key=editable.tracks.offset, value=400892, Mp4Timestamp: creation time=1000000, modification time=5000000, 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 = 0
flags = 1
data = length 56, hash C4551A2E
sample 2:
time = 0
flags = 1
data = length 56, hash C4551A2E
sample 3:
time = 0
flags = 1
data = length 56, hash C4551A2E
sample 4:
time = 0
flags = 536870913
data = length 56, hash C4551A2E
tracksEnded = true

View File

@ -0,0 +1,48 @@
seekMap:
isSeekable = true
duration = 0
getPosition(0) = [[timeUs=0, position=400052]]
getPosition(1) = [[timeUs=0, position=400276]]
getPosition(0) = [[timeUs=0, position=400052]]
getPosition(0) = [[timeUs=0, position=400052]]
numberOfTracks = 1
track 0:
total output bytes = 280
sample count = 5
format 0:
id = 1
sampleMimeType = video/avc
codecs = avc1.F4000A
maxInputSize = 86
maxNumReorderSamples = 2
width = 12
height = 10
colorInfo:
colorRange = 1
lumaBitdepth = 8
chromaBitdepth = 8
metadata = entries=[mdta: key=editable.tracks.length, value=1493, mdta: key=editable.tracks.offset, value=400892, Mp4Timestamp: creation time=1000000, modification time=5000000, 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 = 0
flags = 1
data = length 56, hash C4551A2E
sample 2:
time = 0
flags = 1
data = length 56, hash C4551A2E
sample 3:
time = 0
flags = 1
data = length 56, hash C4551A2E
sample 4:
time = 0
flags = 536870913
data = length 56, hash C4551A2E
tracksEnded = true

View File

@ -0,0 +1,48 @@
seekMap:
isSeekable = true
duration = 0
getPosition(0) = [[timeUs=0, position=400052]]
getPosition(1) = [[timeUs=0, position=400276]]
getPosition(0) = [[timeUs=0, position=400052]]
getPosition(0) = [[timeUs=0, position=400052]]
numberOfTracks = 1
track 0:
total output bytes = 280
sample count = 5
format 0:
id = 1
sampleMimeType = video/avc
codecs = avc1.F4000A
maxInputSize = 86
maxNumReorderSamples = 2
width = 12
height = 10
colorInfo:
colorRange = 1
lumaBitdepth = 8
chromaBitdepth = 8
metadata = entries=[mdta: key=editable.tracks.length, value=1493, mdta: key=editable.tracks.offset, value=400892, Mp4Timestamp: creation time=1000000, modification time=5000000, 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 = 0
flags = 1
data = length 56, hash C4551A2E
sample 2:
time = 0
flags = 1
data = length 56, hash C4551A2E
sample 3:
time = 0
flags = 1
data = length 56, hash C4551A2E
sample 4:
time = 0
flags = 536870913
data = length 56, hash C4551A2E
tracksEnded = true

View File

@ -0,0 +1,48 @@
seekMap:
isSeekable = true
duration = 0
getPosition(0) = [[timeUs=0, position=400052]]
getPosition(1) = [[timeUs=0, position=400276]]
getPosition(0) = [[timeUs=0, position=400052]]
getPosition(0) = [[timeUs=0, position=400052]]
numberOfTracks = 1
track 0:
total output bytes = 280
sample count = 5
format 0:
id = 1
sampleMimeType = video/avc
codecs = avc1.F4000A
maxInputSize = 86
maxNumReorderSamples = 2
width = 12
height = 10
colorInfo:
colorRange = 1
lumaBitdepth = 8
chromaBitdepth = 8
metadata = entries=[mdta: key=editable.tracks.length, value=1493, mdta: key=editable.tracks.offset, value=400892, Mp4Timestamp: creation time=1000000, modification time=5000000, 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 = 0
flags = 1
data = length 56, hash C4551A2E
sample 2:
time = 0
flags = 1
data = length 56, hash C4551A2E
sample 3:
time = 0
flags = 1
data = length 56, hash C4551A2E
sample 4:
time = 0
flags = 536870913
data = length 56, hash C4551A2E
tracksEnded = true

View File

@ -0,0 +1,48 @@
seekMap:
isSeekable = true
duration = 0
getPosition(0) = [[timeUs=0, position=400052]]
getPosition(1) = [[timeUs=0, position=400276]]
getPosition(0) = [[timeUs=0, position=400052]]
getPosition(0) = [[timeUs=0, position=400052]]
numberOfTracks = 1
track 0:
total output bytes = 280
sample count = 5
format 0:
id = 1
sampleMimeType = video/avc
codecs = avc1.F4000A
maxInputSize = 86
maxNumReorderSamples = 2
width = 12
height = 10
colorInfo:
colorRange = 1
lumaBitdepth = 8
chromaBitdepth = 8
metadata = entries=[mdta: key=editable.tracks.length, value=1493, mdta: key=editable.tracks.offset, value=400892, Mp4Timestamp: creation time=1000000, modification time=5000000, 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 = 0
flags = 1
data = length 56, hash C4551A2E
sample 2:
time = 0
flags = 1
data = length 56, hash C4551A2E
sample 3:
time = 0
flags = 1
data = length 56, hash C4551A2E
sample 4:
time = 0
flags = 536870913
data = length 56, hash C4551A2E
tracksEnded = true

View File

@ -0,0 +1,91 @@
seekMap:
isSeekable = true
duration = 0
getPosition(0) = [[timeUs=0, position=400332]]
getPosition(1) = [[timeUs=0, position=400556]]
getPosition(0) = [[timeUs=0, position=400332]]
getPosition(0) = [[timeUs=0, position=400332]]
numberOfTracks = 2
track 0:
total output bytes = 280
sample count = 5
format 0:
id = 1
sampleMimeType = video/avc
codecs = avc1.F4000A
maxInputSize = 86
maxNumReorderSamples = 2
width = 12
height = 10
colorInfo:
colorRange = 1
lumaBitdepth = 8
chromaBitdepth = 8
roleFlags = [auxiliary]
auxiliaryTrackType = original
metadata = entries=[mdta: key=editable.tracks.map, value=track types = 0,1, mdta: key=editable.tracks.samples.location, value=1, Mp4Timestamp: creation time=1000000, modification time=5000000, 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 = 0
flags = 1
data = length 56, hash C4551A2E
sample 2:
time = 0
flags = 1
data = length 56, hash C4551A2E
sample 3:
time = 0
flags = 1
data = length 56, hash C4551A2E
sample 4:
time = 0
flags = 536870913
data = length 56, hash C4551A2E
track 1:
total output bytes = 280
sample count = 5
format 0:
id = 2
sampleMimeType = video/avc
codecs = avc1.F4000A
maxInputSize = 86
maxNumReorderSamples = 2
width = 12
height = 10
colorInfo:
colorRange = 1
lumaBitdepth = 8
chromaBitdepth = 8
roleFlags = [auxiliary]
auxiliaryTrackType = depth-linear
metadata = entries=[mdta: key=editable.tracks.map, value=track types = 0,1, mdta: key=editable.tracks.samples.location, value=1, Mp4Timestamp: creation time=1000000, modification time=5000000, 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 = 0
flags = 1
data = length 56, hash C4551A2E
sample 2:
time = 0
flags = 1
data = length 56, hash C4551A2E
sample 3:
time = 0
flags = 1
data = length 56, hash C4551A2E
sample 4:
time = 0
flags = 536870913
data = length 56, hash C4551A2E
tracksEnded = true