<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.sstatic.net/uwr0F.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/uwr0F.png" alt="gold on blue" /></a></p>

CC BY-SA 4.0
2022-03-08T08:42:04.320Z
2022-03-08T08:42:04.320Z
Marnanel Thurman
<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.sstatic.net/sc8DU.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/sc8DU.png" alt="black text on dark red" /></a></p>

<ffmpeg><subtitles>
How can I set the colours in libass subtitles?
Marnanel Thurman
# How can I set the colours in libass subtitles?

(Asked by: username_0 on 2022-03-08)

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:

**Tags:** ffmpeg, subtitles


---

## 1 answers

### Answer by username_0 on 2022-03-08. Score: 2

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


---

