我正在尝试使用 ffmpeg 将 ASS 字幕文件刻录到视频上。这是 ASS 文件的样式部分:
[Script Info]
; Script generated by FFmpeg/Lavc60.3.100
ScriptType: v4.00+
PlayResX: 384
PlayResY: 288
ScaledBorderAndShadow: yes
YCbCr Matrix: None
[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: Dialog,"Dast Nevis",24,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,1,2,0,2,10,10,20,1
尽管系统中 ~/Library/Fonts 下有“Dast Nevis”字体,但 ffmpeg 找不到它。这是我使用的 ffmpeg 命令:
ffmpeg -i geler-1080p.mp4 -vf "ass=geler.ass" -ss 10 -t 10 test.mp4
以下是部分输出:
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[Parsed_ass_0 @ 0x7fd45730c680] libass API version: 0x1701000
[Parsed_ass_0 @ 0x7fd45730c680] libass source: tarball: 0.17.1
[Parsed_ass_0 @ 0x7fd45730c680] Shaper: FriBidi 1.0.12 (SIMPLE) HarfBuzz-ng 8.3.0 (COMPLEX)
[Parsed_ass_0 @ 0x7fd45730c680] Using font provider coretext
[Parsed_ass_0 @ 0x7fd45730c680] Added subtitle file: 'geler.ass' (2 styles, 64 events)
[Parsed_ass_0 @ 0x7fd45730c680] fontselect: ("Dast Nevis", 400, 0) -> /System/Library/Fonts/Helvetica.ttc, -1, Helvetica
[Parsed_ass_0 @ 0x7fd45730c680] Glyph 0x62E not found, selecting one more font for ("Dast Nevis", 400, 0)
[Parsed_ass_0 @ 0x7fd45730c680] fontselect: ("Dast Nevis", 400, 0) -> /System/Library/Fonts/GeezaPro.ttc, -1, GeezaPro
显然没有找到该字体,但是为什么呢?