GNOME Bugzilla – Bug 574725
avenc_dnxhd: Undocumented restrictions to width/height/framerate/bitrate settings
Last modified: 2018-11-03 12:55:05 UTC
Hi, ffenc_dnxhd only allows some very restrictive width/height/framerate/bitrate settings, see libavcodec/dnxhddata.c the ff_dnxhd_cid_table. We should document this and specify this in the caps and tell the ffmpeg people to simply choose the nearest possible bitrate instead or requiring a bitrate the exactly fits with the width/height/framerate combination.
The allowed profiles are listed also on http://itbroadcastanddigitalcinema.com/ffmpeg_howto.html#Encoding_VC-3
https://roundup.ffmpeg.org/roundup/ffmpeg/issue909
Actually... the dnxhd AVCodec has the proper PixFmt in pix_fmts. The code in gstffmpegenc's getcaps implementation was slightly wrong in that regards, I've got a patch for that in #575545 Then it would only leave the bitrate issue.
Does it also have the correct width/height/framerate combinations?
where ? in ffmpeg, no in gst-ffmpeg, we only hardcode the width/height (currently to 1920x1080). We could add the various 'exact' combinations. Only the following combinations seem acceptable: * 1920x1080 interlaced : 30000/1001 and 25/1 * 1920x1080 progressive : 24000/10001, 24, 25, 30000/1001 * 1280x720 progressive : 24000/1001, 25, 60000/1001 (yes, really)
Ok, sounds good then :)
Hm, there's even more interesting stuff :) if (buf_size < ctx->cid_table->frame_size) { av_log(avctx, AV_LOG_ERROR, "output buffer is too small to compress picture\n"); return -1; } And this actually happens...
*** Bug 580573 has been marked as a duplicate of this bug. ***
Noticed that 575545 has been closed and fixed. What is remaining on this one?
The framerate restrictions are not there yet and the interesting frame_size/buf_size restriction is not handled either.
The input format and width/height restrictions seem to be there now: Capabilities: video/x-raw width: 1920 height: 1080 framerate: [ 0/1, 2147483647/1 ] format: { Y42B, I422_10LE } video/x-raw width: 1280 height: 720 framerate: [ 0/1, 2147483647/1 ] format: { Y42B, I422_10LE } What's missing: - for 1280x720 only progressive is allowed - does libav provide this info? - framerates? (no restrictions provided it seems?) - anything else?
libav doesn't provide any information on top of these, and apparently the restrictions are even more complicated than what Edward mentioned in comment #5. For there are a few width/height/depth/interlacedness combinations that are allowed, and for each of these only a fixed number of bitrates is allowed. I don't see any framerate restrictions in the code. Not sure what to do about this
We really need to be able to query libav on what input formats are accepted for a specific formats. Otherwise we'll just end up copying again-and-again everything.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-libav/issues/2.