Skip to content

Black frames occur when switching between frame rates on devices with API levels below 30 #3120

@mikef-dk

Description

@mikef-dk

Version

Media3 1.9.2

More version details

First observed in version 1.9.1

Devices that reproduce the issue

Devices running API Level 29 (Android 9) or below

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Not tested

Reproduction steps

  1. Play a video with multiple video tracks that have different frame rates (e.g. 1080p25 & 1080p50)
  2. Wait for the stream to switch to the highest quality stream (switch from 25 fps to 50 fps)

Expected result

Stream switch happens without black frames

Actual result

While stream is switched, a black frame is displayed

Media

It appears the change introduced in #2941 (Diff) is the root cause of this issue. While I don't fully follow the reasoning behind these changes, they have significantly degraded the playback experience. If a stream switches frame rates frequently, the resulting constant flickering is quite disruptive for the user.

As a temporary measure, we have set VideoChangeFrameRateStrategy to VIDEO_CHANGE_FRAME_RATE_STRATEGY_OFF for API levels below 30. This successfully prevents the black frames from occurring.

https://github.com/user-attachments/assets/233e6ae1-721e-4b4e-a2a8-f1446eda2101
logcat_black_frame.txt

Bug Report

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions