Playing h.264 videos in Opera 42 on Ubuntu

After upgrading to Opera 42 on Ubuntu I found that h.264 encoded videos stopped working for me. I’m not sure if Opera used to ship with h.264 (I might have compiled a FFmpeg fix ages ago) but for whatever reason it stopped working after upgrading.

I managed to fix it without creating a custom FFmpeg build by installing the Chromium codecs extra package and creating a symbolic link so Opera will use it:

sudo apt-get install chromium-codecs-ffmpeg-extra

# Link to the chromium package version
sudo ln -s /usr/lib/chromium-browser/ /usr/lib/x86_64-linux-gnu/opera/

This might break in the future if Chromium and Opera go out of sync but it seems to be working well at the moment.


Sadly the package chromium-codecs-ffmpeg-extra has already gone out of sync with Opera. I have managed to find another compatible ffmpeg package from an Arc Linux repository:

Updated instructions:

cd /tmp

# For 32 bit:
# wget -O codecs.tar.xz

# For 64 bit:
wget -O codecs.tar.xz

# Extract and move ffmpeg
tar xf codecs.tar.xz
sudo mv ./usr/lib/opera/lib_extra/ /usr/lib/x86_64-linux-gnu/opera/lib_extra/

This does mean manually updating ffmpeg every time. Personally I’m not sure it’s worth it any more.

I was using Opera for it’s HiDPI support but given Chrome and Firefox now have good HiDPI support switching might make the most sense.