-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Subtitles are rendered outside of videowindow control #15902
Comments
I think this problem started after that commit for background for subtitles. |
If that's the case I'll look into it and try to come up with a fix. |
this fixes position. scaling is a different story
|
This got broken in #14371 due to the code removed in overlayrenderergui.cpp. Scalling is easily solvable by bringing back the old code. Thanks for helping with a patch. I got the impression that using res and overscan was wrong in favor of using viewrect, destrect, sourcerect, etc. But it looks like none take into account the full dimensions of the window but just the videocontrol |
Right, but here res is taken from gfx context, which does not know about the view,dest,source rect.
Not quire right. |
@enen92 you are right, now I remember. The idea was getting rid of those calls to gfx context. In order to solve this, subtitle pos and scaling should be set like video rects in SetVideoRect. |
That was my idea since |
@FernetMenta a small question. Even if we treat the scale and the position like video rects the scalling operation will still require a call to gfx context (set transform) in overlayrendergui or am I wrong? Or should that be done before? |
@enen92 text subtitles do not follow the schema of the other types and violate the design of rendering of video player. They delegate rendering to some gui component which expects this kind of transformation matrix. For gui this is done at the beginning of gui rendering but here we see an ugly hack that lacks any sense of a reasonable design.
I would implement 2) for text subtitles with a "convert" function (see other types). |
Any solution yet? |
@FernetMenta I had a look into it and it seems the COverlayRenderGUI.cpp is just legacy code, a GUI component completely tied to the player and with no control from the Overlayrenderer. As far as I could see there is no easy way to get the texture to render it later from the overlayrenderer. While at it, I had a look into libass which seems to provide all the available options we support right now for text overlays and might provide even more in the future (shadows, etc). What do you think of dropping this GUI component and relying only on libass for text overlay rendering in the player? Would this be something you would "approve"/support? Seems like mpv does the same, creating events for each text overlay: https://github.com/mpv-player/mpv/blob/802f594a857c703ac88e946d14b69cd3b6eb6006/sub/osd_libass.c#L163 Best regards |
Sounds like an excellent plan to me. |
But i guess that's something for Kodi 19. |
@Leatherface75 unfortunately you either fix the scalling and break the subtitle background or leave it as it is. Another option is to disable the background if the video control is not in fullscreen. Either of the options sounds like a waste of effort, better fix it completely in v19. |
Your idea with disable background works for me. |
Bug report
Describe the bug
Here is a clear and concise description of what the problem is:
When a videowindow control is used with dimensions smaller than full screen, subtitles (tested, external srt sub) are rendered outside of the videowindow and are not scaled to videowindow dimensions.
Expected Behavior
Here is a clear and concise description of what was expected to happen:
The displayed subtitle is rendered using the subtitle settings and scaled/positioned within the dimensions of the videowindow control as can be observed in Kodi 17.
Actual Behavior
The subtitle is rendered full-size (at the display resolution/aspect). It appears to be positioned horizontally correctly, but vertically it is at the bottom of the screen, not within the videowindow control.
Possible Fix
To Reproduce
Steps to reproduce the behavior:
https://pastebin.com/6Zsdc2cH
When settings/player/language subtitle position is set to "fixed", the subtitle is rendered in the proper x-position but at the bottom of the screen, not the bottom of the videowindow control as experienced in Kodi 17. In addition, the subtitles are not scaled to the videowindow control dimensions.
If the language settings are changed to subtitle position "bottom of video", the subtitles are rendered within the videowindow control, but are not scaled.
Tested in both full screen window and true full screen with DXVA/pixel shaders/software rendering. All other system display settings are default.
Debuglog
The debuglog can be found here:
https://pastebin.com/pKjDPUm6
Screenshots
Here are some links or screenshots to help explain the problem:
Sub position fixed:
![source: imgur.com](https://camo.githubusercontent.com/e13d44d6e0391ac5dfb5870389ac7aa328ba7c0abd4a1ca9d7d8e1256aecad11/68747470733a2f2f692e696d6775722e636f6d2f447050646e49532e6a7067)
Sub position bottom of video:
![source: imgur.com](https://camo.githubusercontent.com/4932aeb552fe40385a25c5746b7344cc69c868308345ecbcb522fe78e0892ac6/68747470733a2f2f692e696d6775722e636f6d2f4c756f7765556d2e6a7067)
Kodi 17 Sub position fixed comparison:
![source: imgur.com](https://camo.githubusercontent.com/ee761ebf6050123dfde082e7b1c237455449ba2520730d5b13626f6f83eda0e4/68747470733a2f2f692e696d6775722e636f6d2f32386c634d56762e6a7067)
Additional context or screenshots (if appropriate)
Here is some additional context or explanation that might help:
Your Environment
Used Operating system:
Android
iOS
Linux
OSX
Raspberry-Pi
Windows
Windows UWP
Operating system version/name: Win 7 SP1 x64
Kodi version: 18.2 RC1 190410
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.
The text was updated successfully, but these errors were encountered: