Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-03-08T08:42:04.320Z
Answers.LastActivityDate: 2022-03-08T08:42:04.320Z
Answers.UserDisplayName: Marnanel Thurman
Body: <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>
  
Tags: <ffmpeg><subtitles>
Title: How can I set the colours in libass subtitles?
UserDisplayName: Marnanel Thurman
ThreadText: # 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:
  
  [![black text on dark red](https://i.sstatic.net/sc8DU.png)](https://i.sstatic.net/sc8DU.png)
  
  **Tags:** ffmpeg, subtitles
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2022-03-08. Score: 2
  
  1. The colour format used by libass is [really weird](http://www.tcax.org/docs/ass-specs.htm): `&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](https://i.sstatic.net/uwr0F.png)](https://i.sstatic.net/uwr0F.png)
  
  
  ---
  
  