ffmpeg h264_vaapi video encoding

0

it look like ffmpeg and h264_vaapi codec are broken in the newest version 4 because they don’t honor the -qp setting. -qp with any value don’t change the bitrate which is terrible high. Only setting the bitrate option directly -b works. Does someone know a way around it.

Problem could be replicated with simple command: ffmpeg -vaapi_device /dev/dri/renderD128 -i input.mp4 -vf ‘format=nv12,hwupload’ -c:v h264_vaapi -qp 30 output.mp4

nx01

Posted 2019-02-07T06:40:28.880

Reputation: 3

Answers

0

This was repaired in ffmpeg's commit f4d7bd6cdbcf9027a36a73531baf7e3885644ee6 and unfortunately that commit is still only available in the git master branch. Hopefully it will be part of ffmpeg-4.1.2; backporting that commit to earlier versions looks like a huge undertaking.

Until ffmpeg-4.1.2 you can either compile the git master yourself, or install a nightly build from the ffmpeg site.

[2019/03/27 edit: ffmpeg-4.1.2 was released without that commit; it appears to be destined for ffmpeg-4.2 unfortunately.]

Patrice Levesque

Posted 2019-02-07T06:40:28.880

Reputation: 780