Skip to content

Commit

Permalink
Set Format.frameRate for single-frame MP4 tracks
Browse files Browse the repository at this point in the history
Issue: androidx/media#1051
PiperOrigin-RevId: 613516802
  • Loading branch information
icbaker authored and Copybara-Service committed Mar 7, 2024
1 parent 879e4b3 commit d987dbb
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 1 deletion.
Expand Up @@ -637,7 +637,7 @@ private void processMoovAtom(ContainerAtom moov) throws ParserException {
? 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);
}
Expand Down
Expand Up @@ -270,6 +270,7 @@ track 1:
maxInputSize = 151345
width = 2048
height = 1536
frameRate = 2.142245
rotationDegrees = 90
colorInfo:
colorSpace = 1
Expand Down
Expand Up @@ -214,6 +214,7 @@ track 1:
maxInputSize = 151345
width = 2048
height = 1536
frameRate = 2.142245
rotationDegrees = 90
colorInfo:
colorSpace = 1
Expand Down
Expand Up @@ -130,6 +130,7 @@ track 1:
maxInputSize = 151345
width = 2048
height = 1536
frameRate = 2.142245
rotationDegrees = 90
colorInfo:
colorSpace = 1
Expand Down
Expand Up @@ -46,6 +46,7 @@ track 1:
maxInputSize = 151345
width = 2048
height = 1536
frameRate = 2.142245
rotationDegrees = 90
colorInfo:
colorSpace = 1
Expand Down
Expand Up @@ -16,6 +16,7 @@ track 0:
maxInputSize = 3895
width = 180
height = 120
frameRate = 1.1534026
pixelWidthHeightRatio = 0.5
colorInfo:
lumaBitdepth = 8
Expand Down
Expand Up @@ -16,6 +16,7 @@ track 0:
maxInputSize = 3895
width = 180
height = 120
frameRate = 1.1534026
pixelWidthHeightRatio = 0.5
colorInfo:
lumaBitdepth = 8
Expand Down
Expand Up @@ -16,6 +16,7 @@ track 0:
maxInputSize = 3895
width = 180
height = 120
frameRate = 1.1534026
pixelWidthHeightRatio = 0.5
colorInfo:
lumaBitdepth = 8
Expand Down
Expand Up @@ -16,6 +16,7 @@ track 0:
maxInputSize = 3895
width = 180
height = 120
frameRate = 1.1534026
pixelWidthHeightRatio = 0.5
colorInfo:
lumaBitdepth = 8
Expand Down
Expand Up @@ -269,6 +269,7 @@ track 1:
maxInputSize = 151345
width = 2048
height = 1536
frameRate = 2.142245
rotationDegrees = 90
colorInfo:
colorSpace = 1
Expand Down
Expand Up @@ -213,6 +213,7 @@ track 1:
maxInputSize = 151345
width = 2048
height = 1536
frameRate = 2.142245
rotationDegrees = 90
colorInfo:
colorSpace = 1
Expand Down
Expand Up @@ -129,6 +129,7 @@ track 1:
maxInputSize = 151345
width = 2048
height = 1536
frameRate = 2.142245
rotationDegrees = 90
colorInfo:
colorSpace = 1
Expand Down
Expand Up @@ -45,6 +45,7 @@ track 1:
maxInputSize = 151345
width = 2048
height = 1536
frameRate = 2.142245
rotationDegrees = 90
colorInfo:
colorSpace = 1
Expand Down
Expand Up @@ -269,6 +269,7 @@ track 1:
maxInputSize = 151345
width = 2048
height = 1536
frameRate = 2.142245
rotationDegrees = 90
colorInfo:
colorSpace = 1
Expand Down

0 comments on commit d987dbb

Please sign in to comment.