2

When burning subtitles into video with ffmpeg and libass, the Arial font is selected by default. How do I choose a font and font size manually? I googled this to no avail. (I'm on OS X if it matters.)

brew install ffmpeg --with-libass
ffmpeg -i video.avi -vf subtitles=subtitle.srt out.avi

ffmpeg version 2.8.3 Copyright (c) 2000-2015 the FFmpeg developers
[Parsed_subtitles_0 @ 0x7fc161421ac0] Shaper: FriBidi 0.19.7 (SIMPLE) HarfBuzz-ng 1.1.2 (COMPLEX)
[Parsed_subtitles_0 @ 0x7fc161421ac0] Using font provider coretext
[Parsed_subtitles_0 @ 0x7fc161421ac0] fontselect: (Arial, 400, 0) -> /Library/Fonts/Microsoft/Arial.ttf, -1, ArialMT
7

Have a look at the subtitles filter options.

Use the force_style option with a font name passed to the ASS FontName parameter to force a different font:

ffmpeg -i video.avi -vf subtitles=subtitle.srt:force_style='FontName=DejaVu Serif' out.avi

You may need to specify a font path with the fontsdir option. This applies if your fonts provider (coretext in your case) does not include the path where your font is installed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.