Due to a change in FFmpeg 6.0 (constant AV_CODEC_CAP_AUTO_THREADS was renamed to AV_CODEC_CAP_OTHER_THREADS), gst-plugins-libav present in the portage tree cannot be built against it. Upstream summary and fix: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1798
Please include the full build.log and emerge --info. gst-plugins-libav is supposed to be fine per bug 894238...
My bad, forgot to run `eix-update` before reporting and haven't noticed there're 1.20.6 and 1.22.3 available.