media: Subtitle parsing broken in 1.4.0-alpha02+
Version
Media3 main branch
More version details
Subtitle parsing for a given DASH asset (DRM protected) works fine in 1.4.0-alpha01 but in 1.4.0-alpha02 and 1.4.0-beta01 the playback fails with the following exception. Without provding the asset, can you help figure this out? Any info from the DASH manifest that I could provide to help? Again, same asset plays fine and displays subtitles in 1.4.0-alpha01
androidx.media3.exoplayer.ExoPlaybackException: Source error
at androidx.media3.exoplayer.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:741)
at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:711)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:223)
at android.os.HandlerThread.run(HandlerThread.java:67)
Caused by: androidx.media3.common.ParserException: SubtitleParser failed.{contentIsMalformed=true, dataType=1}
at androidx.media3.extractor.text.SubtitleExtractor.parseAndWriteToOutput(SubtitleExtractor.java:258)
at androidx.media3.extractor.text.SubtitleExtractor.read(SubtitleExtractor.java:161)
at androidx.media3.exoplayer.source.chunk.BundledChunkExtractor.read(BundledChunkExtractor.java:241)
at androidx.media3.exoplayer.source.chunk.ContainerMediaChunk.load(ContainerMediaChunk.java:132)
at androidx.media3.exoplayer.upstream.Loader$LoadTask.run(Loader.java:421)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
Caused by: java.lang.IllegalArgumentException
at androidx.media3.common.util.Assertions.checkArgument(Assertions.java:40)
at androidx.media3.extractor.text.webvtt.WebvttSubtitle.getEventTime(WebvttSubtitle.java:63)
at androidx.media3.extractor.text.LegacySubtitleUtil.toCuesWithTiming(LegacySubtitleUtil.java:44)
at androidx.media3.extractor.text.webvtt.WebvttParser.parse(WebvttParser.java:108)
at androidx.media3.extractor.text.SubtitleParser.parse(SubtitleParser.java:152)
at androidx.media3.extractor.text.SubtitleExtractor.parseAndWriteToOutput(SubtitleExtractor.java:238)
at androidx.media3.extractor.text.SubtitleExtractor.read(SubtitleExtractor.java:161)
at androidx.media3.exoplayer.source.chunk.BundledChunkExtractor.read(BundledChunkExtractor.java:241)
at androidx.media3.exoplayer.source.chunk.ContainerMediaChunk.load(ContainerMediaChunk.java:132)
at androidx.media3.exoplayer.upstream.Loader$LoadTask.run(Loader.java:421)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
Devices that reproduce the issue
Nvidia Shield TV Pixel 7 Pro
Devices that do not reproduce the issue
None known
Reproducible in the demo app?
Yes
Reproduction steps
player.trackSelectionParameters =
player.trackSelectionParameters.buildUpon()
.setTrackTypeDisabled(TRACK_TYPE_TEXT, !showSubtitles)
.setPreferredTextLanguage("eng")
.build()
Expected result
Playback succeeds even when displaying subtitles
Actual result
Receive ERROR_CODE_PARSING_CONTAINER_MALFORMED 3001 during playback when attempting to display subtitles
Media
Private URL. Please let me know if there is some info I can provide from the DASH manifest
Bug Report
- You will email the zip file produced by
adb bugreportto android-media-github@google.com after filing this issue.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 18
Commits related to this issue
- Fix index out of bounds exception when a `Subtitle` is empty Issue: androidx/media#1516 #cherrypick PiperOrigin-RevId: 648416119 — committed to androidx/media by icbaker 2 years ago
- Fix index out of bounds exception when a `Subtitle` is empty Issue: androidx/media#1516 #cherrypick PiperOrigin-RevId: 648416119 (cherry picked from commit 711d18de0308d4de40516466d3112c8e99c549dc) — committed to androidx/media by icbaker 2 years ago
- Fix `IndexOutOfBoundsException` in `LegacySubtitleUtil` This is caused when the requested "output start time" is equal to or larger than the last event time in a `Subtitle` object. This resolves the... — committed to androidx/media by icbaker 2 years ago
- Pass missing `length` into `SubtitleParser` from `SubtitleExtractor` If the length of the `ExtractorInput` is not known then the `subtitleData` field is re-sized by 1kB each time (`SubtitleExtractor.... — committed to androidx/media by icbaker 2 years ago
- Fix `IndexOutOfBoundsException` in `LegacySubtitleUtil` This is caused when the requested "output start time" is equal to or larger than the last event time in a `Subtitle` object. This resolves the... — committed to androidx/media by icbaker 2 years ago
- Pass missing `length` into `SubtitleParser` from `SubtitleExtractor` If the length of the `ExtractorInput` is not known then the `subtitleData` field is re-sized by 1kB each time (`SubtitleExtractor.... — committed to androidx/media by icbaker 2 years ago
- enable legacy decoding of text captions issue: https://github.com/androidx/media/issues/1516 https://github.com/androidx/media/issues/1644 references: https://github.com/androidx/media/blob/1.... — committed to warren-bank/Android-ExoPlayer-AirPlay-Receiver by warren-bank 2 years ago
- Feat/migrate media3 (#35) * Re-apply CEA-708 `rowLock/columnLock` fix This change was originally made in https://github.com/androidx/media/commit/6f8249184bd69b126c93479f918768b0cf2d0889 It was... — committed to DiceTechnology/androidx-media by guoen21 2 years ago
Thanks for the test stream, it’s been really helpful to look into this issue. I’ve fixed the
IndexOutOfBoundsExceptionwith the commit linked above, which solves the playback error, but subtitles are still not shown on your stream.Looking in your DASH manifest it seems that your subtitles are raw WebVTT (not encapsulated in ISOBMFF / MP4) but are segmented. I believe this combination is not supported by the DASH-IF IOP 5.2.10 (emphasis mine):
I appreciate that this stream works on 1.3.1, and not on 1.4.0, so even if this content isn’t fully spec compliant it still seems like a regression in the library.
I’m still working on plumbing the right timestamps around to get these subtitles showing up again - I haven’t quite got it working yet.
I’ve added a test that creates the same stack trace, and sent a change the fixes the code to not crash in this case - I hope to include this in
1.4.0-rc01. Thanks for raising this, and providing stack trace details so we could work out the issue.