androidx / androidx/media

Allow customizing LoadControl with CompositionPlayer

Open
#2,417 5 comments 0 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

editing enhancement preview
Dominant language
Java
Stars
3k
Forks
955
Avg merge
12d 14h
Merged PRs (30d)
2

Description

Version

Media3 1.6.1

More version details

I’m having a problem where some images refuse to play when included in a Composition that is played through CompositionPlayer. From what I can tell, the images have to be quite large (~50MP) and have some kind of EXIF meta data to trigger. (Possibly related to HDR or ICC Profile.)

When using androidx.media3 1.6.1, I get the following log printed every 10 ms, and otherwise no indication of an error:

Target buffer size reached with less than 500ms of buffered media data.

Rolling back to 1.5.1, I additionally get an error log and the player pauses itself:

playerFailed [eventTime=4.64, mediaPos=0.00, window=0, period=0, errorCode=ERROR_CODE_FAILED_RUNTIME_CHECK
	androidx.media3.exoplayer.ExoPlaybackException: Unexpected runtime error
		at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:721)
		at android.os.Handler.dispatchMessage(Handler.java:105)
		at android.os.Looper.loopOnce(Looper.java:232)
		at android.os.Looper.loop(Looper.java:317)
		at android.os.HandlerThread.run(HandlerThread.java:85)
	Caused by: java.lang.IllegalStateException: Playback stuck buffering and not loading
		at androidx.media3.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1224)
		at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:562)
		at android.os.Handler.dispatchMessage(Handler.java:105)
		at android.os.Looper.loopOnce(Looper.java:232)
		at android.os.Looper.loop(Looper.java:317)
		at android.os.HandlerThread.run(HandlerThread.java:85)
	]

Some other things I’ve noticed:

  • If I strip all EXIF data, the same image works just fine
  • The images I’ve seen the problem with are all captured on a Pixel 8/9 device, and are not modified otherwise
  • Rendering the exact same Composition object to file with a Transformer works without issues
  • Can be reproduced in the demo app by including the problematic image

There’s a minimal repro code here: https://github.com/niklasfejes/compplayer-bug-repo

Of interest may be the CompositionPlayer logic located in ReproVideoPlayer.kt, and an example image that causes the playback to fail in the assets dir.

Devices that reproduce the issue
  • Google Pixel 8 Pro running Android 15
  • Qualcomm 8750 device running Android 15
  • Qualcomm 8550 device running Android 13
Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Yes

Reproduction steps
  1. Include the image in the Edit in the composition demo
  2. Preview the Edit
Expected result

The edit plays successfully

Actual result

The playback stops when reaching the image

Media

https://github.com/niklasfejes/compplayer-bug-repo/blob/main/app/src/main/assets/testimage_nogps.jpg

Bug Report
  • You will email the zip file produced by adb bugreport to android-media-github@google.com after filing this issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.