H.264 support for Opera and openSUSE

I am using openSUSE Leap 42.2 and Opera 46.0.2597.57.

Some videos on the internet (maybe the half on YouTube) do not work on Opera.
YouTube tells me that I cannot watch the video and suggests me visiting https://www.youtube.com/html5.
H.264 and MSE & H.264 are not supported by my browser as the page mentions, although Opera is listed as suported.

I did some research and installed the following packages (which were not the sollution):

  • chromium-ffmpeg-extra
  • chromium-ffmpeg-extra-debuginfo
  • chromium-ffmpegsumo

Maybe I need to mention that Firefox works pretty fine with YouTube and other videos that do not work on Opera.

Thanks a lot for your help.

PS:
If this issue is fixed with openSUSE Leap 42.3 this would be an option for me, but I still hadn’t enough time for an update.

Asked By: Mique

||

This unfortunately is a known problem in Opera spanning to OpenSuse 42.3. YouTube reports that H.264 and MSE & H.264 both are unsupported when accessed from that OS. This is using Opera 46.0.2597.26, not quite as fresh as yours, but newer OS.

Looking around the web, there is reference to a Chromium codec patch. Uninstalling Chromium makes no difference on my setup, nor force reinstalling ffmpeg after uninstall of Chromium’s extra codecs. For those not feint of heart, there is a manual-linking solution [1] involving libffmpeg.so, which seems to have success there (but must be redone each time Opera is updated). I have not tried the manual linking.

[1] https://solus-project.com/forums/viewtopic.php?t=1004

Answered By: Doug0

I had same issue on Fedora 27, so I followed the instructions provided in link by @doug0 and tried out libffmpeg prebuilt with proprietary codecs. Here is essentials:

  • go to https://github.com/iteufel/nwjs-ffmpeg-prebuilt/releases
  • copy link to latest release (in my case 0.26.6)
  • close Opera browser
  • open terminal, and enter the following:

    $ curl -L -O https://github.com/iteufel/nwjs-ffmpeg-prebuilt/releases/download/0.26.6/0.26.6-linux-x64.zip
    $ unzip 0.26.6-linux-x64.zip
    $ sudo mv libffmpeg.so /usr/lib64/libffmpeg_h264.so
    $ sudo mv /usr/lib64/opera/libffmpeg.so /usr/lib64/opera/libffmpeg.so.orig
    $ sudo ln -s /usr/lib64/libffmpeg_h264.so /usr/lib64/opera/libffmpeg.so
    
  • verify that Opera now supports H.264 at https://html5test.com

Answered By: Bluesboy

Another option is to install the snap version of Opera (https://snapcraft.io/opera) this worked for me

Answered By: mtdb

You can check your browser id at opera://about/ and download proper libffmpeg.so version from http://ppa.launchpad.net/saiarcot895/chromium-beta/ubuntu/pool/main/c/chromium-browser/.

For example my browser id is “Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36 OPR/56.0.3051.52″ and I need libffmpeg.so from chromium-codecs-ffmpeg-extra_69.0.3497.72-0ubuntu1~ppa1~16.04.1_amd64.deb .
You should extract and replace (with backup) libffmpeg.so in your opera directory(in Debian /usr/lib/x86_64-linux-gnu/opera/ ) and restart opera.

mkdir /tmp/libffmpeg
cd /tmp/libffmpeg
wget http://ppa.launchpad.net/saiarcot895/chromium-beta/ubuntu/pool/main/c/chromium-browser/chromium-codecs-ffmpeg-extra_69.0.3497.72-0ubuntu1~ppa1~16.04.1_amd64.deb
ar x chromium-codecs-ffmpeg-extra_69.0.3497.72-0ubuntu1~ppa1~16.04.1_amd64.deb
tar xJvf data.tar.xz
sudo cp -b ./usr/lib/chromium-browser/libffmpeg.so /usr/lib/x86_64-linux-gnu/opera/

Verify H.264 support at https://www.youtube.com/html5

UPDATE: Ubuntu 19.10

In Ubuntu 19.10 (if you have Google Chrome installed) you can find the libffmpeg.so file in /usr/share/code/. So the command to provide Opera with support for H.264 YouTube videos (and Amazon Prime, Netflix, etc.) is

sudo cp /usr/share/code/libffmpeg.so /usr/lib/x86_64-linux-gnu/opera/libffmpeg.so

For Widevine support (Netflix, Amazon Prime) you’ll need another Google Chrome file

sudo cp /opt/google/chrome/WidevineCdm/_platform_specific/linux_x64/libwidevinecdm.so /opt/google/chrome/libwidevinecdm.so

Reference: Widevine + H.264 Support on Ubuntu 19.10

Answered By: Mak

I’ve created a script that patches Opera with the “libffmpeg.so” file from the package “chromium-ffmpeg-codecs-extra”
Get it here

Answered By: Nesze

::: Update 2019 :::

This “Opera unable to play some Youtube HTML5 videos in OpenSuse” issue still persists.

Opensuse 42.3+ fix ( as root , install this package. Other packages are not needed afaik ):

   # zypper -v in chromium-ffmpeg-extra

Then restart Opera (ensure all instances of Opera are closed ) and via Opera goto;

   https://www.youtube.com/html5

You should be able to see a Blue Tick besides the H264 and MSE & H.264 boxes to indicate that these codecs are now supported for the Opera browser.

Answered By: MarcoZen

This issue seems to keep coming up. It happens, I research how to fix it, then forget about it, then it happens again.

This time I tried re-installing chromium-ffmpeg-extra which did not work for me but then I upgraded to opera 60.0.3255.27 which did work (today)

UPDATE:
the issue keeps coming up because every time opera upgrades it must be fixed again.

This time I found this thread: https://forums.opera.com/topic/27463/bug-html5-h-264-codec-videos-no-longer-working-on-opera-54-0-2952-41-ubuntu-18-04-lts-x86_64-xfce/7

Which recommended removing operas libffmpeg.so and creating a symlink to chrome’s

These instructions may very based on where things are in your distro but for me running linux mint 18 I did this:

  1. find opera dir and cd into it.
  2. rename opera’s libffmpeg.so to back it up
  3. create symlink to chrome’s libffmpeg.so
$ which opera
/usr/bin/opera
$ ls -al /usr/bin | grep opera
lrwxrwxrwx  1 root root          35 Jun  4 16:33 opera -> ../lib/x86_64-linux-gnu/opera/opera
$ cd /usr/lib/x86_64-linux-gnu/opera
$ sudo mv libffmpeg.so libffmpeg.so.bak
$ sudo ln -s /usr/lib/chromium-browser/libffmpeg.so
$ ls -al | grep libffmpeg.so
lrwxrwxrwx   1 root root        38 Jun 11 06:53 libffmpeg.so -> /usr/lib/chromium-browser/libffmpeg.so
-rw-r--r--   1 root root   1799080 Jun  4 16:33 libffmpeg.so.bak

Obviously the important line is sudo ln -s /usr/lib/chromium-browser/libffmpeg.so But I displayed the rest so that people could figure out how to know which directory they needed to be in.

Also I have chrome browser installed. If you do not then you may have to install it for this solution to work.

I hope this is helpful.

I do not yet know if I will have to repeat these steps the next time opera upgrades … probably.

Answered By: tempcke

Actually the most suitable libffmpeg.so for Opera is contained by the snap package chromium-ffmpeg since the Snap version of Opera does use this version of libffmpeg.so.

I’ve written a shell script to copy the newest version of libffmpeg.so, which is included by the snap package chromium-ffmpeg, to the Opera library
directory. Please install snapd as well as the snap package by yourself first. You may also have to modify some paths to make the script work on your distro (mine is Debian 11.6).

Last but not least, RUN IT IN ROOT.

#!/bin/dash

MNT_DIR='/mnt/chff'
CHFF_PREFIX='chromium-ffmpeg'

mkdir $MNT_DIR

MAX_VER=0

for file in /var/lib/snapd/snaps/${CHFF_PREFIX}_*.snap; do
    CUR_VER=$(echo $file | sed -E "s|/var/lib/snapd/snaps/${CHFF_PREFIX}_||" | cut -f 1 -d '.' )
    if [ $MAX_VER '<' $CUR_VER ]; then
        MAX_VER=$CUR_VER; fi
done

mount -t squashfs -o ro /var/lib/snapd/snaps/${CHFF_PREFIX}_${CUR_VER}.snap $MNT_DIR

MAX_VER=0

for folder in $MNT_DIR/${CHFF_PREFIX}-*; do
    CUR_VER=$(echo $folder | sed -E "s|$MNT_DIR/${CHFF_PREFIX}-||")
    if [ $MAX_VER '<' $CUR_VER ]; then
        MAX_VER=$CUR_VER; fi
done

cp -v $MNT_DIR/${CHFF_PREFIX}-${MAX_VER}/chromium-ffmpeg/libffmpeg.so /usr/lib/x86_64-linux-gnu/opera/

P.S. The Snap version of Opera is buggy, that’s why I have to bypass it.

Answered By: Zhang Xiang
Categories: Answers Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.