title: How to use FFmpeg Colorspace Options
body: <p>I'm trying to understand the difference between Colorspace <a href="https://ffmpeg.org" rel="noreferrer">FFmpeg</a> arguments:</p>
  <ul>
  <li>Normal option, <code>-colorspace bt709</code></li>
  <li>Number, <code>-colorspace 1</code></li>
  <li>Codec Params <code>-x264-params &quot;colorspace=bt709&quot;</code></li>
  <li>Filter <code>-vf &quot;colorspace=bt709&quot;</code></li>
  </ul>
  <p>The Colorspace categories are:</p>
  <ul>
  <li><code>all</code></li>
  <li><code>iall</code></li>
  <li><code>colorspace</code></li>
  <li><code>transfer</code></li>
  <li><code>primaries</code></li>
  <li><code>color range</code></li>
  <li><code>color matrix</code></li>
  </ul>
  <hr />
  <h3>Question</h3>
  <p>When should each be used when encoding from raw, or transcoding/converting from one format to another? Such as <code>mpg</code> to <code>mp4</code>.</p>
  <p>Do I need to specify the input colorspace or will FFmpeg auto-detect?</p>
  <hr />
  <h3>Problems</h3>
  <p>There is no <code>-vp8-params</code>, only <code>-x264-params</code>. Should I use <code>normal options</code> or <code>-vf</code> instead for <code>vp8</code> and other codecs?</p>
  <hr />
  <h3>Errors</h3>
  <ul>
  <li><p>There are no <strong>Normal</strong> <code>-all</code> or <code>-colormatrix</code> options, but there are <code>all=</code> and <code>colormatrix=</code> for <code>-x264-params</code> and <code>-vf</code>.</p>
  </li>
  <li><p>With <strong>Codec Params</strong> <code>-x264-params &quot;colorspace=bt709&quot;</code>, I get <code>Error parsing option 'colorspace = bt709'.</code><br />
  However <code>colorprim=bt709</code>, <code>transfer=bt709</code>, <code>colormatrix=bt709</code> all work.</p>
  </li>
  </ul>
  <hr />
  <h3>Resources</h3>
  <p><a href="https://ffmpeg.org/ffmpeg-filters.html#colormatrix" rel="noreferrer">https://ffmpeg.org/ffmpeg-filters.html#colormatrix</a><br />
  <a href="https://ffmpeg.org/ffmpeg-filters.html#colorspace" rel="noreferrer">https://ffmpeg.org/ffmpeg-filters.html#colorspace</a><br />
  <a href="https://trac.ffmpeg.org/wiki/colorspace" rel="noreferrer">https://trac.ffmpeg.org/wiki/colorspace</a></p>