1

ffmpeg allows you to pass parameters through to the subtitling library, libass. For example:

# this is wrong
# 0057b8=blue, ffd700=gold
ffmpeg -i original.mp4 -vf "subtitles=russian.srt:force_style='Fontname=Gill\ Sans\ MT,Fontsize=20,borderstyle=3,outline=3,OutlineColour=0057b8,PrimaryColour=ffd700'" -y rc1.mp4

If you try to set the colours, you will probably get them wrong on the first attempt:

black text on dark red

1 Answer 1

2
  1. The colour format used by libass is really weird: &HAABBGGRR (alpha, blue, green, red). This is backwards from the standard web ordering, &HRRGGBBAA (red, blue, green).

  2. The alpha is inverted: 00 is fully opaque, and FF is fully transparent.

  3. You have to spell it the British way. PrimaryColor and OutlineColor will fail without an error.

The correct form of the command line above is

ffmpeg -i original.mp4 -vf "subtitles=russian.srt:force_style='Fontname=Gill\ Sans\ MT,Fontsize=20,borderstyle=3,outline=3,OutlineColour=&H00b85700,PrimaryColour=&H0000d7ff'" -y rc1.mp4

gold on blue

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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