Answers.Body: <p>Yes, as it says a couple of lines above, <code>colormatrix supports only 8bpc (8-bit per component) pixel formats</code>. So, when a 16-bit input is filtered with colormatrix, it will be converted to 8-bits. And won't get converted back to 16-bit unless manually done or auto-converted due to output encoder limitations. But that's pointless anyway, as the precision has been lost.</p>
  
  <p>Use the colorspace filter.</p>
  
  <pre><code>-vf colorspace=all=bt709:range=tv:format=yuv422p10:iall=bt601:irange=tv
  </code></pre>
  
  <p>Depending on your use case, format may need to be <code>yuv444p10</code>. Depending in your input, irange may need to be <code>pc</code>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-05T17:38:48.223Z
Answers.Text: Sorry, it's `bt601-6-525` for NTSC or `bt601-6-625` for PAL.
Answers.UserDisplayName: Gyan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-06T05:30:02.310Z
Answers.Text: Yep I'm noticing `colormatrix` vs `colorspace` in 10bit encodes.  The `colormatrix` conversions all look noisier in gradients.  It's not hugely perceptible to the naked eye but I can see it while boosting/enhancing a still frame.  But the other detriment is that the added noise of `colormatrix` was making the prores file bigger by roughly 35% for even less quality.
Answers.UserDisplayName: Shao Zhang
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-04T04:57:13.743Z
Answers.LastActivityDate: 2019-08-04T04:57:13.743Z
Answers.UserDisplayName: Gyan
Body: <p>Unless I'm bad at reading, this page states that colormatrix is only good for 8 bpc.</p>
  
  <p>From <a href="https://trac.ffmpeg.org/wiki/colorspace" rel="nofollow noreferrer">Colorspace support in FFmpeg</a>:</p>
  
  <blockquote>
    <p>... colormatrix produces horrible quality for anything > 8bpc (8-bit per component)</p>
  </blockquote>
  
  <p>Backstory.  One of my typical workflows is to convert 16bit tiffs and 10bit DPX frames into 10bit prores.  However, I think the input colorspace of the frames is assumed to be bt601 and I would always get encodes that looks just slightly off from my originals.  I solved this by adding:</p>
  
  <p><code>-vf colormatrix=bt601:bt709</code></p>
  
  <p>And it looks fine visually.  The difference between the source and encode I always just assumed was the lossy compression.</p>
  
  <p>So can someone chime in on if the <code>colormatrix=bt601:bt709</code> operation is 'supposed' to be bad when the source and encode are >10bpc?  Or is the info on that page outdated?  Or should I be doing it a different way?</p>
  
Tags: <ffmpeg><prores><colorspace>
Title: ffmpeg colormatrix operations only for 8bpc?
UserDisplayName: Shao Zhang
ThreadText: # ffmpeg colormatrix operations only for 8bpc?
  
  (Asked by: username_0 on 2019-08-03)
  
  Unless I'm bad at reading, this page states that colormatrix is only good for 8 bpc.
  
  From [Colorspace support in FFmpeg](https://trac.ffmpeg.org/wiki/colorspace):
  
  > ... colormatrix produces horrible quality for anything > 8bpc (8-bit per component)
  
  Backstory. One of my typical workflows is to convert 16bit tiffs and 10bit DPX frames into 10bit prores. However, I think the input colorspace of the frames is assumed to be bt601 and I would always get encodes that looks just slightly off from my originals. I solved this by adding:
  
  `-vf colormatrix=bt601:bt709`
  
  And it looks fine visually. The difference between the source and encode I always just assumed was the lossy compression.
  
  So can someone chime in on if the `colormatrix=bt601:bt709` operation is 'supposed' to be bad when the source and encode are >10bpc? Or is the info on that page outdated? Or should I be doing it a different way?
  
  **Tags:** ffmpeg, prores, colorspace
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-08-04. Score: 1 | Accepted answer
  
  Yes, as it says a couple of lines above, `colormatrix supports only 8bpc (8-bit per component) pixel formats`. So, when a 16-bit input is filtered with colormatrix, it will be converted to 8-bits. And won't get converted back to 16-bit unless manually done or auto-converted due to output encoder limitations. But that's pointless anyway, as the precision has been lost.
  
  Use the colorspace filter.
  
  ```
  -vf colorspace=all=bt709:range=tv:format=yuv422p10:iall=bt601:irange=tv
  
  ```
  
  Depending on your use case, format may need to be `yuv444p10`. Depending in your input, irange may need to be `pc`.
  
  > **Comments:**
  > **username_1**: Sorry, it's `bt601-6-525` for NTSC or `bt601-6-625` for PAL.  
  > **username_0**: Yep I'm noticing `colormatrix` vs `colorspace` in 10bit encodes.  The `colormatrix` conversions all look noisier in gradients.  It's not hugely perceptible to the naked eye but I can see it while boosting/enhancing a still frame.  But the other detriment is that the added noise of `colormatrix` was making the prores file bigger by roughly 35% for even less quality.  
  
  ---
  
  