Search code examples
ffmpegpngflagsmov

Creating dnxhd mov with ffmpeg giving errors


I'm trying to make a create a dnxhd mov with ffmpeg but can't seem to get the codec working.

I've created a 1920x1080 .png to convert into .mov format

My code: (python)

ffmpeg = "C:\\Users\\jared.glass\\Desktop\\mov_test\\ffmpeg_2012_04_02.exe"
images = "C:\\Users\\jared.glass\\Desktop\\mov_test\\Untitled.png"
output = "C:\\Users\\jared.glass\\Desktop\\mov_test\\dnx_hd_test.mov"
os.system(ffmpeg + " -i " + images + " -r 24 -s 1920x1080 -vcodec dnxhd -b:v 120m -an -y " + output )

I get the following error:

Incompatible pixel format 'rgb24' for codec 'dnxhd', auto-selecting format 'yuv4 22p10le' [buffer @ 0000000001D0D950] w:1920 h:1080 pixfmt:rgb24 tb:1/1000000 sar:0/1 sws_ param: [buffersink @ 0000000001D0DB50] auto-inserting filter 'auto-inserted scale 0' be tween the filter 'src' and the filter 'out' [scale @ 0000000001D0DDE0] w:1920 h:1080 fmt:rgb24 sar:0/1 -> w:1920 h:1080 fmt: yuv422p10le sar:0/1 flags:0x4 [dnxhd @ 0000000001D14740] video parameters incompatible with DNxHD Output #0, mov, to 'C:\Users\jared.glass\Desktop\mov_test\dnx_hd_test.mov': Stream #0:0: Video: dnxhd, yuv422p10le, 1920x1080, q=2-1024, 90k tbn, 24 tbc

Stream mapping: Stream #0:0 -> #0:0 (png -> dnxhd) Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

Anyone have any ideas how to get this working?


Solution

  • The DNxHD codec only supports a small number of attribute (bit rate, frame rate, width, height, etc.) combinations. For your selected combination of 24fps frame rate and 1080p resolution, the bit rate should be 115M instead of 120M.