Skip to content

Error when textTrackTranscodingEnabled is set to true #836

Closed

Description

@TheBeastLT

Version

Media3 1.2.0

More version details

No response

Devices that reproduce the issue

Any device

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Yes

Reproduction steps

When playing a mkv video with embedded subtitles and with the setTextTrackTranscodingEnabled feature enabled an exception occurrs when trying to play the video.

Without the feature enabled the file plays fine.

Expected result

Video should play fine with setTextTrackTranscodingEnabled feature enabled

Actual result

Playback error
  androidx.media3.exoplayer.ExoPlaybackException: Source error
      at androidx.media3.exoplayer.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:701)
      at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:677)
      at android.os.Handler.dispatchMessage(Handler.java:102)
      at android.os.Looper.loopOnce(Looper.java:201)
      at android.os.Looper.loop(Looper.java:288)
      at android.os.HandlerThread.run(HandlerThread.java:67)
  Caused by: androidx.media3.exoplayer.upstream.Loader$UnexpectedLoaderException: Unexpected RuntimeException: Tried to marshall a Parcel that contained Binder objects.
      at androidx.media3.exoplayer.upstream.Loader$LoadTask.run(Loader.java:438)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
      at java.lang.Thread.run(Thread.java:1012)
  Caused by: java.lang.RuntimeException: Tried to marshall a Parcel that contained Binder objects.
      at android.os.Parcel.nativeMarshall(Native Method)
      at android.os.Parcel.marshall(Parcel.java:747)
      at androidx.media3.extractor.text.CueEncoder.encode(CueEncoder.java:45)
      at androidx.media3.extractor.text.SubtitleTranscodingTrackOutput.outputSample(SubtitleTranscodingTrackOutput.java:161)
      at androidx.media3.extractor.text.SubtitleTranscodingTrackOutput.lambda$sampleMetadata$0$androidx-media3-extractor-text-SubtitleTranscodingTrackOutput(SubtitleTranscodingTrackOutput.java:152)
      at androidx.media3.extractor.text.SubtitleTranscodingTrackOutput$$ExternalSyntheticLambda0.accept(Unknown Source:8)
      at androidx.media3.extractor.text.pgs.PgsParser.parse(PgsParser.java:88)
      at androidx.media3.extractor.text.SubtitleTranscodingTrackOutput.sampleMetadata(SubtitleTranscodingTrackOutput.java:147)
      at androidx.media3.extractor.mkv.MatroskaExtractor.commitSampleToOutput(MatroskaExtractor.java:1454)
      at androidx.media3.extractor.mkv.MatroskaExtractor.endMasterElement(MatroskaExtractor.java:799)
      at androidx.media3.extractor.mkv.MatroskaExtractor$InnerEbmlProcessor.endMasterElement(MatroskaExtractor.java:1970)
      at androidx.media3.extractor.mkv.DefaultEbmlReader.read(DefaultEbmlReader.java:88)
      at androidx.media3.extractor.mkv.MatroskaExtractor.read(MatroskaExtractor.java:530)
      at androidx.media3.extractor.text.SubtitleTranscodingExtractor.read(SubtitleTranscodingExtractor.java:76)
      at androidx.media3.exoplayer.source.BundledExtractorsAdapter.read(BundledExtractorsAdapter.java:133)
      at androidx.media3.exoplayer.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:1063)
      at androidx.media3.exoplayer.upstream.Loader$LoadTask.run(Loader.java:417)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137) 
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) 
      at java.lang.Thread.run(Thread.java:1012) 

Media

Bug Report

Activity

  1. icbaker commented on Nov 27, 2023

    @icbaker
    Collaborator

    Thanks for testing out this new feature - and reporting that it's broken :)

    From this part of the stack trace, I suspect something is going wrong when serializing a bitmap subtitle (PGS is a bitmap-only format):

    at androidx.media3.extractor.text.pgs.PgsParser.parse(PgsParser.java:88)
    

    I thought we had a test for serializing a Bitmap to bytes (via Bundle), but a bit of experimentation showed this was 'incorrectly' passing for two reasons:

    1. It was running on robolectric, and it seems the serialization-to-bytes logic is different in real Android.
    2. The image used in the test was not using 'shared' memory, hence would be Parcel'ed without using a Binder. Switching to instantiating an image from a byte array allowed me to trigger the same failure you're seeing.

    I've updated the test to be more realistic in 63062a9, and disabled it for now (because it's failing). I'll work on fixing the logic and re-enabling the test in a follow-up change.

  2. locked and limited conversation to collaborators on Feb 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions