build-aux: Fix incorrect HEVC vertical resolution on AMD VCN #11998
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The HEVC VCN encoder in AMD GPUs will output the incorrect vertical resolution in some cases, most importantly 1920x1080 will result in 1920x1088. A workaround for this issue is available in AMF on Windows, however on Linux with VAAPI and Mesa, a different solution is required.
This PR adds 2 upstream FFmpeg commits that have already been merged in FFmpeg
master
to address the incorrect AMF vertical resolution problem, for the flatpak build.Description
Please refer to 1, 2, and 3 for context. The patches are taken from 2.
AMD VCN uses a different surface alignment compared to other GPUs for encoding, which required an upstream fix in Mesa, libva, FFmpeg, and the VCN firmware.
This commit adds the FFmpeg patches to the flatpak build of OBS which is currently using FFmpeg version n7.1, however the patches were applied upstream after that release. libva API version 1.21 or higher is also required, which is satisfied by using KDE runtime 6.8.
Note that the fix is applicable to flatpak builds only. Standalone and Debian package builds depend on the host library versions and will still have the problem until a version of FFmpeg with the fix is used.
Motivation and Context
The incorrect 1920x1088 HEVC output resolution (instead of 1920x1080) resulted in streaming disconnects for Twitch Enhanced Broadcasting Linux users. Local file recording when using AMD VAAPI HEVC also outputs 1088 instead of 1080. This commit fixes both cases.
How Has This Been Tested?
An earlier variant of the patch was tested in the TEB Beta community while Twitch was testing HEVC for 1920x1080p. I have also tested the patches on a local Linux development host and confirmed the output resolution by playing back the stream on Windows and inspecting the bitstream after a capture.
Types of changes
Checklist: