How to enable HTML5 MP4 (H.264/AAC) video and MP3 audio in Vivaldi for Linux, via an alternative FFMpeg library
The following is a quick guide to get this working on various Linux distros. As a side note, if you have Chrome installed alongside Vivaldi, Netflix should also work after making these changes. Alternatively, use my latest-widevine.sh to fetch and extract Chrome's copy of Widevine, so that it can be used by Vivaldi.
If you don't have working Flash video and need that in addition, please refer to these instructions.
Note: This guide is primarrily aimed at users of Vivaldi stable releases. If it does not solve your issues, read this in addition.
sudo apt update && sudo apt install chromium-codecs-ffmpeg-extra
You will now need to restart Vivaldi. You can then test support on this page.
Install from the AUR
Install from the unofficial herecura repo
Alternatively, you can also get both of these packages from from the unofficial [herecura] repo.
After installing from the AUR or the linked unofficial repository, will now need to restart Vivaldi. You can then test support on this page.
If your distro does not provide a package with a suitable library or one is not detected, you can run the script
./latest-proprietary-media.sh (included with this gist) as your normal user (not root) to fetch and install the Ubuntu file. Once installed, simply restart Vivaldi. You can then test support on this page.
If you would prefer not use a script, here is a short summary of how to do this manually.
First, have a look in http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/ for a “chromium-codecs-ffmpeg-extra” package from a recent Ubuntu version.
Fetch it like so (adjusting the package name as needed):
To Extract out the lib and install it for Vivaldi's usage, enter the following (adjusting the package name as needed):
ar p chromium-codecs-ffmpeg-extra_63.0.3239.84*.deb data.tar.xz | tar Jx ./usr/lib/chromium-browser/libffmpeg.so --strip 4 install -Dm644 libffmpeg.so "$HOME/.local/lib/vivaldi/libffmpeg.so"
Next time you restart Vivaldi it should find this library and use it to decode proprietary media.
Building your own replacement libffmpeg.so
If you want to build your own replacement libffmpeg use the Arch vivaldi-snapshot-ffmpeg-codecs PKGBUILD as a guide.
If you are a maintainer and intend to repackage Vivaldi browser for your distro, you might want to consider making vivaldi-ffmpeg-codecs or vivaldi-snapshot-ffmpeg-codecs packages containing a replacement libffmpeg.so library. It is suggested that you place this library in the directory
/opt/vivaldi-snapshot/ directories respectively. You will need to update these packages from time to time as Vivaldi ups its Chromium version.