amdgpu hevc encoding problem: static picture shakes when using vbr/cbr
I have tested amdgpu hevc encoding via libva few days ago.
I found such a problem: static picture shakes when using vbr/cbr, but cqp mode is fine.
How to reproduct:
-
download attachment hevc.tar.gz .
raw.nv12
is the raw nv12 file,hevc.mp4
is the mp4 file encoded by hevc_vaapi. -
run ffmpeg command(or just watch hevc.mp4):
ffmpeg -y -f rawvideo -pixel_format nv12 -s 1280x720 -i raw.nv12 -vaapi_device /dev/dri/renderD129 -vf 'format=nv12,hwupload' -framerate 60 -frames:v 500 -c:v hevc_vaapi -g 60 -b:v 5M -r 60 -f mp4 hevc.mp4
-
open hevc.mp4 and pay attention, shaking frequency is relevant to gop (I frame).
-
If run ffmpeg using cqp mode, then it is fine.
ffmpeg -y -f rawvideo -pixel_format nv12 -s 1280x720 -i raw.nv12 -vaapi_device /dev/dri/renderD129 -vf 'format=nv12,hwupload' -framerate 60 -frames:v 500 -c:v hevc_vaapi -g 60 -r 60 -f mp4 hevc.mp4