A change merged to Mesa 22.2 on Thursday adds a Meson build option for being able to optionally control the video codecs supported by Mesa for its video encoding/decoding paths.
While still dependent upon the GPU/driver for what video codecs can work with GPU acceleration on Mesa, this allows building Mesa code for certain video codecs if deemed undesirable. In part