bjjoy
bjjoy

Reputation: 11

Why does ffmpeg burn Chinese subtitles(ass) without word wrap?

my ffmpeg burn subtitle example

ffmpeg burn ass subtitle to mp4. The properties WrapStyle(0:word wrap, 1: the char '\N' or movie edge force change line, 2: only \n and \N change line).

English subtitle run OK. Chinese subtitle has no word wrap when WrapStyle=0.

Upvotes: 1

Views: 1372

Answers (1)

Chortos-2
Chortos-2

Reputation: 1123

Because there are no spaces in the text.

Chinese is commonly written without any space characters between words or sentences. The ASS subtitle format, having been originally designed by and for European language speakers, unfortunately only breaks words on actual space characters. Your subtitle file does not contain any space characters, so the lines are never broken.

Future

To display subtitles, FFmpeg uses another piece of software named libass, and in version 0.17, libass added a special optional mode that properly breaks lines in various situations including Chinese text (see: release announcement, implementation). Existing subtitle files generally rely on the fact that lines are only broken on space characters, so this new mode stays disabled by default. Eventually, FFmpeg’s subtitles filter should gain an option to enable this mode.

Until then, your only option is to add explicit \N into the subtitle text where you want lines to be broken.

Upvotes: 2

Related Questions