December 3, 2023

Quick & Easy: Hardware Encoding with VAAPI on Radeon under Ubuntu 23.10 feat FFMPEG

Install Package

Improving performance, might end up being slower (but with less cpu usage) depending on hardware

H.264/AVC Hardware Encoding using VAAPI on Radeon Vega or later
crf 24, audio copy
ffmpeg -vaapi_device /dev/dri/renderD128 -i n1.mkv -vf 'format=nv12,hwupload' -c:v h264_vaapi -qp 24 -c:a copy avc-crf24.mp4

5Mbps, audio copy

ffmpeg -vaapi_device /dev/dri/renderD128 -i n1.mkv -vf 'format=nv12,hwupload' -c:v h264_vaapi -b:v 5M -c:a copy avc_5M.mp4

H.265/HEVC Hardware Encoding using VAAPI on Radeon Vega or later
crf 24, audio copy

ffmpeg -vaapi_device /dev/dri/renderD128 -i n1.mkv -vf 'format=nv12,hwupload' -c:v hevc_vaapi -qp 24 -c:a copy hevc-crf24.mp4

5mbps, audio copy

ffmpeg -vaapi_device /dev/dri/renderD128 -i n1.mkv -vf 'format=nv12,hwupload' -c:v hevc_vaapi -b:v 5M -c:a copy hevc-5mbps.mp4

crf 24, 10-bit, audio copy

ffmpeg -vaapi_device /dev/dri/renderD128 -i n1.mkv -vf 'format=p010,hwupload' -c:v hevc_vaapi -qp 24 -profile:v 2 -c:a copy hevc-main10-crf24.mp4

15mbps, 10-bit, audio copy

ffmpeg -vaapi_device /dev/dri/renderD128 -i n1.mkv -vf 'format=p010,hwupload' -c:v hevc_vaapi -b:v 15M -profile:v 2 -c:a copy hevc-main10-15mbps.mp4

more info

  • LinkedIn
  • Tumblr
  • Reddit
  • Pinterest
  • Pocket
DigitalOcean Referral Badge
Keep my site online & receive a $200 60-day credit at DigitalOcean for your VPS Hosting
Cheaper Games on Instant-Gaming
Creative Commons Licence Clicky