v20 New Kodi subtitles renderer in Kodi 20 - TESTERS NEEDED
#31
(2021-10-20, 08:36)CastagnaIT Wrote: i already know the source code without go in deep, if you want us to consider this change you should provide a valid reason, that's why i asked to provide an example for the problem that you have mentioned

if you need to set the position manually every time why you do not use the "Manual" position setting (where you can use the actions shorcuts)?
First and foremost, to simplify the user experience as there is no practical reason why the ability to move the subtitle should be limited to only "fixed mode".

For example, the end user should to be able to shift the subtitle up or down relative to the default position when using mode "Bottom of the video" or whatever settings. Besides that, IMHO I think that the descriptions of the different modes can be made clearer (but that's another topic).

But before we start arguing about what is right or wrong, please let me have a look into in the details how it works in v20.
Reply
#32
(2021-10-20, 08:36)CastagnaIT Wrote: i am not sure if it is currently possible to implement something to change the colour automatically according to the type of video content
Yeah I can imagine it's not possible because I don't think Kodi offers any way to know if a video is HDR or not before playing it?

At least from what I found about people who want to display the HDR flag in a skin, this is currently implemented by adding "hdr" to the filename and not based on the actual content of the file.
Reply
#33
Just to summarize on the RTL thing -- I have convinced myself that the current libass is correct, unless Kodi could flag the document default direction is RTL.  However, I don't think any other player does this and subbers have compensated with a work around.  So a change would probably break existing text subs.

A user wanted to display subs in Indic language/script Bengali.  I suggest he try 20 and he reported that he could install a font with Bengali support and the subs displayed correctly.

I updated my skin with the new color picker and it all worked as far as I can tell on subrip/srt subs.  In the default Kodi arial font I couldn't see a visual difference between regular and bold weight, but that may be a function of the font.

On the "manual" sub positioning, I might be nice if it was possible to place a button to get to video calibration from the player/languages settings.  I think that needs (or would be easier) with support in core.

Not sure what is the difference between box and square box background?

scott s.
.
Reply
#34
> In the default Kodi arial font I couldn't see a visual difference between regular and bold weight, but that may be a function of the font.

you have to put the two styles side by side to see the difference
the bold difference is not marked as the legacy subtitles rendering where i think it did not consider the "weight" bold scale of fonts

> Not sure what is the difference between box and square box background?

you have to compare with subtitles multilines, so the type of box will be different
Dev-Maintainer of InputStream Adaptive add-on, Netflix add-on ▫ Skills Python, C#, VB.NET and a bit of C++
Reply
#35
To start with I really like the new handling of subtitles in v20, nicely done!  Since my development environment recently started working, I've just started looking around at how vertical subtitle adjustment works in v20. Below some initial thoughts. 

1. V20 seems to handle vertical adjustment of subtitle position like previous versions ie it only works with SUBTITLE_ALIGN_MANUAL thus opts.usePosition = true. Se below:
 
github.com/master/xbmc/cores/VideoPlayer/VideoRenderers/OverlayRenderer.cpp#L388-L396
cpp:
// Set position of subtitles based on video calibration settings
if (subAlign == SUBTITLE_ALIGN_MANUAL)
{
  rOpts.usePosition = true;
  RESOLUTION_INFO res;
  res = CServiceBroker::GetWinSystem()->GetGfxContext().GetResInfo(
  CServiceBroker::GetWinSystem()->GetGfxContext().GetVideoResolution());
  rOpts.position = 100.0 - (double)(res.iSubtitles - res.Overscan.top) * 100 / res.iHeight;
}

github.com/master/xbmc/cores/VideoPlayer/DVDSubtitles/DVDSubtitlesLibass.cpp#L399-L402
cpp:

// Vertical margin (direction depends on alignment)
// to be set only when the video calibration position setting is not used
if (opts.usePosition)
  style->MarginV = 0;
else
  style->MarginV = static_cast<int>(subStyle.marginVertical * scale);
}


2. However, it seems that PlayerController has already been prepared to handle vertical alignment adjustments for all modes. I'l try a qick 'n dirty fix to implement vertical alignment accordingly. For example, see "res_info.iSubtitles" with ACTION_SUBTITLE_VSHIFT_UP, se below:
github.com/master/xbmc/video/PlayerController.cpp#L331-L356 
cpp:
case ACTION_SUBTITLE_VSHIFT_UP:
{
  RESOLUTION_INFO res_info = CServiceBroker::GetWinSystem()->GetGfxContext().GetResInfo();
  int subalign = CServiceBroker::GetSettingsComponent()->GetSettings()->GetInt(CSettings::SETTING_SUBTITLES_ALIGN);
  if ((subalign == SUBTITLE_ALIGN_BOTTOM_OUTSIDE) || (subalign == SUBTITLE_ALIGN_TOP_INSIDE))
  {
    res_info.iSubtitles ++;
    if (res_info.iSubtitles >= res_info.iHeight)
      res_info.iSubtitles = res_info.iHeight - 1;

    ShowSlider(action.GetID(), 274, (float) res_info.iHeight - res_info.iSubtitles, 0.0f, 1.0f, (float) res_info.iHeight);
  }
  else
  {
    res_info.iSubtitles --;
    if (res_info.iSubtitles < 0)
      res_info.iSubtitles = 0;

    if (subalign == SUBTITLE_ALIGN_MANUAL)
      ShowSlider(action.GetID(), 274, (float) res_info.iSubtitles, 0.0f, 1.0f, (float) res_info.iHeight);
    else
      ShowSlider(action.GetID(), 274, (float) res_info.iSubtitles - res_info.iHeight, (float) -res_info.iHeight, -1.0f, 0.0f);
  }
  CServiceBroker::GetWinSystem()->GetGfxContext().SetResInfo(CServiceBroker::GetWinSystem()->GetGfxContext().GetVideoResolution(), res_info);
  return true;
}


3. During my peek around in "OverlayRenderer.cpp" I found a possible typo but maybe I'm misunderstanding the logic behind "SUBTITLE_ALIGN_TOP_OUTSIDE" used on both lines. Or is it intentional that drawWithinBlackBars only is allowed in "OUTSIDE" mode?

github.com/master/xbmc/cores/VideoPlayer/VideoRenderers/OverlayRenderer.cpp#L325-L330
cpp:
int subAlign = CServiceBroker::GetSettingsComponent()->GetSettings()->GetInt(
    CSettings::SETTING_SUBTITLES_ALIGN);
    
if (subAlign == SUBTITLE_ALIGN_TOP_INSIDE || subAlign == SUBTITLE_ALIGN_TOP_OUTSIDE)
  m_overlayStyle->alignment = KODI::SUBTITLES::FontAlignment::TOP_CENTER;
else
  m_overlayStyle->alignment = KODI::SUBTITLES::FontAlignment::SUB_CENTER;

if (subAlign == SUBTITLE_ALIGN_BOTTOM_OUTSIDE || subAlign == SUBTITLE_ALIGN_TOP_OUTSIDE)
  m_overlayStyle->drawWithinBlackBars = true;
--
Reply
#36
@Boilerplate4U 1) 2) Currently manual subtitle position behaviour has been intentionally changed to only work with SUBTITLE_ALIGN_MANUAL case.

The manual position management (by shortcut/json) need to be revisited,
To make manual positioning work again (with all subtitle position settings) should works in this way:
- If sub position is, not, set as SUBTITLE_ALIGN_MANUAL: A manual position change (shortcut/json) have to be temporary (resetted on playback stop) and must not change the video calibration subtitle bar
- If sub position is set as SUBTITLE_ALIGN_MANUAL: Then a new position changed (shortcut/json) is saved in video calibration

3) it is right as is
Dev-Maintainer of InputStream Adaptive add-on, Netflix add-on ▫ Skills Python, C#, VB.NET and a bit of C++
Reply
#37
Thanks! Another thing I have thought about for a while. In the long run it would be really nice if you can have all the subtitle settings also in the video player subtitle dialog ie GUIDialogSubtitles.cpp (WINDOW_DIALOG_SUBTITLES, "DialogSubtitles.xml").  In this way, you would be able to see all the changes right away while playing a video.
Reply
#38
(2021-11-04, 18:35)Boilerplate4U Wrote: Thanks! Another thing I have thought about for a while. In the long run it would be really nice if you can have all the subtitle settings also in the video player subtitle dialog ie GUIDialogSubtitles.cpp (WINDOW_DIALOG_SUBTITLES, "DialogSubtitles.xml").  In this way, you would be able to see all the changes right away while playing a video.

ATM does not seem a good idea, currently the subtitle GUI settings in Player page need to be partially reworked and there are other code cleaning todo,
this and others changes need to be also discussed internally in the Kodi team,
suggest you to make your requests in the "Feature request" forum page,
or if you want to propose/discuss/develop by yourself some major changes is better for you to join in the Kodi team to know the status and how to proceed with the development

here in the forum i personally will not discuss further what to do and how to proceed with the development
Dev-Maintainer of InputStream Adaptive add-on, Netflix add-on ▫ Skills Python, C#, VB.NET and a bit of C++
Reply
#39
(2021-11-05, 20:55)CastagnaIT Wrote: ATM does not seem a good idea, currently the subtitle GUI settings in Player page need to be partially reworked and there are other code cleaning todo,
this and others changes need to be also discussed internally in the Kodi team,
suggest you to make your requests in the "Feature request" forum page,
or if you want to propose/discuss/develop by yourself some major changes is better for you to join in the Kodi team to know the status and how to proceed with the development

here in the forum i personally will not discuss further what to do and how to proceed with the development

No problem because as it wasn't meant as a "feature request"!

See it more as a general idea with focus on improvement of the usability regarding the user interface regardless of how it needs to be implemented technically (which is greatly needed IMHO).

So dont't you worry, I do things to improve usability for my own part and implements any changes in my own fork, that is for both vertical adjustment of subtitles and related GUI. If anyone is interested as part of the official release that's ok but I currently have no ambition to join team kodi.
Reply
#40
@CastagnaIT I just noticed this PR being worked on and almost merged I think: https://github.com/xbmc/xbmc/pull/19983

Could you use this to introduce separate subtitle colors for each type of video (DV, HDR and SDR)?
Reply
#41
would it be possible to make an option to use another color when HDR is enabled?

thanks for any help
Reply
#42
@rbuehlma @CastagnaIT Currently using pvr.zattoo (20.2.1.1) addon with LibreELEC 11 (Kodi 20 Nexus) Nightlies on an rpi4 (nightly-20220224-ae5c471)

I have noted that setting of subtitle color is not currently being correctly respected in pvr.zattoo addon, compared to when watching local networked media where assigned subtitle color is being respected.

My current subtitle settings

Image

Image

Example of correct subtitle color "blue" displayed during kodi playback of local media over network.

Image

Example of incorrect subtitle Color "Red" displayed during kodi playback of a pvr.zatto recording.

Image

kodi.log which appears to comment about an issue with subtitles setup, when preparing for pvr.zattoo playback i.e.

code:
2022-02-28 10:49:36.998 T:1849     INFO <general>: CDVDSubtitlesLibass: Using libass version 1500000
2022-02-28 10:49:36.999 T:1849     INFO <general>: CDVDSubtitlesLibass: Creating ASS library structure
2022-02-28 10:49:36.999 T:1849     INFO <general>: CDVDSubtitlesLibass: Initializing ASS Renderer
2022-02-28 10:49:36.999 T:1849     INFO <general>: CDVDSubtitlesLibass: Initializing ASS library font settings
2022-02-28 10:49:37.000 T:1849    ERROR <general>: GetDirectory - Error getting /storage/.kodi/temp/fonts/
2022-02-28 10:49:37.000 T:1849    ERROR <general>: GetDirectory - Error getting special://temp/fonts/
2022-02-28 10:49:37.078 T:1849     INFO <general>: CDVDSubtitlesLibass: Creating new ASS track

Thought useful to report issue in this thread.
RPi4, (LibreELEC 11.0) hdmi0 -> Philips 55PUS7304 4K TV, hdmi1 -> Onkyo TX-SR608 AV Receiver
Reply
#43
@MikeKL if you provide a log with debug info maybe is possible to see something,
i dont know how works that addon but if you are able to get the subtitle data can be useful to check the problem
Dev-Maintainer of InputStream Adaptive add-on, Netflix add-on ▫ Skills Python, C#, VB.NET and a bit of C++
Reply
#44
@CastagnaIT as requested kodi debug log, hope contained information is helpful.
RPi4, (LibreELEC 11.0) hdmi0 -> Philips 55PUS7304 4K TV, hdmi1 -> Onkyo TX-SR608 AV Receiver
Reply
#45
(2022-02-28, 21:04)MikeKL Wrote: @CastagnaIT as requested kodi debug log, hope contained information is helpful.

a bit yes,
that addon send subtitles to the Kodi "Text Subtitle Decoder"
this decoder decode subtitles as SRT (subrip) format but could accept also extra tags

IMO i think that the causes could be two
or pvr.zattoo addon provide coloured text as default
or pvr.zattoo addon encodes colours differently from the required format in our decoder

in any case without having the possibility to have a example raw subtitle data to see it is difficult to say
more likely this need to be fixed in pvr.zattoo
Dev-Maintainer of InputStream Adaptive add-on, Netflix add-on ▫ Skills Python, C#, VB.NET and a bit of C++
Reply

Logout Mark Read Team Forum Stats Members Help
New Kodi subtitles renderer in Kodi 20 - TESTERS NEEDED0