Tac
Tac

Reputation: 354

ffmpeg incorrect border width of ass subtitles

This is what i met when burning the subtitle to the video.

Here is the ass code, I have to use 640x360 in resolution:

[Script Info]
; Script generated by Aegisub 3.2.2
; http://www.aegisub.org/
Title: Default Aegisub file
ScriptType: v4.00+
WrapStyle: 0
YCbCr Matrix: None
PlayResX: 640
PlayResY: 360

[Aegisub Project Garbage]
Last Style Storage: Default
Scroll Position: 154
Active Line: 172
Video Position: 10429

[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,Arial,45,&H00FFFFFF,&H000000FF,&H00FF0000,&H00000000,0,0,0,0,100,100,0,0,1,5.125,3.125,2,28,28,16,1

[Events]
Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
Dialogue: 0,0:00:00.94,0:05:12.11,*Default,NTP,0,0,0,,the quick brown dog jumps over the lazy fox.

I usually use MeGUI on Windows (with avs script) to burn. Here is the avs code:

DirectShowSource("C:\Users\xxx\Downloads\test.mp4", fps=25.000, audio=false, convertfps=true).AssumeFPS(25,1)
#deinterlace
#crop
#resize
#denoise

LoadPlugin("C:\Users\xxx\Desktop\megui\tools\avisynth_plugin\VSFilter.dll")
TextSub("C:\Users\xxx\Desktop\ass.ass", 1)

ConvertToYV12()

The subtitle after burning looks like this:

On Windows

However, it is unable to use MeGui on Linux. Thus I used ffmpeg. The command I used is like this:

ffmpeg -i test.mp4 -vf ass=ass.ass -crf 25 -an -f mp4 done.mp4
ffmpeg -i test.mp4 -vf ass=ass.ass:original_size=640x360 -crf 25 -an -f mp4 done.mp4
ffmpeg -i test.mp4 -vf ass=ass.ass:original_size=1920x1080 -crf 25 -an -f mp4 done.mp4
ffmpeg -i test.mp4 -vf subtitles=ass.ass -crf 25 -an -f mp4 done.mp4
ffmpeg -i test.mp4 -vf subtitles=ass.ass:original_size=640x360 -crf 25 -an -f mp4 done.mp4
ffmpeg -i test.mp4 -vf subtitles=ass.ass:original_size=1920x1080 -crf 25 -an -f mp4 done.mp4

However, they all looks like this

Subtitle on Linux

The effect on windows is what I want. How can i get the effect like that on Linux? Thanks!

Upvotes: 0

Views: 2407

Answers (1)

Tac
Tac

Reputation: 354

I just fount it has been solved here, https://github.com/libass/libass/issues/154

just add

ScaledBorderAndShadow: no

on the head of ass file can solve this problem.

It trapped me for a year.

Upvotes: 2

Related Questions