Set Format.frameRate for single-frame MP4 tracks

Issue: androidx/media#1051
PiperOrigin-RevId: 613516802
This commit is contained in:
ibaker 2024-03-07 02:49:59 -08:00 committed by Copybara-Service
parent 638b2a3c86
commit afacf2cdb7
14 changed files with 14 additions and 1 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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