#9231 closed defect (fixed)

B-frames parameter is ignored in videotoolboxenc

Reported by: _08 Owned by:
Priority: important Component: avcodec
Version: git-master Keywords: videotoolbox regression
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


When using videotoolbox encoder will use B-frames even if -bf is set to zero.
How to reproduce:

% ffmpeg -i input.mkv -c:v hevc_videotoolbox -bf 0 -g 60 output.mkv
(-g may be necessary because it used to do intra-only encodes by default on Intel, though it seems to be fixed in macOS 11.3)
% ffprobe -show_frames output.mkv
ffprobe reports existence of B-frames (pict_type=B)

The bug was apparently introduced in commit efece4442f3f583f7d04f98ef5168dfd08eaca5c. avctx->max_b_frames is unconditionally set to 16 in vtenc_configure_encoder, user-set value is ignored. The only way to disable B-frames is using baseline profile in h264_videotoolbox.

Change History (4)

comment:1 by Carl Eugen Hoyos, 14 months ago

Keywords: regression added
Priority: normalimportant

comment:3 by Balling, 11 months ago

Somebody please test 55d9d6767967794edcdd6e1bbd8840fc6f4e9315

I do not want to, since I do not like MacOS on my Mac :)

And BTW, there is a cool patch here, please apply! https://patchwork.ffmpeg.org/project/ffmpeg/patch/20210531150302.359628-1-val.zapod.vz@gmail.com/

And sRGB patch too!

Last edited 11 months ago by Balling (previous) (diff)

comment:4 by _08, 10 months ago

Resolution: fixed
Status: openclosed

Works properly on a 2020 MacBook Pro with Intel graphics and macOS 11 (no B-frames with -bf 0, has B-frames by default or with explicit -bf >0).
Commit forcing B-frames to 16 was about Apple Silicon so ideally someone needs to test it on that as well.

Note: See TracTickets for help on using tickets.