-
Notifications
You must be signed in to change notification settings - Fork 24
VCEEncC: AV1 CQP + b-frames, --bframes <x> make encodes not follow target bitrate with x>1. No difference between --bframes 1/2/3, only between 0 and X. #120
Description
Issue:
As VCEEnc 8.33 has updated AMF to 1.4.36, which added support for RDNA4 AV1 InterB frames, new issue has appeared:
Commands like these:
%~dp0\VCEEncC64.exe -i %1 -o "%~n1_[AV1_B_CQP51]%~x1" --avsw --codec av1 --cqp 51 --bframes 3 --b-pyramid --adapt-minigop
%~dp0\VCEEncC64.exe -i %1 -o "%~n1_[AV1_B_CQP51]%~x1" --avsw --codec av1 --cqp 51:51:51 --bframes 3 --b-pyramid --adapt-minigop
Produce such encoder setup:
CQP: Intra:51, Inter:51, InterB:26
VBV Bufsize: 5000 kb
Bframes: 3 frames
As result bitrate of output videos spikes to the skies.
Expected behaviour:
CQP mode should properly set QP level for InterB frames
...
Second issue:
Also, for some reason all AV1 + b-frame encodes do not adhere to VBR target bitrate, often going over it by 20-25%
Not sure if reason is same, but still worth noting.
With my hard to encode sample and target --vbr 5000 --max-bitrate 15000
[commands like this: %~dp0\VCEEncC64.exe -i %1 -o "%~n1_[AV1_B_VBR5000]%~x1" --avsw --codec av1 --vbr 5000 --max-bitrate 15000 --bframes 3 --b-pyramid --adapt-minigop --preset slow --profile main --output-depth 8 --audio-copy --colorrange auto]
--bframes 1 followed bitrate (5020.90 kbps)
--bframes 2 was off (5893.47 kbps)
--bframes 3 was way off (6981.42 kbps)
Used commands:
%~dp0\VCEEncC64.exe -i %1 -o "%~n1_test1%~x1" --avsw --codec av1 --vbr 5000 --preset slow --profile main --bframes 1 --b-pyramid --adapt-minigop --output-depth 8 --audio-copy --colorrange auto
%~dp0\VCEEncC64.exe -i %1 -o "%~n1_test2%~x1" --avsw --codec av1 --vbr 5000 --preset slow --profile main --bframes 2 --b-pyramid --adapt-minigop --output-depth 8 --audio-copy --colorrange auto
%~dp0\VCEEncC64.exe -i %1 -o "%~n1_test3%~x1" --avsw --codec av1 --vbr 5000 --preset slow --profile main --bframes 3 --b-pyramid --adapt-minigop --output-depth 8 --audio-copy --colorrange auto
--b-pyramid and --adapt-minigop do not change that "not follows target" behaviour.
ffmpeg command like this also causes it to be off, but not as much as VCEEnc.
%~dp0\ffmpeg -i %1 -hide_banner -loglevel warning -stats -hwaccel d3d11va -i %1 -map 0 -c:s copy -c:v av1_amf -quality quality -max_b_frames 3 -rc vbr_peak -b:v 5000k -maxrate 15000k -c:a copy %~n1_ffmpeg.mkv
Output: frame=12948 fps=170 q=-0.0 Lsize= 154224KiB time=00:03:35.72 bitrate=5856.5kbits/s speed=2.83x