Font Size Mismatch When Using Fallback Fonts in FFmpeg ASS Subtitles - Stack Overflow
I’m facing an issue with font size mismatch in ASS subtitles rendered by FFmpeg when combining English text with Arabic or Persian characters.
Steps to Reproduce:
1.Subtitle File: Here’s an example of the ASS subtitle file:
[Script Info]
Title: Generated ASS
ScriptType: v4.00+
WrapStyle: 2
ScaledBorderAndShadow: yes
YCbCr Matrix: none
PlayResX: 1920
PlayResY: 1080
[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: Default, ABeeZee, 40, &H00FFFFFF, &H000000FF, &H00000000, &H00000000, -1, 0, 0, 0, 100, 100, 0, 0, 1, 1, 0, 2, 10, 10, 10, 1
[Events]
Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
Dialogue: 0,0:00:01.00,0:00:05.00,Default,,0,0,0,,Hello! This is English text.
Dialogue: 0,0:00:05.00,0:00:10.00,Default,,0,0,0,,سلام! This is mixed Arabic/English text.
- Command Used:
ffmpeg -i input.mp4 -vf "ass=subtitle.ass" output.mp4
- Screenshots: Below are two screenshots of the issue:
• Text rendered with the main font (ABeeZee) is correct.
• Text rendered with the fallback font (Cinema) appears larger/smaller in size.
- Debug Logs:
[Parsed_ass_0 @ 0xb4000079f04f8210] libass API version: 0x1701000
[Parsed_ass_0 @ 0xb4000079f04f8210]
[Parsed_ass_0 @ 0xb4000079f04f8210] libass source: commit: 0.17.1-0-ge8ad72accd3a84268275a9385beb701c9284e5b3
[Parsed_ass_0 @ 0xb4000079f04f8210]
[Parsed_ass_0 @ 0xb4000079f04f8210] Shaper: FriBidi 1.0.13 (SIMPLE) HarfBuzz-ng 8.0.1 (COMPLEX)
[Parsed_ass_0 @ 0xb4000079f04f8210]
[Parsed_ass_0 @ 0xb4000079f04f8210] Using font provider fontconfig
[Parsed_ass_0 @ 0xb4000079f04f8210]
[Parsed_ass_0 @ 0xb4000079f04f8210] Added subtitle file: '/data/***/ass_file.ass' (4 styles, 29 events)
[Parsed_ass_0 @ 0xb4000079f04f8210]
[Parsed_ass_0 @ 0xb4000079f04f8210] fontselect: (ABeeZee, 400, 0) -> /data/***/ABeeZee_regular.ttf, 0, ABeeZee-Regular
[Parsed_ass_0 @ 0xb4000079f04f8210]
[Parsed_ass_0 @ 0xb4000079f04f8210] Glyph 0x633 not found, selecting one more font for (ABeeZee, 400, 0)
[Parsed_ass_0 @ 0xb4000079f04f8210]
[Parsed_ass_0 @ 0xb4000079f04f8210] fontselect: (ABeeZee, 400, 0) -> /data/***/Cinema.ttf, 0, Cinema
Question:
How can I ensure that text rendered with fallback fonts has the same size as the main font? Are there specific settings in FFmpeg or the ASS subtitle format that can address this issue? Alternatively, is there a way to manually adjust the scaling of fallback fonts in FFmpeg?
最新文章
- Windows 10盗版不易?所以在中国普及速度极慢
- AMD、英特尔等开始疏远Windows
- caching - Django: Slow Dashboard with Aggregated Data and Related Models - Stack Overflow
- laravel - User in routesweb.php is not syncronized with User in appHttpControllersAuthControllers.php - Stack Overflow
- PowerShell not reading comment-based help section correctly - Stack Overflow
- python - NaN values in Pandas are not being filled by the interpolate function when it's applied to a full dataframe - S
- c# - Getting "The signature key was not found" error when using JWT Bearer Authentication with Keycloak in ASP
- How to implement GPU memory recycling in CUDA C++ for data streaming in TensorFlow? - Stack Overflow
- c# - After debugging, Visual Studio 2022 holding on to .NET Core program's .dll and I can't complete next build
- windows - Significant 600 ms lag between TwinCAT 3 and Simulink using TCSymbol interface (TE1410). How can I reduce this latency
- r - Conflict between multiple uses of inset_element and function plot_annotation - Stack Overflow
- Stripe Connect, Register fake account on test mode - Stack Overflow
- Need to find a way to change a library (SO file) without reinstalling an application in Android 13 on rooted device. Permission
- dart - I can't read data from ASP.NET Web API into my Flutter App - Stack Overflow
- python - Galaga game not running due to an empty range - Stack Overflow
- azure - Unable to get a token to create B2C user using Graph API - Stack Overflow
- python - How to optimise this simulation of a lottery? - Stack Overflow