-
Notifications
You must be signed in to change notification settings - Fork 574
Description
Version
1.6.0-alpha03
More version details
ExoPlayer: Jank When Transitioning from Image to Video
Issue Summary
When using ExoPlayer, there is a noticeable jank (~200ms delay) when transitioning from an image to a video. This occurs when using MediaItem.setImageDurationMs()
to display images in a playlist that includes both images and videos.
This issue is critical for real-time video editing applications that require seamless playback.
Steps to Reproduce
- Use ExoPlayer to play a sequence of images and videos in a
ConcatenatingMediaSource2
. - Observe the playback:
- Video to Video: Smooth transition.
- Video to Image: Smooth transition.
- Image to Video: ~200ms jank (measured by logging playback position difference).
Minimal Repro Repository
A minimal reproduction of this issue can be found here: 🔗 Minimal Repro Repository
Findings
- The issue only occurs when transitioning from an image to a video.
- Removing audio from videos eliminates the jank entirely.
- Using MediaCodec video renderer prewarming does not resolve the issue.
- Converting images to short videos (via the Media3 Transformer library) does not fix the issue.
- The issue occurs consistently, even on different devices.
Expected Behavior
- Image-to-video transitions should be smooth, just like video-to-video transitions.
- The presence of an audio track should not affect playback smoothness.
Request
It would be great if ExoPlayer could handle image-to-video transitions smoothly, even when the videos contain audio.
Would appreciate any insights or potential workarounds! 🚀
Devices that reproduce the issue
Pixel 6 Pro
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Yes
Reproduction steps
I attached a minimal reproduction repository with all the possible workarounds I could think of, please check that out
Expected result
- Image-to-video transitions should be smooth, just like video-to-video transitions.
- The presence of an audio track should not affect playback smoothness.
Actual result
image-to-video has a jank
Media
Media is in the assets folder of the linked minimal repro library
Bug Report
- You will email the zip file produced by
adb bugreport
to android-media-github@google.com after filing this issue.