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 libffmpeg.so to the chromium package version
sudo ln -s /usr/lib/chromium-browser/libffmpeg.so /usr/lib/x86_64-linux-gnu/opera/lib_extralibffmpeg.so

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

Update

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: https://repo.herecura.eu

Updated instructions:

cd /tmp

# For 32 bit:
# wget https://repo.herecura.eu/herecura/i686/opera-ffmpeg-codecs-56.0.2924.76-1-i686.pkg.tar.xz -O codecs.tar.xz

# For 64 bit:
wget https://repo.herecura.eu/herecura/x86_64/opera-ffmpeg-codecs-56.0.2924.76-1-x86_64.pkg.tar.xz -O codecs.tar.xz

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

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.

You need JavaScript enabled to see comments.