Can't figure out how to make ffmpeg encode with vaapi

The gpu I’m trying to encode with is radeon 680m (the igpu of my ryzen 9 6900hx).

My vainfo output:

$ vainfo
Trying display: wayland
Trying display: x11
vainfo: VA-API version: 1.17 (libva 2.17.1)
vainfo: Driver version: Mesa Gallium driver 22.3.5 for AMD Radeon Graphics (rembrandt, LLVM 15.0.7, DRM 3.49, 6.1.11-1-MANJARO)
vainfo: Supported profile and entrypoints
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD
      VAProfileAV1Profile0            : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc

It’s a bit odd cuz the igpu it’s showing should support encoding for HEVC and H264 as well but it should not support it for AV1; otherwise it looks right and since what i need is the VP9 codec anyhow, that’s what I tried to use. However I can’t seem to get ffmpeg to encode with it.

I tried with this command:

ffmpeg -vaapi_device /dev/dri/renderD128 -i test.webm -vf 'format=nv12,hwupload' -c:v vp9_vaapi output.webm

But get this error:

No usable encoding entrypoint found for profile VAProfileVP9Profile0 (19).
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

What’s going wrong?

VAEntrypointVLD means that your card is capable to decode this format, VAEntrypointEncSlice means that you can encode to this format.
Hardware video acceleration - ArchWiki

Maybe this helps:

1 Like

Ah right, the mesa downgrade in the official repos I completely forgot about that cuz I mostly use my dgpu which is nvidia.

I’m so happy to hear there’s an easy solution for this, hell I even remember writing a script to install the arch linux mesa package instead of ours a while back, how the hell did I forget this…

But sure enough after updating mesa I have h264 and h265 support again:

Trying display: wayland
Trying display: x11
vainfo: VA-API version: 1.17 (libva 2.17.1)
vainfo: Driver version: Mesa Gallium driver 22.3.5 for AMD Radeon Graphics (rembrandt, LLVM 15.0.7, DRM 3.49, 6.1.11-1-MANJARO)
vainfo: Supported profile and entrypoints
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointEncSlice
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD
      VAProfileAV1Profile0            : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc

However I don’t seem to have vp8/vp9 encode support, which sorta defeats my original purpose, I need to be able to encode webm with this, I know the GPU is supposed to support it.

Also just for testing I tried to encode an mp4 with hevc_vaapi and it did work (though I had to restart first)

A post was split to a new topic: Trying to configure hevc_vaap