user19385: I am using FFMPEG in a VFX workflow to convert .png sequences to Avid friendly DNxHD. Today I ran into a situation where a video file I created had quite a bit of banding in Avid when it should not have. Long story short I found that when I'm encoding via FFMPEG it looks quite crappy compared to Adobe Media Encoder or just importing the image sequence straight into Avid. I've double checked that the codec settings are consistent across all encoders, but for whatever reason FFMPEG just looks terrible compared to the other two (banding and compression artifacts).
So my question is if I'm doing something wrong that is limiting the bitrate? I can't see anything wrong with my code and I get no errors. Here's the command I'm using to drive FFMPEG, items in quotation are variables I feed into it:
FFMPEG.exe -y -r 23.976 -start_number "startFrame" -i "inFile" -vcodec dnxhd -b:v 175M -vf colormatrix=bt601:bt709 "outFile"

And here's the output:
2017-07-03 15:32:23:  0: STDOUT: ffmpeg version N-73361-g03b2b40 Copyright (c) 2000-2015 the FFmpeg developers
2017-07-03 15:32:23:  0: STDOUT:   built with gcc 4.9.2 (GCC)
2017-07-03 15:32:23:  0: STDOUT:   configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib
2017-07-03 15:32:23:  0: STDOUT:   libavutil      54. 27.100 / 54. 27.100
2017-07-03 15:32:23:  0: STDOUT:   libavcodec     56. 46.100 / 56. 46.100
2017-07-03 15:32:23:  0: STDOUT:   libavformat    56. 40.100 / 56. 40.100
2017-07-03 15:32:23:  0: STDOUT:   libavdevice    56.  4.100 / 56.  4.100
2017-07-03 15:32:23:  0: STDOUT:   libavfilter     5. 19.100 /  5. 19.100
2017-07-03 15:32:23:  0: STDOUT:   libswscale      3.  1.101 /  3.  1.101
2017-07-03 15:32:23:  0: STDOUT:   libswresample   1.  2.100 /  1.  2.100
2017-07-03 15:32:23:  0: STDOUT:   libpostproc    53.  3.100 / 53.  3.100
2017-07-03 15:32:23:  0: STDOUT: Input #0, image2, from 'INPUT FILE_%04d.png':
2017-07-03 15:32:23:  0: STDOUT:   Duration: 00:00:05.92, start: 0.000000, bitrate: N/A
2017-07-03 15:32:23:  0: STDOUT:     Stream #0:0: Video: png, rgb24(pc), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 25 tbn, 25 tbc
2017-07-03 15:32:23:  0: STDOUT: Output #0, mov, to 'OUTPUT FILE':
2017-07-03 15:32:23:  0: STDOUT:   Metadata:
2017-07-03 15:32:23:  0: STDOUT:     encoder         : Lavf56.40.100
2017-07-03 15:32:23:  0: STDOUT:     Stream #0:0: Video: dnxhd (AVdn / 0x6E645641), yuv422p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-1024, 175000 kb/s, 23.98 fps, 11988 tbn, 23.98 tbc
2017-07-03 15:32:23:  0: STDOUT:     Metadata:
2017-07-03 15:32:23:  0: STDOUT:       encoder         : Lavc56.46.100 dnxhd
2017-07-03 15:32:23:  0: STDOUT: Stream mapping:
2017-07-03 15:32:23:  0: STDOUT:   Stream #0:0 -> #0:0 (png (native) -> dnxhd (native))
2017-07-03 15:32:23:  0: STDOUT: Press [q] to stop, [?] for help
2017-07-03 15:32:24:  0: STDOUT: frame=   11 fps=0.0 q=1.0 size=    9856kB time=00:00:00.45 bitrate=175985.3kbits/s    
2017-07-03 15:32:24:  0: STDOUT: frame=   25 fps= 24 q=1.0 size=   22400kB time=00:00:01.04 bitrate=175984.9kbits/s    
2017-07-03 15:32:25:  0: STDOUT: frame=   39 fps= 25 q=1.0 size=   34944kB time=00:00:01.62 bitrate=175984.7kbits/s    
2017-07-03 15:32:25:  0: STDOUT: frame=   51 fps= 24 q=1.0 size=   45696kB time=00:00:02.12 bitrate=175984.8kbits/s    
2017-07-03 15:32:26:  0: STDOUT: frame=   65 fps= 24 q=1.0 size=   58240kB time=00:00:02.71 bitrate=175984.7kbits/s    
2017-07-03 15:32:27:  0: STDOUT: frame=   79 fps= 25 q=1.0 size=   70784kB time=00:00:03.29 bitrate=175984.7kbits/s    
2017-07-03 15:32:27:  0: STDOUT: frame=   93 fps= 25 q=1.0 size=   83328kB time=00:00:03.87 bitrate=175984.7kbits/s    
2017-07-03 15:32:28:  0: STDOUT: frame=  108 fps= 25 q=1.0 size=   96768kB time=00:00:04.50 bitrate=175984.7kbits/s    
2017-07-03 15:32:28:  0: STDOUT: frame=  122 fps= 25 q=1.0 size=  109312kB time=00:00:05.08 bitrate=175984.7kbits/s    
2017-07-03 15:32:29:  0: STDOUT: frame=  139 fps= 26 q=1.0 size=  124544kB time=00:00:05.79 bitrate=175984.7kbits/s    
2017-07-03 15:32:29:  0: STDOUT: frame=  148 fps= 26 q=1.0 Lsize=  132609kB time=00:00:06.17 bitrate=175986.5kbits/s    
2017-07-03 15:32:29:  0: STDOUT: video:132608kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.001087%

The codec settings are Avid DNxHD 175, 23.976, 8bpc.
Before:

After:

Any ideas?

user-1: You get banding because of colormatrix filter. Better use colorspace filter, and use it if really needed, when source is really not in rec709.

19385: <p>I am using FFMPEG in a VFX workflow to convert .png sequences to Avid friendly DNxHD. Today I ran into a situation where a video file I created had quite a bit of banding in Avid when it should not have. Long story short I found that when I'm encoding via FFMPEG it looks quite crappy compared to Adobe Media Encoder or just importing the image sequence straight into Avid. I've double checked that the codec settings are consistent across all encoders, but for whatever reason FFMPEG just looks terrible compared to the other two (banding and compression artifacts).</p>

<p>So my question is if I'm doing something wrong that is limiting the bitrate? I can't see anything wrong with my code and I get no errors. Here's the command I'm using to drive FFMPEG, items in quotation are variables I feed into it:</p>

<pre><code>FFMPEG.exe -y -r 23.976 -start_number "startFrame" -i "inFile" -vcodec dnxhd -b:v 175M -vf colormatrix=bt601:bt709 "outFile"
</code></pre>

<p>And here's the output:</p>

<pre><code>2017-07-03 15:32:23:  0: STDOUT: ffmpeg version N-73361-g03b2b40 Copyright (c) 2000-2015 the FFmpeg developers
2017-07-03 15:32:23:  0: STDOUT:   built with gcc 4.9.2 (GCC)
2017-07-03 15:32:23:  0: STDOUT:   configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib
2017-07-03 15:32:23:  0: STDOUT:   libavutil      54. 27.100 / 54. 27.100
2017-07-03 15:32:23:  0: STDOUT:   libavcodec     56. 46.100 / 56. 46.100
2017-07-03 15:32:23:  0: STDOUT:   libavformat    56. 40.100 / 56. 40.100
2017-07-03 15:32:23:  0: STDOUT:   libavdevice    56.  4.100 / 56.  4.100
2017-07-03 15:32:23:  0: STDOUT:   libavfilter     5. 19.100 /  5. 19.100
2017-07-03 15:32:23:  0: STDOUT:   libswscale      3.  1.101 /  3.  1.101
2017-07-03 15:32:23:  0: STDOUT:   libswresample   1.  2.100 /  1.  2.100
2017-07-03 15:32:23:  0: STDOUT:   libpostproc    53.  3.100 / 53.  3.100
2017-07-03 15:32:23:  0: STDOUT: Input #0, image2, from 'INPUT FILE_%04d.png':
2017-07-03 15:32:23:  0: STDOUT:   Duration: 00:00:05.92, start: 0.000000, bitrate: N/A
2017-07-03 15:32:23:  0: STDOUT:     Stream #0:0: Video: png, rgb24(pc), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 25 tbn, 25 tbc
2017-07-03 15:32:23:  0: STDOUT: Output #0, mov, to 'OUTPUT FILE':
2017-07-03 15:32:23:  0: STDOUT:   Metadata:
2017-07-03 15:32:23:  0: STDOUT:     encoder         : Lavf56.40.100
2017-07-03 15:32:23:  0: STDOUT:     Stream #0:0: Video: dnxhd (AVdn / 0x6E645641), yuv422p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-1024, 175000 kb/s, 23.98 fps, 11988 tbn, 23.98 tbc
2017-07-03 15:32:23:  0: STDOUT:     Metadata:
2017-07-03 15:32:23:  0: STDOUT:       encoder         : Lavc56.46.100 dnxhd
2017-07-03 15:32:23:  0: STDOUT: Stream mapping:
2017-07-03 15:32:23:  0: STDOUT:   Stream #0:0 -&gt; #0:0 (png (native) -&gt; dnxhd (native))
2017-07-03 15:32:23:  0: STDOUT: Press [q] to stop, [?] for help
2017-07-03 15:32:24:  0: STDOUT: frame=   11 fps=0.0 q=1.0 size=    9856kB time=00:00:00.45 bitrate=175985.3kbits/s    
2017-07-03 15:32:24:  0: STDOUT: frame=   25 fps= 24 q=1.0 size=   22400kB time=00:00:01.04 bitrate=175984.9kbits/s    
2017-07-03 15:32:25:  0: STDOUT: frame=   39 fps= 25 q=1.0 size=   34944kB time=00:00:01.62 bitrate=175984.7kbits/s    
2017-07-03 15:32:25:  0: STDOUT: frame=   51 fps= 24 q=1.0 size=   45696kB time=00:00:02.12 bitrate=175984.8kbits/s    
2017-07-03 15:32:26:  0: STDOUT: frame=   65 fps= 24 q=1.0 size=   58240kB time=00:00:02.71 bitrate=175984.7kbits/s    
2017-07-03 15:32:27:  0: STDOUT: frame=   79 fps= 25 q=1.0 size=   70784kB time=00:00:03.29 bitrate=175984.7kbits/s    
2017-07-03 15:32:27:  0: STDOUT: frame=   93 fps= 25 q=1.0 size=   83328kB time=00:00:03.87 bitrate=175984.7kbits/s    
2017-07-03 15:32:28:  0: STDOUT: frame=  108 fps= 25 q=1.0 size=   96768kB time=00:00:04.50 bitrate=175984.7kbits/s    
2017-07-03 15:32:28:  0: STDOUT: frame=  122 fps= 25 q=1.0 size=  109312kB time=00:00:05.08 bitrate=175984.7kbits/s    
2017-07-03 15:32:29:  0: STDOUT: frame=  139 fps= 26 q=1.0 size=  124544kB time=00:00:05.79 bitrate=175984.7kbits/s    
2017-07-03 15:32:29:  0: STDOUT: frame=  148 fps= 26 q=1.0 Lsize=  132609kB time=00:00:06.17 bitrate=175986.5kbits/s    
2017-07-03 15:32:29:  0: STDOUT: video:132608kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.001087%
</code></pre>

<p>The codec settings are Avid DNxHD 175, 23.976, 8bpc.</p>

<p>Before:
<a href="https://i.stack.imgur.com/WMGrS.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WMGrS.jpg" alt="Before transcode"></a>
After:
<a href="https://i.stack.imgur.com/0OFWZ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0OFWZ.jpg" alt="After transcode"></a></p>

<p>Any ideas?</p>
 -1: <p>You get banding because of colormatrix filter. Better use colorspace filter, and use it if really needed, when source is really not in rec709.</p>
