[Studio][LINUX] AMD VCE Support on Linux via va-api + libx264

cRaZy-bisCuiT

New Member
Dear OBS-Devs,

AMD VCE is working under linux using va-api and libx264. I can successfully encode videos using the command line like that:

Code:
ffmpeg -vaapi_device /dev/dri/renderD129 -i input.mp4 -vf 'format=nv12,hwupload' -c:v h264_vaapi output.mkv

So far I didn't manage to make an advantage of that with OBS Studio - the Custom Output complaints:

Code:
warning: rtmp-common.c: [initialize_output] Could not find service ''
warning: Failed to open video codec: Invalid argument
warning: ffmpeg_data_init failed
info: ==== Recording Stop ================================================

  1. Please provide some information how to make use of it using custom output.
  2. Please add AMD VCE as an option for encoding like it was done with nvenc.
 

cRaZy-bisCuiT

New Member
Thank you very much for the information. I did second that request. Still: It works using Mesa - Why can't OBS implement OBS this hardware encoder?
 

Xaymar

Active Member
Because it is not officially supported by AMD. The solution would be a hack that in 99% of cases would cause more issues than it would solve. Additionally, anyone can submit a plugin - all you need to do is learn how to code.
 

cRaZy-bisCuiT

New Member
Oh yes I do. Except for I have no clue about FFMPEG, HW Encoding & stuff like that. Still I wonder why using features vaapi provides is considered to be a hack. It should be working with AMDGPU as well as AMDGPU PRO.

Is there a place to reach out for plugins?
 

Xaymar

Active Member
Oh yes I do. Except for I have no clue about FFMPEG, HW Encoding & stuff like that.

Well, there's no better time to learn than always.

Still I wonder why using features vaapi provides is considered to be a hack. It should be working with AMDGPU as well as AMDGPU PRO.

Right, I think you missed the part where an AMD representative said encoding is not yet supported on Linux:

MikhailAMD said:
So far AMD did not provide VAAPI encoder, decoder only.

This means that the only way to get VA-API working for AMD cards is by literally using a hack to have it working - like using mesa drivers. Nvidia and Intel are probably not affected by the same issue, if they even provide VAAPI encoding.

Is there a place to reach out for plugins?

Here: https://obsproject.com/forum/list/resource-requests.29/ . But as I already said on Github, someone is already working on a plugin: https://obsproject.com/forum/threads/experimental-ffmpeg-vaapi-plugin.61529/
 

cRaZy-bisCuiT

New Member
Edit: Should I switch to "Linux Support" with this question? Thanks!

Original message:
Okay, thanks for you help!

Still I got a question I mentioned in the very first post. If I use "Custom Outpur" -> "Recording" there's listed. as a "Video Encoder": "h264_vaapi (libx264)". I I use that setting I get the following output:

Code:
info: ------------------------------------------------
warning: Failed to open video codec: Invalid argument
warning: ffmpeg_data_init failed
info: ==== Recording Stop ================================================

Actually I have no clue what kind of arguments are passed to FFMPEG / the encoder by OBS. I did some research but I didn't find anything about that. Still I have the chance to use "Video Encoder Settings" field to add some parameters. Since I don't know how those are passed I haven't been successful.

If I use the terminal I'm able to convert videos using FFMPEG + h264_vaapi like this:

Code:
ffmpeg -vaapi_device /dev/dri/renderD128 -i input.mp4 -vf 'format=nv12,hwupload' -c:v h264_vaapi output.mkv

How could I make use of that with OBS? Obviously the idea is to lower the load on the CPU.

This encoder must be available for some reason. Therfor I'd like to use it.
 
Last edited:
Top