I have an 8bpc .png sequence in RGB color space (full range 0-255 of course) that I need to convert to DNxHD bt709 "legal" range (16-235). Here is where I am so far:

ffmpeg -framerate 23.976 -i input_%04d.png -vcodec dnxhd -b:v 175M outfile.mov

This throws an error: pixel format is incompatible with DNxHD profile. I used to do this all the time in a earlier version of ffmeg with no issue... I assume it has to do with the color space, and in looking through the "colorspace" filter documentation I am uncertain what the proper command would be. As mentioned I do want to actually transform the values to bt709, legal range.

ffmpeg -framerate 24000/1001 -i input_%04d.png -vf format=yuv422p10le -c:v dnxhd -b:v 180M output.mov
  • Use 24000/1001 or ntsc-film instead of the inaccurate 23.976 byname.
  • This encoder only supports the following pixel formats: yuv422p, yuv422p10le, yuv444p10le, gbrp10le. See ffmpeg -h encoder=dnxhd.
  • This encoder only supports specific combinations of bitrate, width, and height. See a list with ffmpeg -f lavfi -i nullsrc -c:v dnxhd -f null -.
  • bt709 should be automatically chosen, but verify it is what you want. See output of ffmpeg -i output.mov.
  • Thanks for the info but when I tried setting the format to yuv422p10le I experience some color shifting, particularly in green, and when sampling the output in a few different applications it is not "clean" in that some values go above and below legal range. From what I've read online "colorspace" seems the best way to handle this I am just unsure of the syntax.
    – Spencer
    Oct 29 '19 at 20:38
  • Ok I did get this monster to work: colorspace=space=bt709:trc=bt709:primaries=bt709:range=tv:format-yuv422p:iall=bt601-6-625 however I am still above/below legal range in some of the channels. Possibly this is due to compression... Anyway my question is what the input characteristics should be? I chose bt610-6-625 arbitrarily, and when I scan my pngs with Exiftool the only metadata I get is "RGB" but not color space. Visually this looks ok, so maybe it is fine?
    – Spencer
    Oct 29 '19 at 20:55
  • PNGs typically are in sRGB colorspace - which has same primaries as bt709, but a different transfer function (gamma) and colorspace.
    – Gyan
    Oct 30 '19 at 6:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.