A brief how-to for h264 etc. support for Firefox (including ffmpeg install).
You’ll need the C compiler installed and packages to enable vaapi hardware acceleration
sudo swupd bundle-add c-basic devpkg-libva
Now create a build directory somewhere and cd into it.
mkdir ~/build && cd ~/build
Install ffmpeg
curl -LO https://ffmpeg.org/releases/ffmpeg-4.2.tar.bz2
tar jxf ffmpeg-4.2.tar.bz2
cd ffmpeg-4.2
./configure --prefix=/usr/local --enable-shared && make && sudo make install
If you haven’t already added /usr/local/lib to ld.so.conf, this is required before ffmpeg will work.
sudo sh -c 'echo /usr/local/lib >>/etc/ld.so.conf'
sudo ldconfig
Now this should be enough to make Firefox reference the new libraries, but for some reason it doesn’t. I suspect it might be an issue with Firefox upstream.
The below is a workaround, at least until Firefox is “fixed” (thanks to @miguelinux who posted this below)…
echo "export LD_LIBRARY_PATH=/usr/local/lib" >> ${HOME}/.config/firefox.conf
Now verify Firefox by visiting https://www.youtube.com/html5