-
Notifications
You must be signed in to change notification settings - Fork 6k
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
CEA-608 caption covers entire screen in Roll-up mode #7341
Comments
Thanks for the report - I can reproduce with the provided media. I'll take a deeper look next week. |
If I understand correctly this problem occurs because the media you're using is not spec-compliant (i.e. it's missing the CR code that must precede each row). Doing anything on based on section B.9 of the CEA-608 spec seems wrong - the sentence you highlighted seems to refer to behaviour of the TC1 decoder which the introduction states was last sold in mid-1985 and support for its behaviour can likely be phased out during 1994 and 1995. It seems the reason ExoPlayer ends up filling the screen in this case is because we auto-wrap the subtitles. If we didn't auto-wrap then then it would only ever be two lines. I grabbed the subtitle text when it's almost filling the screen (rendering 6 lines on my device) and it only has one
Would you be happy with ExoPlayer's behaviour if we didn't auto-wrap? It's likely we can't turn off auto-wrapping in all cases, but we might be able to add a property like |
Thank you @icbaker for the inputs. I don't have a strong evidence to declare this stream as off spec. I couldn't find any reference which says the CR is mandatory. Other players (like Safari and VLC media player) are handling this situation gracefully by not filling the entire screen.
|
ANSI/CTA-608-E R-2014 spec defines exactly 32 columns on the screen, and limits all lines to this length. See 3.2.2 definition of 'Column'. issue:#7341 PiperOrigin-RevId: 311549881
After some discussion with the team we decided to solve this slightly differently: Update This is now pushed to dev-v2, it fixes the issue with the provided media. |
Thank you @icbaker |
Issue description
Summary
CEA-608 caption covers entire screen in Roll-up mode
Root Cause
On certain Live TV channels the Caption from Live TV program covers the entire screen. This happens in Roll-Up mode and mostly during commercial breaks.
As per spec CEA-608-E the Roll-up style
Precede each new row of text with these three codes:
The above sequence is seen during normal working. But when the problem happens the CR (Carriage Return) code is not seen.
Working case - has CR (0x14, 0x2D) in between RU2 (ox14, 0x25) and PAC (0x13, 0x70). Please see the caption byte pairs capture -
When caption starts filling the screen the CR is not seen
The Cea608Decoder.java does handle the PAC in Cea608Decoder.handlePreambleAddressCode() by setting the base row and indent. The base row (row 13 for the stream we tested) and indent is 0 are set correctly. But the problem is, it continues to accumulate the caption bytes in currentCueBuilder.captionStringBuilder. The captionStringBuilder seem to be reset when CR (0x14, 0x2D) code is received. But when there is no CR code, the caption bytes are continuously appended to captionStringBuilder. In the stream we used to reproduce, the length of captionStringBuilder grows up to 3858 bytes. This whole 3858 bytes are rendered on screen as a second row in Roll-up2 case making the caption visible on entire screen.
I did not see a convincing statement to justify the stream. But CEA-608 section B.9 seem to tell “when a PAC addresses a cell in the midst of a displyable characters already received, destroy the character to the left of the cursor”. Could that be implemented in Cea608Decoder.handlePreambleAddressCode() ?
I tested this stream on VLC media player and Safari. Both players are working around by just drawing only one row. i.e. the row 2 in this case does not grow to fill the entire screen.
Proposed Solution
The work around we tried is to set the length of captionStringBuilder to 0 in Cea608Decoder.handlePreambleAddressCode() if there is no CR seen. That seem to address this problem.
Please suggest if there are better way to handle this ?
Reproduction steps
Using the sample HLS stream, play to the first commercial break 40 seconds into the stream. Observe the caption "Backto the ABC…” starts growing to cover the entire screen
Link to test content
Content is broadcast from cable, so link was sent to exoplayer dev email
A full bug report captured from the device
N/A
Version of ExoPlayer being used
2.11.4
Device(s) and version(s) of Android being used
Tested and reproduced on Arris and Amino AndroidTV devices running Android Pie. Reproduction is 100%.
The text was updated successfully, but these errors were encountered: