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] Align to screen image based subtitles when video source is cropped #21162
Conversation
0babfcf
to
c598214
Compare
test builds: |
I've runtime tested this and seems to work just fine. I like the approach to avoid yet another setting. Bluray menus work fine too. Using vobsub subs (while toggling different zoom modes): Subtitles scale correctly depending on the "crop" percentage. I am wondering if we could have the same for text based subtitles though. Adding an external subtitle to the same DVD and the behavior is different: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice improvement! As long as the BR menus don't break (and @thexai reports a +1) I am fine with this.
Wondering if we couldn't have similar behavior for text subs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This introduce a different behaviour for scaling/stretching for image based subtitles, that concern cropped video cases only.
I don't approve of it because it doesn't do what it's supposed to do.
That is, with original video sources (not cropped) it should not change anything.
Probably the only solution is a new setting to enable this optionally (default disabled). I'm not asking for it, for me the master branch is fine as it is now.
This is a "bad source" |
it is not a bad source, often black bars are cropped from video dvd/bd rip oh i was tried overscan but not zoom, i will check for text based subs separately |
It's not about "excluding" DVD / Blu-Ray / UHD Blu-Ray / MKV untouched remuxes... It is about adding a "special corner case" cropped video + not cropped PGS subs without break all other things. |
c598214
to
da445b5
Compare
2a6de4a
to
495403d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and confirmed that now is working fine with 1080p and 4K untouched (AR = 16/9) video sources.
495403d
to
28d4b35
Compare
please wait to merge, i want test a bit more |
28d4b35
to
69fda55
Compare
ok i have done, also done a couple of test with DVB subtitles samples all ok |
69fda55
to
62b250f
Compare
62b250f
to
1007443
Compare
1007443
to
5400b45
Compare
all fine thanks |
For cropped video where verticalshift is introduced, PGS subtitles don't honor the shift. I routinely shift cropped 1080p videos by -0.75 in my projector setup that has bottom masking only, but this causes the subtitles to drop down into the black bars. |
on kodi there are no settings for image based subtitles, then you cant move PGS subtitles you can request on the Kodi forum on feature request section, |
Sorry about that Stefano. TBC, when I'm shifting the video via supported methods, I expect overlays to shift with it, so I consider this a bug (it does the right thing when shifting uncropped video). But sorry about posting on this PR, I'll use the right channel (or try submitting a PR myself). |
Description
This introduce a different behaviour for scaling/stretching for image based subtitles, that concern cropped video cases only.
Now if a video has been cropped and the subtitles have been created for non-cropped video,
subtitles will be aligned to the screen by keeping the aspect-ratio, instead of align to video that cause to show subtitles distorted/squashed.
Motivation and context
Time ago merged PR #20204 (with some revert with #20794) to fix issue #14866,
mainly i have changed the alignment from
ALIGN_SCREEN
toALIGN_VIDEO
.This change allow to show the PGS/Vobsub correctly as happens on VLC/MPV players, respecting the correct positioning and appearance (even when the window is resized).
But (as happens on all other players) this cause a side effect with the videos that has been remuxed and cropped (removed black bars).
When a video is cropped have less height than the original source, if the subtitle images are scaled to the cropped video source (ALIGN_VIDEO) the subtitles will be displayed distorted/squashed, as i example in this issue #21141.
Then instead add another setting i have add a check to compare the subtitle size param to the video source, in this way we can understand if the video has been cropped, and align the subtitles to screen by keeping the aspect ratio
ALIGN_SCREEN_AR
.This fix #21141 i have tested with the provided video and all my PGS/Vobsub/SUP with success
This partially re-add the code of #20204 to keep aspect ratio, but should not affect bluray menu, because use full resolution for menu. I have tested with a my bluray sample but it do not have a java menu and kodi do not handle it in good way, in any case i do not see regression for this case.
@thexai please can you try with your "Viuda negra" bluray that have java menu?
i will prepare an artifact to allow testing
How has this been tested?
From our FTP folder: samples_new/subtitles/PGS/
La.dolce.vita.1960.1080p.Criterion.Bluray.DTS.x264.mkv (cropped video with cropped subtitles resolution, subtitles must be shown inside video not in the black bars and aligned to the video)
PGS_StretchingTest.mkv (4/3 video and same thing for subtitles, subtitles must be shown with right aspect ratio and aligned to the video)
A Global Journey_cropped.mkv (this is a cropped video with full 1080p subtitle. With the first sub track : original english, subtitles must be appears with right aspect ratio, aligned to the screen)
Bohemian.Rhapsody.2018.4K.PGS.at.1080.mkv (this is a full 4K video resolution with full 1080p subtitle, subtitles must be appears aligned with the video)
What is the effect on users?
Have a better aspect ratio of subtitles when used with cropped videos,
and so allow to see subtitles with right aspect ratio on ultrawide monitor's
Screenshots (if appropriate):
Types of change
Checklist: