androidx / media

Jetpack Media3 support libraries for media use cases, including ExoPlayer, an extensible media player for Android
Apache License 2.0
1.4k stars 330 forks source link

PGS subtitles not shown when using MediaSessionService #268

Open aykxt opened 1 year ago

aykxt commented 1 year ago

Media3 Version

1.0.0-rc02

Devices that reproduce the issue

Pixel 6 Pro

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

No

Reproduction steps

  1. Set up MediaSessionService and get a controller in an activity with PlayerView
  2. Set playerView.player = controller
  3. Play any video with PGS subtitles

Expected result

PGS subtitles should correctly render as it is supported and correctly render when using ExoPlayer directly.

Actual result

PGS subtitles are not shown.

When ExoPlayer is created in the same activity (without a MediaSessionService and MediaController) and passed to PlayerView, PGS subtitles correctly render.

Media

Sample video with PGS subtitles (from Kodi): https://drive.google.com/file/d/0BwxFVkl63-lEVEluSFZ4NlhpLUk/view?usp=sharing&resourcekey=0-jrRNAhII3KVOq5Qid60tCw

Bug Report

marcbaechinger commented 1 year ago

Thanks for reporting!

PGS is a bitmap based subtitle format. This is currently not supported. We filter out bitmaps when bundling the CueGroup before sending the cues to the controller. I'm marking as an enhancement, but I'm not sure when we will work on this. I recommend migrating to a text base format.

The enhancement would involve to convert the bitmap to bytes in the session, transmit over the binder interface and decode back to a Bitmap for rendering in the controller app. These are operations that need to be processed asynchronously. That's not impossible, but we will probably not rush with implementing this any time soon. Text formats are much more efficient if you want to run your player in a service for video playback in a controller app.

However, for now we should document this somewhere. We can probably also check for format that we know is based on bitmaps like PGS and warn when such a subtitle is requested over the session.

aykxt commented 9 months ago

Is there any update on this? Unfortunately, I can't convert to a text based format in my particular use case.