Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when textTrackTranscodingEnabled is set to true #836

Closed
1 task
TheBeastLT opened this issue Nov 24, 2023 · 1 comment
Closed
1 task

Error when textTrackTranscodingEnabled is set to true #836

TheBeastLT opened this issue Nov 24, 2023 · 1 comment
Assignees
Labels

Comments

@TheBeastLT
Copy link

TheBeastLT commented Nov 24, 2023

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

  • You will email the zip file produced by adb bugreport to [email protected] after filing this issue.
copybara-service bot pushed a commit that referenced this issue Nov 27, 2023
Serializing bitmap cues is currently broken, but this test is
incorrectly passing. This change makes two changes to introduce the same
failure (both changes are necessary, each one alone still passes):

1. Move from Robolectric to an instrumentation test.
2. Trigger the `Bitmap` to be serialized using a file descriptor, either
   by calling `Bitmap.asShared` in the test when constructing the `Cue`,
   or constructing the `Bitmap` from a 'real' image byte array instead a
   1x1 token image.

Issue: #836
PiperOrigin-RevId: 585643486
copybara-service bot pushed a commit to google/ExoPlayer that referenced this issue Nov 27, 2023
Serializing bitmap cues is currently broken, but this test is
incorrectly passing. This change makes two changes to introduce the same
failure (both changes are necessary, each one alone still passes):

1. Move from Robolectric to an instrumentation test.
2. Trigger the `Bitmap` to be serialized using a file descriptor, either
   by calling `Bitmap.asShared` in the test when constructing the `Cue`,
   or constructing the `Bitmap` from a 'real' image byte array instead a
   1x1 token image.

Issue: androidx/media#836
PiperOrigin-RevId: 585643486
@icbaker
Copy link
Collaborator

icbaker commented Nov 27, 2023

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.

copybara-service bot pushed a commit that referenced this issue Dec 6, 2023
The serializable form is used when we need to serialize the result into
bytes in the sample queue. The binder-based (ultimately
filedescriptor-based) form is used for
session/controller IPC, in order to avoid sending the bitmap bytes over
the IPC.

Issue: #836

#minor-release

PiperOrigin-RevId: 588420836
copybara-service bot pushed a commit to google/ExoPlayer that referenced this issue Dec 6, 2023
The serializable form is used when we need to serialize the result into
bytes in the sample queue. The binder-based (ultimately
filedescriptor-based) form is used for
session/controller IPC, in order to avoid sending the bitmap bytes over
the IPC.

Issue: androidx/media#836

#minor-release

PiperOrigin-RevId: 588420836
@icbaker icbaker closed this as completed Dec 18, 2023
@androidx androidx locked and limited conversation to collaborators Feb 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants