Opened 7 years ago
Last modified 3 years ago
#6475 open defect
NVENC: -coder 0 parameter produces no error, but does not disable CABAC
Reported by: | alexpigment | Owned by: | |
---|---|---|---|
Priority: | important | Component: | avcodec |
Version: | git-master | Keywords: | nvenc |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
Summary of the bug:
When using h264_nvenc, if -coder 0 is specified in command line, no errors or warnings are given, yet the resulting video still uses CABAC. If this is not the valid parameter to use, it should give a warning. Otherwise, it should be hooked up to the appropriate parameter from the API.
How to reproduce:
% ffmpeg -f lavfi -i smptebars -c:v h264_nvenc -s 1920x1080 -aspect 16:9 -r 29.97 -t 30 -coder 0 output.mp4
View result in MediaInfo to confirm that CABAC is used.
ffmpeg version N-86330-gbd1179e
built on 2017-06-01
Change History (14)
follow-up: 2 comment:1 by , 7 years ago
Keywords: | cabac coder intra removed |
---|---|
Resolution: | → invalid |
Status: | new → closed |
comment:2 by , 7 years ago
Replying to cehoyos:
No warning can be shown for unused output options.
The option isn't unused, but the behaviour is exactly as expected.
"-coder 0" indicates that the encoder should choose the mode automatically:
<http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavcodec/nvenc_h264.c;h=c3b4bac7494dc24faf250423f2539830358b4c63;hb=HEAD#l122>
<http://git.videolan.org/?p=ffmpeg.git;a=blob;f=compat/nvenc/nvEncodeAPI.h;h=e662880f4d94e880004f536dfbaa485bce9daf9a;hb=HEAD#l592>
The encoder then chooses to use CABAC, since it is more efficient and you haven't indicated any other constraint (e.g. profile) which would force it to use CAVLC instead.
(It is generally recommended that you use named options rather than integer values where they are available. See ffmpeg -h encoder=nvenc_h264
.)
comment:3 by , 7 years ago
Component: | undetermined → avcodec |
---|---|
Resolution: | invalid |
Status: | closed → reopened |
Version: | unspecified → git-master |
Yes, this is indeed a bug.
How on earth can such things happen?
follow-up: 5 comment:4 by , 7 years ago
I don't see how this is a bug.
The option is called "coder", coder 0 has no specific meaning. You are supposed to select one by name.
comment:5 by , 7 years ago
Replying to oromit:
I don't see how this is a bug.
The option is called "coder", coder 0 has no specific meaning.
I don't know how you come to this conclusion (and it contradicts the first comment): 0
is defined as auto for nvenc and as cavlc
for everything (?) else, at least for x264, where the option-name originated. Please use the unstable-api period to fix this.
comment:6 by , 7 years ago
The value 0 comes directly from the nvidia header.
It's not part of the documented ffmpeg API or ABI. Only the names are.
The only direct value ffmpeg makes up here is -1, which translates to "do not set this setting at all and leave it on whatever is in there by default".
This option is similar do what x264 has, but not the same. I picked the const names for it to be compatible in most cases of normal usage.
follow-up: 9 comment:8 by , 7 years ago
Sorry, but nvenc is not x264, and the option works slightly differently, but similar enough to name it the same, as it does the same thing.
If you use the names, like you should, the options are already compatible. Even on the x264 side of things the numerical values are not documented, only the values "ac" and "vlc" are, which are supported by nvenc to achieve the same thing.
comment:9 by , 7 years ago
Replying to oromit:
Sorry, but nvenc is not x264, and the option works slightly differently, but similar enough to name it the same, as it does the same thing.
And this is exactly the issue here.
comment:10 by , 5 years ago
Status: | reopened → open |
---|
So was this solved? I found that one commit.. https://github.com/FFmpeg/FFmpeg/commit/a0b69e2b0a7ba994b722393a0273bb3464fd5efe
comment:11 by , 5 years ago
Priority: | normal → important |
---|
comment:13 by , 5 years ago
comment:14 by , 3 years ago
Okay, maybe just allow for -coder 2 to be cavlc for h264_nvenc? What do you think? Of course now even e4d37abcc13b236a544d37b9a8a4aa16bebe1fda is coder 0 of CABAC, but...
No warning can be shown for unused output options.