obs-studio
obs-studio copied to clipboard
[WIP] obs-ffmpeg: Add av1 vaapi implementation
Description
Work in progress. Add a vaapi encoder for AV1, tested on non-upstreamed patchsets for ffmpeg from intel so this wont actually work if you using official ffmpeg sources until those patches land. Once those patches do land this may or may not need some changes.
This is also kind of a mess thrown together, we might be able to use the new ffmpeg-video-encoders tooling that was added for software AV1 but I havnt looked too hard at the code.
Motivation and Context
I wanted to test this intel gpu encoder, it works and the encoder is fast ~250fps but since only CQP is supported its not really suitable for streaming. Maybe this will motivate vendors to try again to land their patches. Also its nice to have for anyone wanting to play around with it.
How Has This Been Tested?
Encoding and playback on an a750 worked fine.
Types of changes
- New feature (non-breaking change which adds functionality)
Checklist:
- [ ] My code has been run through clang-format.
- [ ] I have read the contributing document.
- [ ] My code is not on the master branch.
- [ ] The code has been tested.
- [ ] All commit messages are properly formatted and commits squashed where appropriate.
- [ ] I have included updates to all appropriate documentation.
Someone requested how to actually run this, you must use intel's dg2 enablement ubuntu. Instructions https://dgpu-docs.intel.com/installation-guides/ubuntu/ubuntu-jammy-arc.html
This should also work with Linux systems with AMD Radeon RX 7000 series GPUs too, right? AV1 through Mesa VA-API would be available on such systems.
As mentioned, it depends on ffmpeg patches from Intel. So this will not work in any platform unless those are merged. Beyond the ffmpeg changes I have no clue about the state of AV1 on AMD and/or the compatibility with the Intel patches.
Which patches are needed? Couldn't find them via google. vainfo on the 7900 XTX reports AV1 as supported seemingly, so I'd potentially give it a shot on that platform too.
Which patches are needed? Couldn't find them via google.
vainfoon the 7900 XTX reports AV1 as supported seemingly, so I'd potentially give it a shot on that platform too.
You'll most likely need to compile ffmpeg (git version) on your own using this patch, but you may need to apply all the patches in https://github.com/intel/cartwheel-ffmpeg/tree/master/patches, in case there's dependencies.
I'm testing myself to see which works best.
Got it compiling with only patch 69 and 71 on latest upstream ffmpeg. (Sadly I didn't look closely enough and currently vainfo only returns the decode endpoint and the encode endpoint isn't there yet, might need to upgrade my OS from LTS or wait for newer drivers)
Closing this one out as bringing qsv to linux seems more likely than ffmpeg av1 support.