<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.sstatic.net/WMGrS.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/WMGrS.jpg" alt="Before transcode"></a>
After:
<a href="https://i.sstatic.net/0OFWZ.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/0OFWZ.jpg" alt="After transcode"></a></p>

<p>Any ideas?</p>

CC BY-SA 3.0
2017-07-04T05:21:14.757Z
First step is to always use a recent `ffmpeg`: yours is old. You can find links to static builds for Linux, macOS, or Windows at the [FFmpeg Download page](http://ffmpeg.org/download.html). Change `-r 23.976` to `-framerate 24000/1001` or `-framerate ntsc-film`. Show info from an AME produced DNxHD file so we can compare.
llogan
CC BY-SA 3.0
2017-07-04T21:15:11.967Z
Thanks for the comment, I did try the newest ffmpeg (latest build as of yesterday) and got the exact same results. Why change the framerate? I'll give it a shot but I can't see why that would make a difference. What AME info do you need?
Spencer
CC BY-SA 3.0
2017-07-05T00:05:57.777Z
The frame rate stuff is unrelated but I thought I would point it out anyway. The image format demuxer uses `-framerate` instead of `-r`. IIRC, there are some practical differences. 23.976 is not accurate if you want "NTSC film" frame rate. For such a short input is doesn't make a difference, but over time you can end up with fewer frames with the approximated value. The output of `ffmpeg -i input` will show info, and `ffprobe -loglevel error -show_streams -show_format input` will provide more details.
llogan
CC BY-SA 3.0
2017-07-07T03:26:38.610Z
Our editing department works at 175, rec709 (hence the color matrix). I edited my post with a sample image before and after, the before I roughly matched to rec709 with just a levels adjustment.
Spencer
<ffmpeg><conversion><bitrate>
FFMPEG to convert img seq to DNxHD - BANDING
Spencer
# FFMPEG to convert img seq to DNxHD - BANDING

(Asked by: username_0 on 2017-07-03)

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?

**Tags:** ffmpeg, conversion, bitrate

> **Comments:**
> **username_1**: First step is to always use a recent `ffmpeg`: yours is old. You can find links to static builds for Linux, macOS, or Windows at the [FFmpeg Download page](http://ffmpeg.org/download.html). Change `-r 23.976` to `-framerate 24000/1001` or `-framerate ntsc-film`. Show info from an AME produced DNxHD file so we can compare.  
> **username_0**: Thanks for the comment, I did try the newest ffmpeg (latest build as of yesterday) and got the exact same results. Why change the framerate? I'll give it a shot but I can't see why that would make a difference. What AME info do you need?  
> **username_1**: The frame rate stuff is unrelated but I thought I would point it out anyway. The image format demuxer uses `-framerate` instead of `-r`. IIRC, there are some practical differences. 23.976 is not accurate if you want "NTSC film" frame rate. For such a short input is doesn't make a difference, but over time you can end up with fewer frames with the approximated value. The output of `ffmpeg -i input` will show info, and `ffprobe -loglevel error -show_streams -show_format input` will provide more details.  
> **username_0**: Our editing department works at 175, rec709 (hence the color matrix). I edited my post with a sample image before and after, the before I roughly matched to rec709 with just a levels adjustment.  

---

## 0 answers

