user37258: 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:


user37258: 
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).

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

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



37258: <p>ffmpeg allows you to pass parameters through to the subtitling library, libass. For example:</p>
<pre><code># this is wrong
# 0057b8=blue, ffd700=gold
ffmpeg -i original.mp4 -vf &quot;subtitles=russian.srt:force_style='Fontname=Gill\ Sans\ MT,Fontsize=20,borderstyle=3,outline=3,OutlineColour=0057b8,PrimaryColour=ffd700'&quot; -y rc1.mp4
</code></pre>
<p>If you try to set the colours, you will probably get them wrong on the first attempt:</p>
<p><a href="https://i.stack.imgur.com/sc8DU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sc8DU.png" alt="black text on dark red" /></a></p>
 37258: <ol>
<li><p>The colour format used by libass is <a href="http://www.tcax.org/docs/ass-specs.htm" rel="nofollow noreferrer">really weird</a>: <code>&amp;HAABBGGRR</code> (alpha, blue, green, red). This is backwards from the standard web ordering, <code>&amp;HRRGGBBAA</code> (red, blue, green).</p>
</li>
<li><p>The alpha is inverted: <code>00</code> is fully opaque, and <code>FF</code> is fully transparent.</p>
</li>
<li><p>You <em>have</em> to spell it the British way. <code>PrimaryColor</code> and <code>OutlineColor</code> will fail without an error.</p>
</li>
</ol>
<p>The correct form of the command line above is</p>
<pre><code>ffmpeg -i original.mp4 -vf &quot;subtitles=russian.srt:force_style='Fontname=Gill\ Sans\ MT,Fontsize=20,borderstyle=3,outline=3,OutlineColour=&amp;H00b85700,PrimaryColour=&amp;H0000d7ff'&quot; -y rc1.mp4
</code></pre>
<p><a href="https://i.stack.imgur.com/uwr0F.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uwr0F.png" alt="gold on blue" /></a></p>
