snapcrafters / obs-studio

This is a community-supported modified build of OBS Studio.
https://snapcraft.io/obs-studio
118 stars 35 forks source link

AMD Radeon Pro WX 5100 doesn't have hardware encoding #114

Closed iandol closed 3 years ago

iandol commented 3 years ago

I have the latest Mesa VA-API drivers installed, but OBS Studio installed as a snap cannot use them, it defaults to software only.

❯ apt search mesa-va
Sorting... Done
Full Text Search... Done
mesa-va-drivers/groovy,now 21.1~git2104082123.d1f96e~oibaf~g amd64 [installed,automatic]
  Mesa VA-API video acceleration drivers
flexiondotorg commented 3 years ago

The OBS snap doesn't use the host VA-API drivers. Please run obs-studio.vainfo and paste the output here.

iandol commented 3 years ago

Hi @flexiondotorg, thanks for the reply!

Here is the output:

❯ obs-studio.vainfo
libva info: VA-API version 1.7.0
libva info: Trying to open /snap/obs-studio/1222/usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_7
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.7 (libva 2.6.0)
vainfo: Driver version: Mesa Gallium driver 20.2.6 for AMD Radeon (TM) Pro WX 5100 Graphics (POLARIS10, DRM 3.40.0, 5.11.12-051112-generic, LLVM 11.0.0)
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc

But only software encoding is available.

flexiondotorg commented 3 years ago

If you apt install vainfo what does vainfo on the host display?

iandol commented 3 years ago

I am currently not close to that machine, will test it early next week, thanks for your feedback.

iandol commented 3 years ago

I did manage to ssh into that machine:

❯ vainfo
error: can't connect to X server!
libva info: VA-API version 1.10.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_10
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.10 (libva 2.10.0)
vainfo: Driver version: Mesa Gallium driver 21.0.1 for AMD Radeon (TM) Pro WX 5100 Graphics (POLARIS10, DRM 3.40.0, 5.11.15-051115-lowlatency, LLVM 11.0.1)
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc
flexiondotorg commented 3 years ago

So, the VA-API capabilities of the snap match your host, which implies your GPU should be able to encode H.264 (Main and High profiles). How have you configured the encoder in OBS? Please attach a screenshot :+1:

iandol commented 3 years ago

@flexiondotorg -- thanks, here are my recording settings (basically the defaults):

Screenshot from 2021-05-06 12-17-33

flexiondotorg commented 3 years ago

You need to change the "Output Mode" to "Advanced".

Then use FFMPEG VA-API as the Encoder to access hardware-accelerated encoding.