-
-
Save mcarletti/7989d1c04199dba60a01adf8ac54fe31 to your computer and use it in GitHub Desktop.
| #!/bin/bash | |
| # Source: | |
| # https://forums.opera.com/topic/34659/opera-linux-browser-h-264-support-through-x264-open-source-codec | |
| # Tested on: | |
| # Ubuntu 18.04.3 LTS (x86_64; ubuntu:GNOME) | |
| # Opera 62.0.3331.116 | |
| # 63.0.3368.66 | |
| # retrieve latest ffmpeg release version | |
| URL=`curl https://github.com/iteufel/nwjs-ffmpeg-prebuilt/releases/latest` | |
| FFMPEGVER=${URL%\"*} | |
| FFMPEGVER=${FFMPEGVER##*/} | |
| FFMPEGZIP=${FFMPEGVER}-linux-x64.zip | |
| # download library | |
| curl -L -O https://github.com/iteufel/nwjs-ffmpeg-prebuilt/releases/download/${FFMPEGVER}/${FFMPEGZIP} | |
| unzip ${FFMPEGZIP} | |
| rm ${FFMPEGZIP} | |
| # overwrite opera libffmpeg | |
| sudo mv libffmpeg.so /usr/lib/x86_64-linux-gnu/libffmpeg_h264.so | |
| sudo mv /usr/lib/x86_64-linux-gnu/opera/libffmpeg.so /usr/lib/x86_64-linux-gnu/opera/libffmpeg.so.orig | |
| sudo ln -s /usr/lib/x86_64-linux-gnu/libffmpeg_h264.so /usr/lib/x86_64-linux-gnu/opera/libffmpeg.so |
Still working fine with ubuntu 20.04 and opera 70.0.3728.95
Hi! There's an even simpler way that survives updates:
curl -L -O https://github.com/iteufel/nwjs-ffmpeg-prebuilt/releases/download/${FFMPEGVER}/${FFMPEGZIP}
unzip ${FFMPEGZIP}
rm ${FFMPEGZIP}
sudo mkdir /usr/lib/x86_64-linux-gnu/opera/lib_extra
sudo mv libffmpeg.so /usr/lib/x86_64-linux-gnu/opera/lib_extra
Opera will automatically use the version in lib_extra and the mod will survive updates. So you'll only need to do it once.
Thanks a lot! This script works also on Ubuntu 20.04.1 LTS (Focal Fossa) 64-bit + Opera 73.0.3856.284.
Thanks!! It worked perfectly for me on Ubuntu 20.04.2 LTS (Focal Fossa) 64-bit + Opera 74.0.3911.107.
Thanks :) Still works on Ubuntu 20.04.3 LTS, Opera 74.0.3911.232
I found that the extraction of variables from URL into FFMPEGVER and FFMPEGZIP had started failing pointing to the redirection between /latest and the permalink to the numbered version no longer being output by curl, adding some switches appeared to fix:
URL=$(curl -Ls -o /dev/null -w %{url_effective} https://github.com/nwjs-ffmpeg-prebuilt/nwjs-ffmpeg-prebuilt/releases/latest)
FFMPEGVER=${URL%\"*}
FFMPEGVER=${FFMPEGVER##*/}
FFMPEGZIP=${FFMPEGVER}-linux-x64.zip
curl -L -O https://github.com/iteufel/nwjs-ffmpeg-prebuilt/releases/download/${FFMPEGVER}/${FFMPEGZIP}
unzip ${FFMPEGZIP}
sudo mv libffmpeg.so /usr/lib/x86_64-linux-gnu/opera/lib_extra
Thanks everyone! I've updated the script with your notes and fixes. I've also tested the script with the latest Opera version (currently, it is 87.0.4390.25).
Works with Opera 90.0.4480.80 on Debian 11.4. Thanks. I only changed sudo with su -c "...."
Works with Opera version :99.0.4788.13 and System:Ubuntu 22.04.2 LTS (x86_64; ubuntu:GNOME)
Chromium version:113.0.5672.127
Thank you !!
Opera One(version: 100.0.4815.54)
fedora 37: had to change the bottom 3 lines to make it work, opera would not launch with the symlink
sudo mv libffmpeg.so /usr/lib64/opera/libffmpeg_h264.so
sudo mv /usr/lib64/opera/libffmpeg.so /usr/lib64/opera/libffmpeg.so.orig
sudo cp /usr/lib64/libffmpeg_h264.so /usr/lib64/opera/libffmpeg.so
also had to change ownership of libffmpeg.so to root
Система:Ubuntu 22.04.3 LTS (x86_64; ubuntu:GNOME)
Версия Chromium:116.0.5845.141
Thank you
Will this work with flatpak package?
I'm using Opera's flatpack package form flathub on Fedora.
@butter-fly04 I don't know how Fedora+flatpak+flathub works since I use Ubuntu+apt, however OperaOne was tested under Fedora by @JPDucky. Check it here!
It is working on Debian 11, Opera One(version: 107.0.5045.21).
I downloaded codec from https://github.com/nwjs-ffmpeg-prebuilt/nwjs-ffmpeg-prebuilt/releases
Thank you. Great advice.
Unfortunately after Opera upgrade support for H.264 disappeared again :(
I created file opera_libffmpeg.sh and run this file after each opera upgrade. It takes several seconds only and I have support for H264 again.
Change folders name.
#!/bin/bash
# download compressed libffmpeg.so from below, copy to /home/adam/software and unzip it
# https://github.com/nwjs-ffmpeg-prebuilt/nwjs-ffmpeg-prebuilt/releases
sudo cp /home/adam/software/0.85.0-linux-x64/libffmpeg.so /usr/lib/x86_64-linux-gnu/opera/libffmpeg_h264.so
sudo mv /usr/lib/x86_64-linux-gnu/opera/libffmpeg.so /usr/lib/x86_64-linux-gnu/opera/libffmpeg.so.orig
sudo cp /usr/lib/x86_64-linux-gnu/opera/libffmpeg_h264.so /usr/lib/x86_64-linux-gnu/opera/libffmpeg.soWorks perfect on LMDE 6
Thanks @mcarletti
Works perfect on LMDE 6
Thanks @mcarletti
Every time opera get updated you will need to run this script!
2025 and still working, thanks!
Need to run the script after updating Opera to ver. 63.0.3368.66