1

enter image description here

How do I make Opera in Ubuntu 20.10 to support H.264?

How to install the MPEG-4 AAC decoder and the H.264 decoder? I tried following but H.264 videos on Opera still not playing:

$ sudo apt install libdvdnav4 libdvdread8 gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly libdvd-pkg ubuntu-restricted-extras
Reading package lists... Done
Building dependency tree       
Reading state information... Done
gstreamer1.0-plugins-bad is already the newest version (1.18.0-2ubuntu6).
gstreamer1.0-plugins-ugly is already the newest version (1.18.0-1).
libdvdnav4 is already the newest version (6.1.0-1build1).
libdvdread8 is already the newest version (6.1.1-2).
libdvd-pkg is already the newest version (1.4.2-1-1).
ubuntu-restricted-extras is already the newest version (67).
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.   
Kulfy
  • 17,696
nazar2sfive
  • 1,335

1 Answers1

1

The problem seems to be with the FFMPEG library, i.e., libffmpeg.so packed with the deb package. It's size is significantly smaller than what provided by other packages such as Discord. It is evident that some features are missing from the earlier. To get H.264 support in Opera, you simply need to replace the library.

If you have Visual Studio Code or Discord

In my installation, I had libffmpeg.so in Visual Studio Code as well as Discord. The library copied from either of the package made H.264 to work on Opera. To copy the file, run

# If you have Discord
sudo cp /usr/share/code/libffmpeg.so /usr/lib/x86_64-linux-gnu/opera/libffmpeg.so
# If you have Visual Studio Code
sudo cp /usr/share/code/libffmpeg.so /usr/lib/x86_64-linux-gnu/opera/libffmpeg.so

Restart the browser.

It may also work with libffmpeg.so provided by other packages, but I have only tested with the library in above said packages.

If you have none of them

I have uploaded libffmpeg.so from Visual Studio Code in my Git repository kulfy1/libffmpegOpera. You can download/clone from there and copy in /usr/lib/x86_64-linux-gnu/opera/. To do so, run

wget https://raw.githubusercontent.com/kulfy1/libffmpegOpera/master/libffmpeg.so
sudo cp libffmpeg.so /usr/lib/x86_64-linux-gnu/opera/libffmpeg.so

Restart the browser.


If you visit HTML5Test, you'll observe that now AAC support is also available.

Kulfy
  • 17,696