user16152: We are converting a sequence of DPX files into an MP4. When the artist uses Adobe Media Encoder CC to generate the video, the colors match the original DPX. When we use ffmpeg, the video has a reddish hint. The command used is:
ffmpeg -y -start_number 0101 -i \\path\to\filename.%04d.dpx -pix_fmt yuv420p sample.mp4

How can we generate a video that matches the color of the original DPX files?

Inspecting the files with ffprobe revealed the following differences (correct file/bad file):

major_brand: mp42 / isom
minor_version: 0 / 512
compatible_brands: mp42mp41 / isomiso2avc1mp41
encoder: not listed / Lavf57.34.102
Video: h264 (Main) / h264 (High)
Video: yuv420p(tv, bt709) / yuv420p
Video: 1920x1080 / 1920x1080 [SAR 1:1 DAR 16:9]
handler_name: Alias Data Handler / VideoHandler

Probe references: dpx, correct, incorrect

user16152: I followed up on the yuv420p(tv, bt709) portion of the encoding and discovered that this refers to the Rec. 709 colorspace for HDTV. In ffmpeg, colorspace is defined by the colormatrix filter. However, you must convert from some colorspace. According to an ffmpeg mailing list conversation, the default colorspace is assumed to be bt601:

ISTR that if you give ffmpeg RGB it assumes its full range, it also by
  default converts using 601 matrices. Although it has a number of
  colourspaces defined which can be accessed in the libs using the API,
  ffmpeg itself makes no use of them (Although I have a nagging feeling
  that that may not be completely true anymore either).

So the final ffmpeg command that worked was:
ffmpeg -y -start_number 0101 -i \\path\to\filename.%04d.dpx
-vf colormatrix=bt601:bt709 -pix_fmt yuv420p sample.mp4

The color is now correct, but there is no discernible difference in the output from ffprobe or MediaInfo. (In other words, the colorspace of the ffmpeg-generated file does not appear in the output.)

16152: <p>We are converting a sequence of DPX files into an MP4. When the artist uses Adobe Media Encoder CC to generate the video, the colors match the original DPX. When we use ffmpeg, the video has a reddish hint. The command used is:</p>

<pre><code>ffmpeg -y -start_number 0101 -i \\path\to\filename.%04d.dpx -pix_fmt yuv420p sample.mp4
</code></pre>

<p>How can we generate a video that matches the color of the original DPX files?</p>

<hr>

<p>Inspecting the files with <code>ffprobe</code> revealed the following differences (correct file/bad file):</p>

<ul>
<li>major_brand: mp42 / isom</li>
<li>minor_version: 0 / 512</li>
<li>compatible_brands: mp42mp41 / isomiso2avc1mp41</li>
<li>encoder: not listed / Lavf57.34.102</li>
<li>Video: h264 (Main) / h264 (High)</li>
<li>Video: yuv420p(tv, bt709) / yuv420p</li>
<li>Video: 1920x1080 / 1920x1080 [SAR 1:1 DAR 16:9]</li>
<li>handler_name: Alias Data Handler / VideoHandler</li>
</ul>

<p>Probe references: <a href="https://gist.github.com/kwill/a6e8df2268d6e09e20c2e31f18081e13" rel="nofollow">dpx</a>, <a href="https://gist.github.com/kwill/832da451eab85d7d55eb737840629d0f" rel="nofollow">correct</a>, <a href="https://gist.github.com/kwill/182e0f504c8049a346bae0f871b42705" rel="nofollow">incorrect</a></p>
 16152: <p>I followed up on the <code>yuv420p(tv, bt709)</code> portion of the encoding and discovered that this refers to the <a href="https://en.wikipedia.org/wiki/Rec._709" rel="nofollow">Rec. 709</a> colorspace for HDTV. In ffmpeg, colorspace is defined by the <a href="https://ffmpeg.org/ffmpeg-filters.html#colormatrix" rel="nofollow">colormatrix filter</a>. However, you must convert <em>from</em> some colorspace. According to <a href="http://ffmpeg-users.933282.n4.nabble.com/convert-from-bt601-to-bt709-td4665658.html" rel="nofollow">an ffmpeg mailing list conversation</a>, the default colorspace is assumed to be <code>bt601</code>:</p>

<blockquote>
  <p>ISTR that if you give ffmpeg RGB it assumes its full range, it also by
  default converts using 601 matrices. Although it has a number of
  colourspaces defined which can be accessed in the libs using the API,
  ffmpeg itself makes no use of them (Although I have a nagging feeling
  that that may not be completely true anymore either).</p>
</blockquote>

<p>So the final ffmpeg command that worked was:</p>

<pre><code>ffmpeg -y -start_number 0101 -i \\path\to\filename.%04d.dpx
-vf colormatrix=bt601:bt709 -pix_fmt yuv420p sample.mp4
</code></pre>

<p>The color is now correct, but there is no discernible difference in <a href="https://gist.github.com/kwill/088afc643ea9d93fa2a0019db12487fa" rel="nofollow">the output from ffprobe</a> or MediaInfo. (In other words, the colorspace of the ffmpeg-generated file does not appear in the output.)</p>
