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

Borderstyle=3 box height is affected by fallback fonts #691

Open
rahulshivajipawar opened this issue May 2, 2023 · 6 comments
Open

Borderstyle=3 box height is affected by fallback fonts #691

rahulshivajipawar opened this issue May 2, 2023 · 6 comments

Comments

@rahulshivajipawar
Copy link

Screenshots

Screenshot 2023-05-02 at 8 11 05 PM

Description of the issue

The subtitles in Kannada language for font type Noto Sans are not rendered correctly using ffmpeg's ass filter which in turn uses libass.

Here is the link to get Noto Sans Kannada fonts. https://fonts.google.com/noto/specimen/Noto+Sans+Kannada

libass version

libass.so.9

Is it a regression?

No response

ASS Sample

[Script Info]
; Script Generated by Banva
ScriptType: v4.00+
PlayResX: 384
PlayResY: 288
ScaledBorderAndShadow: yes

[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
Style: Banva-1,Noto Sans,16,&H00ffffff,&Hffffff,&H00000000,&H000000,0,0,0,0,100,100,0,0,3,2,0,2,10,10,10,0

[Events]
Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
Dialogue: 0,0:0:0.35,0:0:3.57,Banva-1,,0,0,0,,ಸ್ಮಿತ್ ಚಾರ್ಟ್ ಎಂದು ಕರೆಯಲ್ಪಡುವ ಮೈಕ್ರೋವೇವ್\Nಎಂಜಿನಿಯರಿಂಗ್ ನಲ್ಲಿ
Dialogue: 0,0:0:3.57,0:0:6.36,Banva-1,,0,0,0,,ನಾವು ಬಳಸುವ ಸಾಧನದ ಬಗ್ಗೆ ನಾನು ನಿಮಗೆ ಸ್ವಲ್ಪ\Nಹೇಳಲಿದ್ದೇನೆ.
Dialogue: 0,0:0:7.13,0:0:11.05,Banva-1,,0,0,0,,ಆದ್ದರಿಂದ ನೀವು ಅಡೆತಡೆಗಳ ಹೊಂದಾಣಿಕೆಯ ಬಗ್ಗೆ\Nಕಲಿತಿದ್ದೀರಿ.
Dialogue: 0,0:0:11.05,0:0:14.80,Banva-1,,0,0,0,,ಆದ್ದರಿಂದ ತಾಂತ್ರಿಕವಾಗಿ ಸಾಮಾನ್ಯವಾಗಿ\Nಮೈಕ್ರೊಸ್ಟ್ರಿಪ್
Dialogue: 0,0:0:14.80,0:0:18.22,Banva-1,,0,0,0,,ಲೈನ್ ಅಥವಾ ಯಾವುದೇ ರೀತಿಯ ರೇಖೆಯನ್ನು\Nಹೊಂದಿರುತ್ತದೆ.
Dialogue: 0,0:0:18.22,0:0:21.56,Banva-1,,0,0,0,,ಇಲ್ಲ, ಮತ್ತು ನೀವು ಆ ಎರಡನ್ನೂ\Nಹೊಂದಿಸುತ್ತಿದ್ದೀರಿ.
Dialogue: 0,0:0:22.69,0:0:23.03,Banva-1,,0,0,0,,ಉಹ್.
Dialogue: 0,0:0:23.81,0:0:28.22,Banva-1,,0,0,0,,ಲೋಡ್ ಆದ್ದರಿಂದ ನಿಮಗೆ ನೀಡುವ ಸೂತ್ರವನ್ನು ನಾವು\Nನೋಡಿದ್ದೇವೆ.
Dialogue: 0,0:0:28.94,0:0:29.97,Banva-1,,0,0,0,,ಇನ್ ಪುಟ್ ಇಂಪೆಡೆನ್ಸ್.root@ff336626527b:/src/245f0963-c3bc-4bdd-99f2-a6173a1ba7eb

Special Fonts

I uploaded or linked to the required font

System Information

ffmpeg burning of subtitles happens inside a linux (debian) docker container.

System Info:

Linux ff336626527b 5.10.124-linuxkit #1 SMP PREEMPT Thu Jun 30 08:18:26 UTC 2022 aarch64 GNU/Linux

Log

No response

Additional info

No response

@rahulshivajipawar rahulshivajipawar changed the title Rendering: Rendering: Kannada Subtitles (with Noto Sans) are not rendered correctly May 2, 2023
@TheOneric
Copy link
Member

TheOneric commented May 2, 2023

Thanks for your report! Unfortunately though, it is not immedeatily obvious to me what issue you are referring to and you will need to be a bit more precise.
Checking against Google’s online rendering nothing stands out to me on first glance:
grafik

  • Describe in detail what exactly appears wrong to you? What result were you expecting instead?
  • Replace put-your-other-options-here to match your example (using the real video and subtitle file used to produce the screenshot) and then run ffmpeg -v debug put-your-other-options-here 2>&1 | tee -a 691.log and upload the resulting 691.log file. This is important to see which fonts get actually selected and gives more info about your libass version.
  • Please provide the exact command line options you were using (you can redact file paths)
  • If you have access to a MS Windows installation, have you checked if VSFilter produces the same result? (ideally xy-VSFilter and mention what version of Windows you were testing on)

@rahulshivajipawar
Copy link
Author

The precise issue is that background is not wrapped correctly around "spaces" between words and at the "period".

@rcombs
Copy link
Member

rcombs commented May 2, 2023

So this is specific to BorderStyle 3, then?

@astiob
Copy link
Member

astiob commented May 2, 2023 via email

@rahulshivajipawar
Copy link
Author

So this is specific to BorderStyle 3, then?

Yes, this is specific to BorderStyle 3.

@rahulshivajipawar
Copy link
Author

rahulshivajipawar commented May 3, 2023

Based on the screenshots, looks like a case where the named font doesn't contain Kannada (but does contain spaces and full stops) and a substitute font with different metrics is selected.We render BorderStyle 3 for each glyph, but it should be rendered for each glyph run using the main font's metrics. In fact, the metrics of glyphwise substitute fonts should not affect anything, not only BorderStyle 3. For example, line height/spacing suffers as well.

You are correct. I tried changing the font type from "Noto Sans" to "Noto Sans Kannada" in ass file, then all the glyphs are rendered consistently. During the original rendering, "spaces" and "period" were probably rendered using "Noto Sans" font while the rest of the glyphs were rendered using the substitute font "Noto Sans Kannada."
Screenshot 2023-05-03 at 9 05 28 AM

@TheOneric TheOneric changed the title Rendering: Kannada Subtitles (with Noto Sans) are not rendered correctly Borderstyle=3 box height is affected by fallback fonts May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants