-
Notifications
You must be signed in to change notification settings - Fork 390
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
Repeated characters in CEA 608 captions #887
Comments
Thanks for the stream - is it possible the content it's currently playing is different? In the DASH manifest being served right now I see this 4 times, but no tags with spanish or spanish+english:
That said, the subtitles also don't seem to be functioning correctly at the moment - they appear and almost immediately disappear again, making them very hard to read (to the extent that I can't really tell if they also have the duplication problem you describe). I tried the same stream in the dash.js player and it has a different problem: a subtitle appears, and then stays on the screen for ages (1-2mins), even while lots of dialogue continues. Eventually it's replaced by another subtitle (which appears at the right time) then stays for another 1-2mins. So I conclude from this that the subtitles in the stream at the moment are likely invalid in some way, and ExoPlayer and dash.js just handle that invalid-ness in different ways. Given that, I'm afraid it's difficult to really progress the investigation further - since it looks like the subtitles in this stream are not playable correctly by other players either. |
That's unfortunate. Let me share a stream with you that I captured when I was able to reproduce this. The manifest is a bit odd as I had a go at converting it from a dynamic to a static manifest for testing purposes but it reproduces the issue. |
Btw, I also tried the stream with the duplication issue in dash.js as well as the Bitmovin web player and both play it fine. Unfortunately not my frankenstein stream. 😬 |
Another observation, this seems to be reproducible with ANY DASH manifest with 608 captions that falsely advertises an additional track. E.g. with https://dash.akamaized.net/dash264/TestCases/4c/1/dash.mpd, if you replace
with
a similar behaviour can be observed. |
Upon further testing, I'm only seeing this on the I found two places in our code that we seem to handle nodes like Here in media/libraries/exoplayer_dash/src/main/java/androidx/media3/exoplayer/dash/DashMediaPeriod.java Lines 886 to 893 in f6fe90f
Which calls through to media/libraries/exoplayer_dash/src/main/java/androidx/media3/exoplayer/dash/DashMediaPeriod.java Lines 908 to 932 in f6fe90f
And also, separately, in Lines 1833 to 1847 in f6fe90f
The I was able to reproduce the garbled output you describe by hacking the code in if (value.equals("CC1=eng")) {
value = "CC1=eng;CC3=spa";
} I also tried the same hack on 1.1.1 and saw the same duplication problem, i.e. this isn't a recent regression (mainly checking this because we have made some major subtitle infrastructure changes between 1.1.1 and 1.2.0). I can't immediatley see a difference in the way that |
Thanks for looking into this, this aligns with what I observed.
My observation is that the |
I agree that merging the english and spanish tracks into a single track group seems wrong. I didn't really know where to start, so I thought I'd see if I could resolve that on the offchance it fixed the duplication, and it seems to have done so... I need to spend a bit more time on this, partly to understand why that works - and will also try and add some automated tests. Thanks for the clue - that was a useful place to start digging :) |
Filed #904 to track this 'immediately disappearing' issue separately. |
While investigating Issue: #887 I naively assumed the CEA-608 captions were in a TS file, but they're actually in an MP4 (which is possibly obvious given DASH only supports MP4). This change includes container info in the `EventLogger` `tracks` output. PiperOrigin-RevId: 592192752
While investigating Issue: androidx/media#887 I naively assumed the CEA-608 captions were in a TS file, but they're actually in an MP4 (which is possibly obvious given DASH only supports MP4). This change includes container info in the `EventLogger` `tracks` output. PiperOrigin-RevId: 592192752
This was generated by combining the existing `ts/bbb_2500ms.ts` test asset and a temporary `.srt` file using https://cloud.google.com/transcoder/docs/how-to/captions-and-subtitles This doesn't directly reproduce the problem fixed by 7ca26f8, because the CEA-608 subs are structured differently to the stream I discovered the problem with (from Issue: #887). However this test does fail if that fix is reverted after 486230f. I'm also not able to repro the character duplication reported in Issue: #887 by just changing the manifest in this CL. I'm not yet sure on the exact differences between the stream provided on GitHub and this stream. This stream does provide some regression protection, because it currently fails with 'new' subtitle parsing (`DashMediaSource.Factory.experimentalParseSubtitlesDuringExtraction(true)`), though I'm not sure on the exact reason for that yet. PiperOrigin-RevId: 592476328
This was generated by combining the existing `ts/bbb_2500ms.ts` test asset and a temporary `.srt` file using https://cloud.google.com/transcoder/docs/how-to/captions-and-subtitles This doesn't directly reproduce the problem fixed by 4893d9b, because the CEA-608 subs are structured differently to the stream I discovered the problem with (from Issue: androidx/media#887). However this test does fail if that fix is reverted after 05ef2d4. I'm also not able to repro the character duplication reported in Issue: androidx/media#887 by just changing the manifest in this CL. I'm not yet sure on the exact differences between the stream provided on GitHub and this stream. This stream does provide some regression protection, because it currently fails with 'new' subtitle parsing (`DashMediaSource.Factory.experimentalParseSubtitlesDuringExtraction(true)`), though I'm not sure on the exact reason for that yet. PiperOrigin-RevId: 592476328
Hi @icbaker thanks for digging into this in December, It would be great to get this closed off if we can. Is there anything further you need from us to continue with this? if so please let us know. Thanks James |
I've looked back into this again, and splitting the different languages into separate TrackGroups no longer seems to resolve the issue - it's possible that I wasn't testing what I thought I was when I saw it fixing things last time. So I'm afraid I'm no closer to resolving this. I'll leave the issue open. |
While investigating Issue: #887 I naively assumed the CEA-608 captions were in a TS file, but they're actually in an MP4 (which is possibly obvious given DASH only supports MP4). This change includes container info in the `EventLogger` `tracks` output. PiperOrigin-RevId: 592192752 (cherry picked from commit 6853ffc)
Version
Media3 1.2.0
More version details
Happens on earlier versions as well.
Devices that reproduce the issue
Not dependent on any device. Reproducible e.g. on Pixel 6a or Pixel 6 emulator with Android 12/13/14
Devices that do not reproduce the issue
/
Reproducible in the demo app?
Yes
Reproduction steps
en
subtitleExpected result
Subtitles displayed normally, e.g.
Pork chops!
Actual result
This is a potential duplicate of google/ExoPlayer#10209 (comment). If you think I should rather add these findings to the existing issue in the
ExoPlayer
repository please let me know.The asset is a DASH stream with the following
Acessibility
tag:While the tag advertises two CC subtitle tracks, the CC3 (spanish) track is actually not present.
While this is obviously not ideal, the resulting Behaviour in ExoPlayer is quite unexpected:
Cues have repeating characters in pairs of two:
PoPorkrk c chohopsps!!
instead ofPork chops!
In addition to this, the following error is reported in logcat without crashing:
But I don't think that this is the root cause of the problem but rather a general issue in how multiple embedded CEA 608 tracks are represented. See 76700e9 for reference.
When looking into this topic in a bit more detail, it seems like the
Cea608Decoder.decode
function is called twice with the sameinputBuffer
. As each call decodes two characters (ccData1 and ccData2), the result is the repeating pattern of two characters. If theAccessibility
tag only contains a single CC track, it is only called once.Another observation is that the
TextRenderer
that holds theCea608Decoder
has the wrongFormat
(Spanish when English is selected) in theformatHolder
property. IMO this has to do with howChunkSampleStream.selectEmbeddedTrack
selects the track solely base ontrackType
which is obviouslyTRACK_TYPE_TEXT
for bothembeddedTrackFormats
as they are both subtitle tracks.The first
embeddedSampleQueues
it encounters is - by coincidence - theSpanish
one.Worth mentioning that forcing the correct
embeddedSampleQueues
to be used does not fix the problem, probably because they both contain the same content as they are filled with the same samples inCeaUtil.consume
called from theFragmentedMp4Extractor
.Media
Stream was shared via e-mail.
Bug Report
adb bugreport
to [email protected] after filing this issue.The text was updated successfully, but these errors were encountered: