Skip to content

Instantly share code, notes, and snippets.

@mcarletti
Last active June 3, 2025 09:01
Show Gist options
  • Save mcarletti/7989d1c04199dba60a01adf8ac54fe31 to your computer and use it in GitHub Desktop.
Save mcarletti/7989d1c04199dba60a01adf8ac54fe31 to your computer and use it in GitHub Desktop.

Revisions

  1. mcarletti revised this gist Jul 17, 2023. 1 changed file with 23 additions and 2 deletions.
    25 changes: 23 additions & 2 deletions opera_x264_support.sh
    Original file line number Diff line number Diff line change
    @@ -1,14 +1,14 @@
    #!/bin/bash


    # Author: Marco Carletti
    # Date: May 2022
    # Version: 0.2.0

    # Last update: July 17, 2023
    # Changed comments, tested versions and added other distros info, such as Debian and Fedora.

    # Thanks to everyone for comments, suggestions, fixes and testings!


    # Tested on
    # ---------
    #
    @@ -28,7 +28,28 @@
    #
    # v0.2.0
    # 87.0.4390.25
    #
    # Ubuntu 22.04
    #
    # v0.2.0
    # 99.0.4788.13

    # Other distros
    # THIS SCRIPT WILL NOT WORK AS IS IS. EACH OS REQUIRES SPECIFIC FIXES.
    # Search in the comments for further details :)
    # -------------
    #
    # Debian 11.4
    # Requires `-c` option in `sudo` commands (credits: `gidici`)
    #
    # v0.2.0
    # 90.0.4480.80
    #
    # Fedora 37
    # Requires to copy the lib file to opera lib folder and chown to root (credits: `JPDucky`)
    #
    # v0.2.0
    # 100.0.4815.54 (Opera One)

    # Release notes
    # -------------
  2. mcarletti revised this gist May 18, 2022. 1 changed file with 60 additions and 11 deletions.
    71 changes: 60 additions & 11 deletions opera_x264_support.sh
    Original file line number Diff line number Diff line change
    @@ -1,29 +1,78 @@
    #!/bin/bash

    # Source:
    # https://forums.opera.com/topic/34659/opera-linux-browser-h-264-support-through-x264-open-source-codec

    # Tested on:
    # Author: Marco Carletti
    # Date: May 2022
    # Version: 0.2.0


    # Thanks to everyone for comments, suggestions, fixes and testings!


    # Tested on
    # ---------
    #
    # Ubuntu 18.04
    #
    # Ubuntu 18.04.3 LTS (x86_64; ubuntu:GNOME)
    # Opera 62.0.3331.116
    # v0.1.0
    # 62.0.3331.116
    # 63.0.3368.66
    #
    # Ubuntu 20.04
    # Opera 70.0.3728.95
    #
    # v0.1.0
    # 70.0.3728.95
    # 73.0.3856.284
    # 74.0.3911.107
    # 74.0.3911.232
    #
    # v0.2.0
    # 87.0.4390.25


    # retrieve latest ffmpeg release version
    URL=`curl https://github.com/iteufel/nwjs-ffmpeg-prebuilt/releases/latest`
    # Release notes
    # -------------
    #
    # v0.2.0 Smarter use of curl options to fix failing permalink. Special thanks to `dotarr` for the fix!
    # Last update: May 18, 2022
    #
    # v0.1.0 It is basically a cleaned version of what you can find in this post from Opera forum:
    # https://forums.opera.com/topic/34659/opera-linux-browser-h-264-support-through-x264-open-source-codec
    # Last update: Aug 18, 2020


    # Retrieve latest FFMPEG release version.
    # We get the complete url pointing to the latest zip package via the curl command.
    #
    # -L If the server reports that the requested page has moved to a different location
    # this option will make curl redo the request on the new place.
    #
    # -o <file> Write output to <file> instead of stdout.
    #
    # -s Silent or quiet mode. Don't show progress meter or error messages.
    #
    # -w <format> Make curl display information on stdout after a completed transfer. The format is
    # a string that may contain plain text mixed with any number of variables.
    URL=`curl -L -o /dev/null -s -w %{url_effective} https://github.com/iteufel/nwjs-ffmpeg-prebuilt/releases/latest`
    FFMPEGVER=${URL%\"*}
    FFMPEGVER=${FFMPEGVER##*/}
    FFMPEGZIP=${FFMPEGVER}-linux-x64.zip

    # download library

    # Download library from complete url and save it locally.
    # Archive is extracted in the working directory and immediately deleted.
    #
    # -L (see above)
    # -O Write output to a local file named like the remote file we get.
    # Only the file part of the remote file is used, the path is cut off.
    curl -L -O https://github.com/iteufel/nwjs-ffmpeg-prebuilt/releases/download/${FFMPEGVER}/${FFMPEGZIP}
    unzip ${FFMPEGZIP}
    rm ${FFMPEGZIP}

    # overwrite opera libffmpeg

    # Overwrite Opera libffmpeg (requires root privileges).
    # Install (ie. copy) the latest version of the library in the system library folder.
    # Before overwriting the Opera library file, make a copy... So we can manually rollback if we messed up things :)
    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
    sudo ln -s /usr/lib/x86_64-linux-gnu/libffmpeg_h264.so /usr/lib/x86_64-linux-gnu/opera/libffmpeg.so
  3. Marco Carletti revised this gist Aug 18, 2020. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions opera_x264_support.sh
    Original file line number Diff line number Diff line change
    @@ -4,9 +4,13 @@
    # 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
    #
    # Ubuntu 20.04
    # Opera 70.0.3728.95

    # retrieve latest ffmpeg release version
    URL=`curl https://github.com/iteufel/nwjs-ffmpeg-prebuilt/releases/latest`
  4. Marco Carletti revised this gist Sep 11, 2019. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions opera_x264_support.sh
    Original file line number Diff line number Diff line change
    @@ -6,6 +6,7 @@
    # 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`
  5. Marco Carletti revised this gist Aug 29, 2019. 1 changed file with 11 additions and 4 deletions.
    15 changes: 11 additions & 4 deletions opera_x264_support.sh
    Original file line number Diff line number Diff line change
    @@ -7,11 +7,18 @@
    # Ubuntu 18.04.3 LTS (x86_64; ubuntu:GNOME)
    # Opera 62.0.3331.116

    mkdir /tmp/opera_x264
    cd /tmp/opera_x264
    curl -L -O https://github.com/iteufel/nwjs-ffmpeg-prebuilt/releases/download/0.39.2/0.39.2-linux-x64.zip
    unzip 0.39.2-linux-x64.zip
    # 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
  6. Marco Carletti created this gist Aug 29, 2019.
    17 changes: 17 additions & 0 deletions opera_x264_support.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    #!/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

    mkdir /tmp/opera_x264
    cd /tmp/opera_x264
    curl -L -O https://github.com/iteufel/nwjs-ffmpeg-prebuilt/releases/download/0.39.2/0.39.2-linux-x64.zip
    unzip 0.39.2-linux-x64.zip

    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