-
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 goes out of safe area (bleeds out of screen) in Roll-up mode #7475
Comments
That |
ANSI/CTA-608-E R-2014 Annex B.5 says: "The concept of a movable base row for a roll-up caption is new." It means "new" compared to TC1 and TC2 (released in or before 1985). Issue: #7475 PiperOrigin-RevId: 315258859
Thank you very much @icbaker. That would greatly help us addressing the regulatory defect. |
This is now fixed on dev-v2. |
We implemented this a long time ago, so please forgive me if my recollection is incorrect. @sneelavara Could you also provide the last few instructions leading to the issue? You should not have more than 2 lines rolling if you are not at least in the second row.
Has the Roll-up mode checked separately, as roll up captions always grow upwards, their location is based on the last line of the Roll-up captions so they need to use ANCHOR_TYPE_END. In exoPlayer, as I recall, the lines on the screen are numbered as: 1
|
Ah thanks for the clarification @zsmatyas, I didn't realise this bit:
Your numbering of lines is semi-correct, but it's important to also consider that both of those numbering schemes extend past each other (positive numbers are just offset from the top of the screen, negative numbers from the bottom):
Relying on negative line offsets (from the bottom) to position something near the top of the screen is risky - because you don't know how many lines will "fit" on the screen, so it's easy to overshoot (or end up with captions in the middle of the screen). It all depends on the font size the subtitles end being rendered in (which is, in general, user-configurable (though I guess you can disable that in your own apps)). I think we should special-case |
Could we make sure that the content we want to fix is according to the standard? Are the indices / values correct and rendered with the expected font sizes? What is the base row and how many rows are rolling? As there are small adjustments for the exact positioning at many layers of the caption decoding / rendering, I do not think it is currently easy to use the top anchor, for example, having 3 lines of rolling captions, then switch to 2 lines by keeping the bottom 2 rows and keep them perfectly at the previous location of them. Also note: |
I think it's risky to use negative line offsets to display content in the top half of the screen - the 15 CEA-608 lines are forgotten by the time ExoPlayer comes to render the cues and if it's trying to render something on line I did the experiment of using the rolled up lines count. In this case, Without 770df86 (i.e. original behaviour, With 770df86 (current behaviour, Adjusting to consider the number of rolled up lines ( |
Thank you very much @icbaker and @zsmatyas for looking into this. @zsmatyas I don't think the stream violates the spec. It has RU2(0x14 0x25) follows by CR(0x14 0x2D) and PAC(0x11 0x70). Here is the CC byte pairs for the above two lines -
The first line "POINT VALUES ARE TRIPPLED" for us is cut half with this condition -
|
Reasoning and screenshots here: #7475 (comment) Issue: #7475 PiperOrigin-RevId: 315475888
Issue description
Summary
CEA-608 caption goes out of safe area (bleeds out of screen) in Roll-up mode
Root Cause
On certain Live TV channels the Caption from Live TV program bleeds out of the entire screen. This happens in Roll-Up mode and when the caption start at the left top with row number less than or equals to 2.
The Cea608Decoder.java line number 890
ExoPlayer/library/core/src/main/java/com/google/android/exoplayer2/text/cea/Cea608Decoder.java
Line 890 in 6bfdf8f
has this logic -
Roll-up caption with row number on top portion of the screen are also pulled up by two lines because of this code. When the row number is less than 2, the Roll-up caption is drawn on the top of the screen. I think this violates the safe area restriction. The effect of this is the caption from the first row is cut off.
Changing the if condition at line 890 to -
i.e. excluding Roll-up caption mode check, fixes the caption bleeding issue. Line 890 seem to be modified as part of commit (e86bfd6).
Could you please explain why the Roll-up captions are always pulled up by 2 lines? What could be the side effect of not checking for Roll-up mode at line number 890?
Reproduction steps
Using the sample HLS stream, play to the stream. Observe the caption when it’s on top left 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: