Opened 5 years ago

Last modified 4 years ago

#8088 new enhancement

FFmpeg allows DNxHD 175x, but not DNxHD 350x

Reported by: clawsoon Owned by:
Priority: wish Component: avcodec
Version: git-master Keywords: dnxhd
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

In the Wikipedia list of DNxHD codecs, 175x and 350x are similar except that 350x uses 4:4:4 and runs at 352Mbps, while 175x uses 4:2:2 and runs at 176Mbps. Both are 10 bit.

It is possible to create an 8-bit DNxHD 175 with a command line like this:

ffmpeg.exe -r 24000/1001 -i [input frames] -r 24000/1001 -c:v dnxhd -pix_fmt yuv422p -b:v 175M [output movie]

It is possible to create a 10-bit DNxHD 175x with a command line like this:

ffmpeg.exe -r 24000/1001 -i [input frames] -r 24000/1001 -c:v dnxhd -pix_fmt yuv422p10 -b:v 175M [output movie]

However, a 10-bit DNxHD 350x fails:

ffmpeg.exe -r 24000/1001 -i [input frames] -r 24000/1001 -c:v dnxhd -pix_fmt yuv444p10 -b:v 350M [output movie]
...
[dnxhd @ 0000024cade3fec0] pixel format is incompatible with DNxHD profile
[dnxhd @ 0000024cadde5840] ff_frame_thread_encoder_init failed
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

The error comes from this bit of code, which, if I'm reading it correctly, says that 4:4:4 is only available in the dnxhr_444 profile:

if ((ctx->profile == FF_PROFILE_DNXHR_444 && (avctx->pix_fmt != AV_PIX_FMT_YUV444P10 &&

avctx->pix_fmt != AV_PIX_FMT_GBRP10))
(ctx->profile != FF_PROFILE_DNXHR_444 && (avctx->pix_fmt == AV_PIX_FMT_YUV444P10

avctx->pix_fmt == AV_PIX_FMT_GBRP10))) {

av_log(avctx, AV_LOG_ERROR,

"pixel format is incompatible with DNxHD profile\n");

return AVERROR(EINVAL);

}

I believe (though I'm not 100% certain) that this is incorrect; both 350x and 365x, which are DNxHD codecs, not DNxHR codecs, should support 4:4:4.

Thanks.

Andrew

Attachments (5)

BarsDNxHD350x1frame.mov (1.8 MB ) - added by clawsoon 5 years ago.
DNxHD 350x 4:4:4 23.976 10-bit
BarsDNxHD350x.rar (16.9 KB ) - added by clawsoon 5 years ago.
DNxHD 350x 4:4:4 23.976 10-bit - 1 second - rar
BarsDNxHD350x24fps.rar (17.1 KB ) - added by clawsoon 5 years ago.
DNxHD 350x 4:4:4 24fps 10-bit
BarsDNxHD365x25fps.rar (17.3 KB ) - added by clawsoon 5 years ago.
DNxHD 365x 4:4:4 25fps 10-bit
BarsDNxHD440x2997fps.rar (17.7 KB ) - added by clawsoon 5 years ago.
DNxHD 440x 4:4:4 29.97fps 10-bit

Download all attachments as: .zip

Change History (11)

in reply to:  description comment:1 by Carl Eugen Hoyos, 5 years ago

Component: undeterminedavcodec
Keywords: dnxhd added
Priority: normalwish
Version: unspecifiedgit-master

Replying to clawsoon:

both 350x and 365x, which are DNxHD codecs, not DNxHR codecs, should support 4:4:4.

Please provide such samples.

comment:2 by clawsoon, 5 years ago

I'll see if I can hunt someone down with an Avid (hopefully in the next couple of days). Would color bars be sufficient, or would you need a more complex movie than that?

comment:3 by Carl Eugen Hoyos, 5 years ago

The simpler and shorter the better.

by clawsoon, 5 years ago

Attachment: BarsDNxHD350x1frame.mov added

DNxHD 350x 4:4:4 23.976 10-bit

by clawsoon, 5 years ago

Attachment: BarsDNxHD350x.rar added

DNxHD 350x 4:4:4 23.976 10-bit - 1 second - rar

comment:4 by clawsoon, 5 years ago

Let me know if those samples are okay. I didn't realize they would compress so well with rar, so I first uploaded a single frame because that's all that would fit in the 2.5MB upload limit.

by clawsoon, 5 years ago

Attachment: BarsDNxHD350x24fps.rar added

DNxHD 350x 4:4:4 24fps 10-bit

by clawsoon, 5 years ago

Attachment: BarsDNxHD365x25fps.rar added

DNxHD 365x 4:4:4 25fps 10-bit

by clawsoon, 5 years ago

Attachment: BarsDNxHD440x2997fps.rar added

DNxHD 440x 4:4:4 29.97fps 10-bit

comment:5 by clawsoon, 5 years ago

These were all generated in Avid from a 23.976 base project. I notice that the time bases are a little weird, e.g. 959/23976 for the 25fps clip, probably because they came from a 23.976 project. Presumably Avid is the source of truth for this codec, though, so I'm not going to argue with that.

An official source for the codec list is here:

https://www.avid.com/static/resources/US/documents/dnxhd.pdf

Last edited 5 years ago by clawsoon (previous) (diff)

comment:6 by Jon Frydensbjerg, 4 years ago

We hit this one today, as well. Thanks for doing the research and reporting this, clawsoon. Saves me some work. :)

Note: See TracTickets for help on using tickets.