On tumbleweed, I've tried the VLC repo's ffmpeg for h264, packman, and now opi codecs. The first and third seem to work for VLC.
On Silverblue, I don't recall the exact steps, only that I gave up and just used "enhanced h264ify" to disable h264, in favor of vp9. This still breaks many other websites that use h264, but at least youtube mostly works. Mpv flatpak works, so I just use mpv to render the h264-only videos that youtube still has. Of course, this is one area where snaps has the edge of flatpak, IMO - nice default aliases in the terminal, instead of 'flatpak run io.Mpv.mpv https://youtu.be/watch.......' or having to create my own, or having to use another program to do it.
On Silverblue, I don't recall the exact steps, only that I gave up and just used "enhanced h264ify" to disable h264, in favor of vp9. This still breaks many other websites that use h264, but at least youtube mostly works. Mpv flatpak works, so I just use mpv to render the h264-only videos that youtube still has. Of course, this is one area where snaps has the edge of flatpak, IMO - nice default aliases in the terminal, instead of 'flatpak run io.Mpv.mpv https://youtu.be/watch.......' or having to create my own, or having to use another program to do it.