Set Format.frameRate for single-frame MP4 tracks

Issue: androidx/media#1051
PiperOrigin-RevId: 613516802
(cherry picked from commit afacf2cdb7d5561ef61b97059cd8bb22d8558c58)
This commit is contained in:
ibaker 2024-03-07 02:49:59 -08:00 committed by SheenaChhabra
parent 71bfdd1bce
commit 41771d7fa3
9 changed files with 9 additions and 1 deletions

View File

@ -618,7 +618,7 @@ public final class Mp4Extractor implements Extractor, SeekMap {
? C.ROLE_FLAG_MAIN
: C.ROLE_FLAG_ALTERNATE));
}
if (trackDurationUs > 0 && trackSampleTable.sampleCount > 1) {
if (trackDurationUs > 0 && trackSampleTable.sampleCount > 0) {
float frameRate = trackSampleTable.sampleCount / (trackDurationUs / 1000000f);
formatBuilder.setFrameRate(frameRate);
}

View File

@ -270,6 +270,7 @@ track 1:
maxInputSize = 151345
width = 2048
height = 1536
frameRate = 2.142245
rotationDegrees = 90
colorInfo:
colorSpace = 1

View File

@ -214,6 +214,7 @@ track 1:
maxInputSize = 151345
width = 2048
height = 1536
frameRate = 2.142245
rotationDegrees = 90
colorInfo:
colorSpace = 1

View File

@ -130,6 +130,7 @@ track 1:
maxInputSize = 151345
width = 2048
height = 1536
frameRate = 2.142245
rotationDegrees = 90
colorInfo:
colorSpace = 1

View File

@ -46,6 +46,7 @@ track 1:
maxInputSize = 151345
width = 2048
height = 1536
frameRate = 2.142245
rotationDegrees = 90
colorInfo:
colorSpace = 1

View File

@ -16,6 +16,7 @@ track 0:
maxInputSize = 3895
width = 180
height = 120
frameRate = 1.1534026
pixelWidthHeightRatio = 0.5
colorInfo:
lumaBitdepth = 8

View File

@ -16,6 +16,7 @@ track 0:
maxInputSize = 3895
width = 180
height = 120
frameRate = 1.1534026
pixelWidthHeightRatio = 0.5
colorInfo:
lumaBitdepth = 8

View File

@ -16,6 +16,7 @@ track 0:
maxInputSize = 3895
width = 180
height = 120
frameRate = 1.1534026
pixelWidthHeightRatio = 0.5
colorInfo:
lumaBitdepth = 8

View File

@ -16,6 +16,7 @@ track 0:
maxInputSize = 3895
width = 180
height = 120
frameRate = 1.1534026
pixelWidthHeightRatio = 0.5
colorInfo:
lumaBitdepth = 8