Jump to content

amd vaapi h264 hw transcode aspect ratio issue


Recommended Posts

Posted

I've upgraded to a Ryzen 5 5600G and using the iGPU (from i5 8600K+igpu quicksync transcoding). Emby Server is running in proxmox LXC container. I'm using the amdgpu builtin kernel driver.

client is the emby browser interface.

When viewing some content (576i) then the aspect ratio/zoom scaling is stretched vertically when using h264 Hardware encoding. when using SW h264 encoding then it plays back correctly.

when using h264 HW encoder for 4k content, then it plays correctly.

logs included; ffmpeg-transcode-7c4... = SW transcode log

ffmpeg-transcode-190... = HW transcode log

hwtranscode-Screenshot_20230716_110547.png

swtranscode-Screenshot_20230716_110851.png

ffmpeg-transcode-7c4d3655-a63e-45f9-86c8-d205950f7754_1.txt ffmpeg-transcode-190b59da-0d07-4ca0-93f2-d32d3ff5373c_1.txt hwtransode-embyserver.txt swtranscode-embyserver.txt

Posted

anyone have ideas on how to solve this one?

  • 5 weeks later...
Posted

@veehexx1

I don't have much experience with AMD VAAPI hw acceleration. It's rarely used (at this time).

According to the ffmpeg log, the display and sample aspect ratio values are set correctly:

image.png.29dfc4b930862d0ccac8f77259238171.png


(same as in the software encoding log)

What's odd are those "Driver does not..." messages. I've never seen those before.

I assume that you're already on the latest drivers? Did you install AMDGPU PRO from the AMD website?

The only other suggestion I have would be to try the latest Emby beta server. It's ffmpeg based on a newer baseline version and there are many other transcoding changes as well.

Let me know how it goes...
sw

Posted

thanks, i'll try to get the AMDGPU PRO drivers tested over the next few weeks. And the latest beta if that doesnt solve it.

fwiw, i remenber looking into AMDGPU PRO, but cant remember if there were some issues or i decided that in-kernel was just the better option.

currently i'm using the in-kernel AMDGPU package on 6.2.x kernel though.

 

Posted

Let us know how you get on. Thanks.

Posted
8 hours ago, veehexx1 said:

thanks, i'll try to get the AMDGPU PRO drivers tested over the next few weeks. And the latest beta if that doesnt solve it.

I can't promise that this will fix it, but it might help.

 

Generally, support for AMD media hw acceleration in ffmpeg is rather minimal, that's why AMD GPUs are not a first-class-citizen for hw acceleration in Emby.

We are in contact with AMD now for working towards improving this situation (primarily by additions to ffmpeg). It will take some time until those improvements will flow into Emby, but hopefully we'll have something in the beta channel some time after the 4.8 release.

Posted

that'd be awesome if something could be done after 4.8 (4.9!!?). i get things like this are not quick point-release type fixes.

i've had a bit of time tonight to look into and figure out whats the way forward and getting conflicting info.

emby wiki: https://emby.media/support/articles/Hardware-Acceleration-on-Linux.html, points to AMDGPU-PRO: https://www.amd.com/en/support/kb/release-notes/rn-prorad-lin-amdgpupro, but my GPU isnt on the list. appears to be for older generation GPUs, and non-recent linux distros. So AMDGPU-pro is not worth looking into? even a quick attempt with 'amdgpu-install --pro' errors with missing pre-req packages.

^^ that is probably what conclusion i came to in the past; old/unsuitable for my hardware so no point continuing.

The Components section at https://www.amd.com/en/support/kb/faq/amdgpu-installation, based on my own assumption, seems to say that the in-kernel amdgpu drivers support the required features are part of the 'Mesa multimedia' and/or one of the 2 'base' packages. Fact is, hw transcoding is working so i beleive drivers are "good enough", unless theres a specific bug for the 576i issue i've reported.

I havent yet looked into the emby beta. Should be the easiest option to test as i can rely on snapshots to switch between and test. hopefully at weekend when i can spare more time with it.

Posted

The earlier experience was that AMGPUPRO worked better. 

Another earlier experience was that there's no good entry page to get to the latest versions of AMDGPUPRO. You had to use search. I'm not sure whether this is still the same.

If everything is working for you, then I would just leave it as is, though.

Posted

Found some time to test this today. The 4.8.0.43 beta is a better experience.

This is specifically Proxmox 8 host (debian based), with emby running in LXC debian 11. Both using in-kernel amdgpu with 'mesa-va-drivers' & 'vainfo' installed to confirm functionality.

The originally reported issue with 576i content being incorrectly stretched is now fixed. Awesome!

Not entirely perfect though as with HW transcoding, the bitrate seems to be set too low/compression too high with visual artifacts and blocking, which does not occur with SW transcoding. I havent looked into the new config options that 4.8 offers, for HW H.264 encoding to see if that makes a difference. maybe tomorrow!

  • Thanks 1
Posted

Thanks for the feedback !

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...