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

Subtitle srt file colour problem #18917

Closed
1 of 7 tasks
kevin201 opened this issue Dec 9, 2020 · 11 comments · Fixed by #20307
Closed
1 of 7 tasks

Subtitle srt file colour problem #18917

kevin201 opened this issue Dec 9, 2020 · 11 comments · Fixed by #20307
Labels
Component: Subtitles Resolution: Fixed issue was resolved by a code change Triage: Has proposed fix Issue has been reproduced and has a pending proposed fix

Comments

@kevin201
Copy link

kevin201 commented Dec 9, 2020

Bug report

Describe the bug

Here is a clear and concise description of what the problem is:

Some RGBA font colours are not displayed correctly.
In an srt file the <font color="#00ff00ff">Text</font> should be rendered as green, but is actually black.

Expected Behavior

Here is a clear and concise description of what was expected to happen:

Should be green text.

Actual Behavior

Subtitle text appears coloured black.

Possible Fix

Alpha transparency does not appear to be understood properly?

To Reproduce

Steps to reproduce the behavior:

  1. Use any srt file with RGBA colours. Some colours will not be rendered correctly and appear black.

Debuglog

The debuglog can be found here:

Screenshots

Here are some links or screenshots to help explain the problem:

Additional context or screenshots (if appropriate)

Here is some additional context or explanation that might help:

Your Environment

Used Operating system:

  • Android

  • iOS

  • tvOS

  • Linux

  • OSX

  • Windows

  • Windows UWP

  • Operating system version/name:

  • Kodi version:
    Leia 18

note: Once the issue is made we require you to update it with new information or Kodi versions should that be required.
Team Kodi will consider your problem report however, we will not make any promises the problem will be solved.

@enen92
Copy link
Member

enen92 commented Dec 9, 2020

Please share a subtitle sample

@kevin201
Copy link
Author

kevin201 commented Dec 9, 2020

4
00:00:49,640 --> 00:00:51,600
<font color="#00ff00ff">I think I've got more</font>
<font color="#00ff00ff">than enough. Thanks.</font>

@DaVukovic
Copy link
Member

DaVukovic commented Dec 14, 2020

Seems your hex-code is wrong. I changed the one line to:

<font color="#00ff00">I think I've got more</font>
and it works like a charm. I removed the last ff

Check for the correct code here: https://www.color-hex.com/

@kevin201
Copy link
Author

Seems your hex-code is wrong. I changed the one line to:

<font color="#00ff00">I think I've got more</font>
and it works like a charm. I removed the last ff

Check for the correct code here: https://www.color-hex.com/

Hi! :-)

Many thanks for the interest. The hex code (not mine, by the way) is in the form #rrggbbaa, where "aa" is the alpha, or transparency.

Hence, not actually wrong, and I do know that Kodi renders #rrggbb codes correctly, but apparently not with the alpha portion.

@DaVukovic
Copy link
Member

Seems the alpha channel for subtitles is a feature request: https://forum.kodi.tv/showthread.php?tid=332432

So I'll close this one as it's not an issue if it's unsupported. I did a few tests and the alpha-channel-section seems not to be supported currently.

@kevin201
Copy link
Author

Interesting, thanks.
I've just had another scout around, and the alpha format seems to be muddled between Android and W3

Android defines it as #AARRGGBB :
https://developer.android.com/guide/topics/resources/more-resources#Color

Where W3 has is as #RRGGBBAA :
https://www.w3.org/TR/css-color-4/#hex-notation

Thanks for the info anyway. At least we know that this is coming through in some .srt files now.

@enen92
Copy link
Member

enen92 commented Dec 14, 2020

Subtitles will (fingers crossed) have a lot of improvements for v20 where the old GUI based component will hopefully be removed in favour of libass as the engine, which will.overcome a lot of style limitations we have right now.
I'll reopen this and add it as a roadmap issue. Thanks for checking it out Davu.

@enen92 enen92 reopened this Dec 14, 2020
@enen92 enen92 added the Roadmap ticket on the Team roadmap label Dec 14, 2020
@enen92 enen92 added the Triage: Has proposed fix Issue has been reproduced and has a pending proposed fix label Oct 11, 2021
@enen92
Copy link
Member

enen92 commented Oct 11, 2021

After some internal discussion we were not able to find any source that mentions that rgba colours are supported in srt subs. If you want to have a custom implementation where this is supported you can try the above patch. However, it will not make it into the source code.

@enen92 enen92 closed this as completed Oct 11, 2021
@enen92 enen92 added Resolution: Not applicable issue is not relevant to code in this repo and is not an external issue and removed Roadmap ticket on the Team roadmap labels Oct 11, 2021
@kevin201
Copy link
Author

After some internal discussion we were not able to find any source that mentions that rgba colours are supported in srt subs. If you want to have a custom implementation where this is supported you can try the above patch. However, it will not make it into the source code.

Thanks again. Just for info this is still a current issue, as I am regularly receiving srt files with that colour format.

00:19:29,760 --> 00:19:32,960
<font color="#00ffffff">straight back to our front door.</font>
<font color="#00ffffff">To you, Mica, Pearl.</font>

319
00:19:32,960 --> 00:19:36,080
<font color="#00ffffff">And to Raymond. No-one is safe.</font>

@enen92 enen92 reopened this Oct 12, 2021
@enen92 enen92 removed the Resolution: Not applicable issue is not relevant to code in this repo and is not an external issue label Oct 12, 2021
@enen92
Copy link
Member

enen92 commented Oct 12, 2021

Thanks for the provided examples @kevin201
I've submitted #20307 as a way to always take the first 3 bytes of the colour and assume its RGB.

@kevin201
Copy link
Author

Many thanks.

@enen92 enen92 added the Resolution: Fixed issue was resolved by a code change label Oct 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Subtitles Resolution: Fixed issue was resolved by a code change Triage: Has proposed fix Issue has been reproduced and has a pending proposed fix
Projects
None yet
3 participants