Skip to content

Instantly share code, notes, and snippets.

@ruario
Last active July 25, 2025 07:24
  • Select an option

Select an option

Revisions

  1. ruario revised this gist Nov 7, 2018. 2 changed files with 1 addition and 194 deletions.
    60 changes: 1 addition & 59 deletions h264-vivaldi-linux.md
    Original file line number Diff line number Diff line change
    @@ -1,59 +1 @@
    # How to enable HTML5 MP4 (H.264/AAC) video in Vivaldi for Linux, via an alternative FFMpeg library

    ## Intro

    The following is a quick guide to get this working on various Linux distros. As a side note, if you have Chrome installed alongside Vivaldi, Netflix should also work after making these changes. Alternatively, use my [latest-widevine.sh](https://gist.github.com/ruario/3c873d43eb20553d5014bd4d29fe37f1) to fetch and extract Chrome's copy of Widevine, so that it can be used by Vivaldi.

    If you don't have working Flash video and need that in addition, please refer to [these instructions](https://gist.github.com/ruario/215c365facfe8d3c5071).

    **Note:** *This guide is primarily aimed at users of Vivaldi stable releases. If it does not solve your issues, [read this](https://gist.github.com/ruario/4eecac838ebfd3a7a164b4f4ee850f30) in addition.*

    ### Ubuntu

    #### Install chromium-codecs-ffmpeg-extra

    ```
    sudo apt update && sudo apt install chromium-codecs-ffmpeg-extra
    ```

    You will now need to restart Vivaldi. You can then test support on [this page](http://www.quirksmode.org/html5/tests/video.html).

    ### Arch

    #### Install from the AUR

    If you want to use the latest stable, install [vivaldi](https://aur.archlinux.org/packages/vivaldi-stable/) and [vivaldi-ffmpeg-codecs](https://aur.archlinux.org/packages/vivaldi-ffmpeg-codecs/).

    If you want to use the latest snapshot, install [vivaldi-snapshot](https://aur.archlinux.org/packages/vivaldi-snapshot/) and [vivaldi-snapshot-ffmpeg-codecs](https://aur.archlinux.org/packages/vivaldi-snapshot-ffmpeg-codecs/).

    #### Install from the unofficial herecura repo

    Alternatively, you can also get both of these packages from from the unofficial [[herecura]](http://repo.herecura.eu/) repo.

    **Note:** Do not use the herecura repo, if you use related distros like Chakra and Manjaro. These are not real “Arch Linux” and have differences that are great enough, that you are likely to encounter problems (if not right away, then some time in the future).

    After installing from the AUR or the linked unofficial repository, will now need to restart Vivaldi. You can then test support on [this page](http://www.quirksmode.org/html5/tests/video.html).

    ### Other distros

    If your distro does not provide a package with a suitable library or one is not detected, you can run the script `./latest-proprietary-media.sh` (*included with this gist*) as your normal user (not root) to fetch and install the Ubuntu file. Once installed, simply restart Vivaldi. You can then test support on [this page](http://www.quirksmode.org/html5/tests/video.html).

    If you would prefer not use a script, here is a short summary of how to do this manually.

    First, have a look in http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/ for a “chromium-codecs-ffmpeg-extra” package from Ubuntu 16.04.

    Fetch it like so (adjusting the package name as needed):

    wget http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/chromium-codecs-ffmpeg-extra_69.0.3497.81-0ubuntu0.16.04.1_amd64.deb

    To Extract out the lib and install it for Vivaldi's usage, enter the following (adjusting the package name as needed):

    ar p chromium-codecs-ffmpeg-extra_69.0.3497.81*.deb data.tar.xz | tar xJ -C ~ --wildcards \*libffmpeg.so --xform 's,.*/,.local/lib/vivaldi/,'

    Next time you restart Vivaldi it should find this library and use it to decode proprietary media.

    ## Building your own replacement libffmpeg.so

    If you want to build your own replacement libffmpeg use the [Arch vivaldi-snapshot-ffmpeg-codecs PKGBUILD](https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=vivaldi-snapshot-ffmpeg-codecs) as a guide.

    If you are a maintainer and intend to repackage Vivaldi browser for your distro, you might want to consider making **vivaldi-ffmpeg-codecs** or **vivaldi-snapshot-ffmpeg-codecs** packages containing a replacement libffmpeg.so library. It is suggested that you place this library in the directory `/opt/vivaldi/` or `/opt/vivaldi-snapshot/` directories respectively. **You will need to update these packages from time to time as Vivaldi ups its Chromium version.**
    This page is no longer maintained, go to https://help.vivaldi.com/article/html5-proprietary-media-on-linux/ for help
    135 changes: 0 additions & 135 deletions latest-proprietary-media.sh
    Original file line number Diff line number Diff line change
    @@ -1,135 +0,0 @@
    #!/bin/sh

    # Discourage Ubuntu users from using this script, since they can (and should) install chromium-codecs-ffmpeg-extra directly
    if [ -r /etc/os-release ] && grep -qx 'ID=ubuntu' /etc/os-release; then
    echo "You should not use this script on Ubuntu, install chromium-codecs-ffmpeg-extra via apt instead." >&2
    read -p "Do you wish to continue anyway? [y/N]: " YN
    case "$YN" in
    [Yy]*) : ;;
    [Nn]*) echo "Exiting." ; exit ;;
    *) echo 'Answer not recognised, assuming "No". Exiting.'; exit ;;
    esac
    fi

    # Make sure the user is not runing as superuser
    if [ "$USER" = "root" ]; then
    echo 'Do not run this script as root or via sudo. Run it as your normal user.' >&2
    exit 1
    fi

    available () {
    command -v "$1" >/dev/null 2>&1
    }

    # Make sure we have wget or curl
    if available wget; then
    SILENT_DL="wget -qO-"
    LOUD_DL="wget"
    elif available curl; then
    SILENT_DL="curl -sL"
    LOUD_DL="curl -O"
    else
    echo "Install Wget or cURL" >&2
    exit 1
    fi

    # Set temp dir
    TMP="${TMP:-/tmp}"

    # Set staging dir
    STAGINGDIR="$TMP/chromium-codecs-ffmpeg-extra-staging"

    # Setup Arch
    case `uname -m` in
    x86_64) DEB_ARCH=amd64; REPO=http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/ ;;
    i?86) DEB_ARCH=i386; REPO=http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/ ;;
    arm*) DEB_ARCH=armhf; REPO=http://ports.ubuntu.com/ubuntu-ports/pool/universe/c/chromium-browser/ ;;
    aarch64) DEB_ARCH=arm64; REPO=http://ports.ubuntu.com/ubuntu-ports/pool/universe/c/chromium-browser/ ;;
    esac

    # Work out the VERSION
    # Limit the UBUNTU version to 16.04 to avoid the glibc bump in 18.04, so that this works for older distros
    UBUNTU_PACKAGE=`${SILENT_DL} "$REPO" | sed -rn "s/.*(chromium-codecs-ffmpeg-extra_([0-9]+\.){3}[0-9]+-[0-9]ubuntu[0-9]\.16\.04\.[1-9]_$DEB_ARCH.deb).*/\1/p" | sort | tail -n 1`
    ## The original match was
    ## UBUNTU_PACKAGE=`${SILENT_DL} "$REPO" | sed -rn "s/.*(chromium-codecs-ffmpeg-extra_([0-9]+\.){3}[0-9]+-[0-9]ubuntu[0-9]\.([0-9]{2}\.){2}[0-9\.]*_$DEB_ARCH.deb).*/\1/p" | sort | tail -n 1`
    VERSION=`echo "$UBUNTU_PACKAGE" | sed -rn "s/.*_(([0-9]+\.){3}[0-9]+)-.*/\1/p"`

    # Error out if $VERISON is unset, e.g. because previous command failed
    if [ -z "$VERSION" ]; then
    echo "Could not work out the latest version; exiting" >&2
    exit 1
    fi

    # Don't start repackaging if the same version is already installed
    if [ -r "$HOME/.local/lib/vivaldi/chromium-codecs-ffmpeg-extra-version.txt" ]; then
    . "$HOME/.local/lib/vivaldi/chromium-codecs-ffmpeg-extra-version.txt"
    if [ "$INSTALLED_VERSION" = "$VERSION" ]; then
    echo "The latest chromium-codecs-ffmpeg-extra ($VERSION) is already installed"
    exit 0
    fi
    fi

    # Now we could screw things up so exit on first error
    set -e

    # If the staging directory is already present from the past, clear it down
    # and re-create it.
    if [ -d "$STAGINGDIR" ]; then
    rm -fr "$STAGINGDIR"
    fi

    mkdir "$STAGINGDIR"
    cd "$STAGINGDIR"

    # Now get the deb package
    $LOUD_DL "$REPO$UBUNTU_PACKAGE"


    # Extract the contents of the chromium-codecs-ffmpeg-extra package
    if available bsdtar; then
    DEB_EXTRACT_COMMAND='bsdtar xOf'
    elif available ar; then
    DEB_EXTRACT_COMMAND='ar p'
    else
    fallback_data_extract () {
    dd status=none iflag=skip_bytes if="$1" skip=`grep -Fabom1 "\`printf \"\\\\\3757zXZ\"\`" "$1" | cut -d: -f1`
    }
    DEB_EXTRACT_COMMAND=fallback_data_extract
    fi
    $DEB_EXTRACT_COMMAND "$UBUNTU_PACKAGE" data.tar.xz | tar xJf - ./usr/lib/chromium-browser/libffmpeg.so --strip 4

    # Check the libffmpeg.so dependencies are resolved
    if LANGUAGE=en ldd libffmpeg.so 2>&1 | grep -qm1 'not \(a dynamic executable\|found\)'; then
    cat <<EOF >&2
    It is not possible to use this alternative libffmpeg on your system.
    Let us know via a post in our forums, mentioning your distro and distro
    version:
    https://forum.vivaldi.net/category/35/vivaldi-browser-for-linux
    EOF
    exit 1
    fi

    # Note the version number for future reference, during upgrades
    echo "INSTALLED_VERSION=$VERSION" > chromium-codecs-ffmpeg-extra-version.txt

    # Install the files
    install -Dm644 libffmpeg.so "$HOME/.local/lib/vivaldi/libffmpeg.so"
    install -Dm644 chromium-codecs-ffmpeg-extra-version.txt "$HOME/.local/lib/vivaldi/chromium-codecs-ffmpeg-extra-version.txt"

    # Tell the user we are done
    cat <<EOF
    The following files were installed onto your system:
    $HOME/.local/lib/vivaldi/libffmpeg.so
    $HOME/.local/lib/vivaldi/chromium-codecs-ffmpeg-extra-version.txt
    Restart Vivaldi and test H.264/MP4 support via this page:
    http://www.quirksmode.org/html5/tests/video.html
    EOF
  2. ruario revised this gist Oct 9, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion latest-proprietary-media.sh
    Original file line number Diff line number Diff line change
    @@ -12,7 +12,7 @@ if [ -r /etc/os-release ] && grep -qx 'ID=ubuntu' /etc/os-release; then
    fi

    # Make sure the user is not runing as superuser
    if [ "$UID" = "0" ]; then
    if [ "$USER" = "root" ]; then
    echo 'Do not run this script as root or via sudo. Run it as your normal user.' >&2
    exit 1
    fi
  3. ruario revised this gist Sep 29, 2018. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions h264-vivaldi-linux.md
    Original file line number Diff line number Diff line change
    @@ -48,8 +48,7 @@ Fetch it like so (adjusting the package name as needed):

    To Extract out the lib and install it for Vivaldi's usage, enter the following (adjusting the package name as needed):

    ar p chromium-codecs-ffmpeg-extra_69.0.3497.81*.deb data.tar.xz | tar Jx ./usr/lib/chromium-browser/libffmpeg.so --strip 4
    install -Dm644 libffmpeg.so "$HOME/.local/lib/vivaldi/libffmpeg.so"
    ar p chromium-codecs-ffmpeg-extra_69.0.3497.81*.deb data.tar.xz | tar xJ -C ~ --wildcards \*libffmpeg.so --xform 's,.*/,.local/lib/vivaldi/,'

    Next time you restart Vivaldi it should find this library and use it to decode proprietary media.

  4. ruario revised this gist Sep 26, 2018. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions h264-vivaldi-linux.md
    Original file line number Diff line number Diff line change
    @@ -44,11 +44,11 @@ First, have a look in http://security.ubuntu.com/ubuntu/pool/universe/c/chromium

    Fetch it like so (adjusting the package name as needed):

    wget http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/chromium-codecs-ffmpeg-extra_66.0.3359.181-0ubuntu0.16.04.1_amd64.deb
    wget http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/chromium-codecs-ffmpeg-extra_69.0.3497.81-0ubuntu0.16.04.1_amd64.deb

    To Extract out the lib and install it for Vivaldi's usage, enter the following (adjusting the package name as needed):

    ar p chromium-codecs-ffmpeg-extra_66.0.3359.181*.deb data.tar.xz | tar Jx ./usr/lib/chromium-browser/libffmpeg.so --strip 4
    ar p chromium-codecs-ffmpeg-extra_69.0.3497.81*.deb data.tar.xz | tar Jx ./usr/lib/chromium-browser/libffmpeg.so --strip 4
    install -Dm644 libffmpeg.so "$HOME/.local/lib/vivaldi/libffmpeg.so"

    Next time you restart Vivaldi it should find this library and use it to decode proprietary media.
  5. ruario revised this gist Sep 19, 2018. 1 changed file with 16 additions and 14 deletions.
    30 changes: 16 additions & 14 deletions latest-proprietary-media.sh
    Original file line number Diff line number Diff line change
    @@ -18,7 +18,7 @@ if [ "$UID" = "0" ]; then
    fi

    available () {
    command -v $1 >/dev/null 2>&1
    command -v "$1" >/dev/null 2>&1
    }

    # Make sure we have wget or curl
    @@ -34,25 +34,25 @@ else
    fi

    # Set temp dir
    TMP=${TMP:-/tmp}
    TMP="${TMP:-/tmp}"

    # Set staging dir
    STAGINGDIR=$TMP/chromium-codecs-ffmpeg-extra-staging
    STAGINGDIR="$TMP/chromium-codecs-ffmpeg-extra-staging"

    # Setup Arch
    case $(uname -m) in
    x86_64) ARCH=x86_64; DEB_ARCH=amd64; REPO=http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/ ;;
    i?86) ARCH=i386; DEB_ARCH=i386; REPO=http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/ ;;
    arm*) ARCH=armhf; DEB_ARCH=armhf; REPO=http://ports.ubuntu.com/ubuntu-ports/pool/universe/c/chromium-browser/ ;;
    aarch64) ARCH=arm64; DEB_ARCH=arm64; REPO=http://ports.ubuntu.com/ubuntu-ports/pool/universe/c/chromium-browser/ ;;
    case `uname -m` in
    x86_64) DEB_ARCH=amd64; REPO=http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/ ;;
    i?86) DEB_ARCH=i386; REPO=http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/ ;;
    arm*) DEB_ARCH=armhf; REPO=http://ports.ubuntu.com/ubuntu-ports/pool/universe/c/chromium-browser/ ;;
    aarch64) DEB_ARCH=arm64; REPO=http://ports.ubuntu.com/ubuntu-ports/pool/universe/c/chromium-browser/ ;;
    esac

    # Work out the VERSION
    # Limit the UBUNTU version to 16.04 to avoid the glibc bump in 18.04, so that this works for older distros
    UBUNTU_PACKAGE=$(${SILENT_DL} $REPO | sed -rn "s/.*(chromium-codecs-ffmpeg-extra_([0-9]+\.){3}[0-9]+-[0-9]ubuntu[0-9]\.16\.04\.[1-9]_$DEB_ARCH.deb).*/\1/p" | sort | tail -n 1)
    UBUNTU_PACKAGE=`${SILENT_DL} "$REPO" | sed -rn "s/.*(chromium-codecs-ffmpeg-extra_([0-9]+\.){3}[0-9]+-[0-9]ubuntu[0-9]\.16\.04\.[1-9]_$DEB_ARCH.deb).*/\1/p" | sort | tail -n 1`
    ## The original match was
    ## UBUNTU_PACKAGE=$(${SILENT_DL} $REPO | sed -rn "s/.*(chromium-codecs-ffmpeg-extra_([0-9]+\.){3}[0-9]+-[0-9]ubuntu[0-9]\.([0-9]{2}\.){2}[0-9\.]*_$DEB_ARCH.deb).*/\1/p" | sort | tail -n 1)
    VERSION=$(echo "${UBUNTU_PACKAGE}" | sed -rn "s/.*_(([0-9]+\.){3}[0-9]+)-.*/\1/p")
    ## UBUNTU_PACKAGE=`${SILENT_DL} "$REPO" | sed -rn "s/.*(chromium-codecs-ffmpeg-extra_([0-9]+\.){3}[0-9]+-[0-9]ubuntu[0-9]\.([0-9]{2}\.){2}[0-9\.]*_$DEB_ARCH.deb).*/\1/p" | sort | tail -n 1`
    VERSION=`echo "$UBUNTU_PACKAGE" | sed -rn "s/.*_(([0-9]+\.){3}[0-9]+)-.*/\1/p"`

    # Error out if $VERISON is unset, e.g. because previous command failed
    if [ -z "$VERSION" ]; then
    @@ -91,10 +91,12 @@ if available bsdtar; then
    elif available ar; then
    DEB_EXTRACT_COMMAND='ar p'
    else
    echo 'You must install BSD tar or GNU binutils to use this script.' >&2
    exit 1
    fallback_data_extract () {
    dd status=none iflag=skip_bytes if="$1" skip=`grep -Fabom1 "\`printf \"\\\\\3757zXZ\"\`" "$1" | cut -d: -f1`
    }
    DEB_EXTRACT_COMMAND=fallback_data_extract
    fi
    $DEB_EXTRACT_COMMAND ${UBUNTU_PACKAGE} data.tar.xz | tar xJf - ./usr/lib/chromium-browser/libffmpeg.so --strip 4
    $DEB_EXTRACT_COMMAND "$UBUNTU_PACKAGE" data.tar.xz | tar xJf - ./usr/lib/chromium-browser/libffmpeg.so --strip 4

    # Check the libffmpeg.so dependencies are resolved
    if LANGUAGE=en ldd libffmpeg.so 2>&1 | grep -qm1 'not \(a dynamic executable\|found\)'; then
  6. ruario revised this gist Sep 15, 2018. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions latest-proprietary-media.sh
    Original file line number Diff line number Diff line change
    @@ -41,10 +41,10 @@ STAGINGDIR=$TMP/chromium-codecs-ffmpeg-extra-staging

    # Setup Arch
    case $(uname -m) in
    x86_64) ARCH=x86_64; DEB_ARCH=amd64; REPO=http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/ ;;
    i?86) ARCH=i386; DEB_ARCH=i386; REPO=http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/ ;;
    armhf) ARCH=armhf; DEB_ARCH=armhf; REPO=http://ports.ubuntu.com/ubuntu-ports/pool/universe/c/chromium-browser/ ;;
    arm64) ARCH=arm64; DEB_ARCH=arm64; REPO=http://ports.ubuntu.com/ubuntu-ports/pool/universe/c/chromium-browser/ ;;
    x86_64) ARCH=x86_64; DEB_ARCH=amd64; REPO=http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/ ;;
    i?86) ARCH=i386; DEB_ARCH=i386; REPO=http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/ ;;
    arm*) ARCH=armhf; DEB_ARCH=armhf; REPO=http://ports.ubuntu.com/ubuntu-ports/pool/universe/c/chromium-browser/ ;;
    aarch64) ARCH=arm64; DEB_ARCH=arm64; REPO=http://ports.ubuntu.com/ubuntu-ports/pool/universe/c/chromium-browser/ ;;
    esac

    # Work out the VERSION
  7. ruario revised this gist Jul 17, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion h264-vivaldi-linux.md
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@ The following is a quick guide to get this working on various Linux distros. As

    If you don't have working Flash video and need that in addition, please refer to [these instructions](https://gist.github.com/ruario/215c365facfe8d3c5071).

    **Note:** *This guide is primarrily aimed at users of Vivaldi stable releases. If it does not solve your issues, [read this](https://gist.github.com/ruario/4eecac838ebfd3a7a164b4f4ee850f30) in addition.*
    **Note:** *This guide is primarily aimed at users of Vivaldi stable releases. If it does not solve your issues, [read this](https://gist.github.com/ruario/4eecac838ebfd3a7a164b4f4ee850f30) in addition.*

    ### Ubuntu

  8. ruario revised this gist Jun 4, 2018. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions h264-vivaldi-linux.md
    Original file line number Diff line number Diff line change
    @@ -44,11 +44,11 @@ First, have a look in http://security.ubuntu.com/ubuntu/pool/universe/c/chromium

    Fetch it like so (adjusting the package name as needed):

    wget http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/chromium-codecs-ffmpeg-extra_65.0.3325.181-0ubuntu0.16.04.1_amd64.deb
    wget http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/chromium-codecs-ffmpeg-extra_66.0.3359.181-0ubuntu0.16.04.1_amd64.deb

    To Extract out the lib and install it for Vivaldi's usage, enter the following (adjusting the package name as needed):

    ar p chromium-codecs-ffmpeg-extra_65.0.3325.181*.deb data.tar.xz | tar Jx ./usr/lib/chromium-browser/libffmpeg.so --strip 4
    ar p chromium-codecs-ffmpeg-extra_66.0.3359.181*.deb data.tar.xz | tar Jx ./usr/lib/chromium-browser/libffmpeg.so --strip 4
    install -Dm644 libffmpeg.so "$HOME/.local/lib/vivaldi/libffmpeg.so"

    Next time you restart Vivaldi it should find this library and use it to decode proprietary media.
  9. ruario revised this gist May 23, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion latest-proprietary-media.sh
    Original file line number Diff line number Diff line change
    @@ -49,7 +49,7 @@ esac

    # Work out the VERSION
    # Limit the UBUNTU version to 16.04 to avoid the glibc bump in 18.04, so that this works for older distros
    UBUNTU_PACKAGE=$(${SILENT_DL} $REPO | sed -rn "s/.*(chromium-codecs-ffmpeg-extra_([0-9]+\.){3}[0-9]+-[0-9]ubuntu[0-9]\.16.04.[1-9]_$DEB_ARCH.deb).*/\1/p" | sort | tail -n 1)
    UBUNTU_PACKAGE=$(${SILENT_DL} $REPO | sed -rn "s/.*(chromium-codecs-ffmpeg-extra_([0-9]+\.){3}[0-9]+-[0-9]ubuntu[0-9]\.16\.04\.[1-9]_$DEB_ARCH.deb).*/\1/p" | sort | tail -n 1)
    ## The original match was
    ## UBUNTU_PACKAGE=$(${SILENT_DL} $REPO | sed -rn "s/.*(chromium-codecs-ffmpeg-extra_([0-9]+\.){3}[0-9]+-[0-9]ubuntu[0-9]\.([0-9]{2}\.){2}[0-9\.]*_$DEB_ARCH.deb).*/\1/p" | sort | tail -n 1)
    VERSION=$(echo "${UBUNTU_PACKAGE}" | sed -rn "s/.*_(([0-9]+\.){3}[0-9]+)-.*/\1/p")
  10. ruario revised this gist Apr 27, 2018. 2 changed files with 7 additions and 4 deletions.
    6 changes: 3 additions & 3 deletions h264-vivaldi-linux.md
    Original file line number Diff line number Diff line change
    @@ -40,15 +40,15 @@ If your distro does not provide a package with a suitable library or one is not

    If you would prefer not use a script, here is a short summary of how to do this manually.

    First, have a look in http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/ for a “chromium-codecs-ffmpeg-extra” package from a recent Ubuntu version.
    First, have a look in http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/ for a “chromium-codecs-ffmpeg-extra” package from Ubuntu 16.04.

    Fetch it like so (adjusting the package name as needed):

    wget http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/chromium-codecs-ffmpeg-extra_63.0.3239.84-0ubuntu0.17.10.1_amd64.deb
    wget http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/chromium-codecs-ffmpeg-extra_65.0.3325.181-0ubuntu0.16.04.1_amd64.deb

    To Extract out the lib and install it for Vivaldi's usage, enter the following (adjusting the package name as needed):

    ar p chromium-codecs-ffmpeg-extra_63.0.3239.84*.deb data.tar.xz | tar Jx ./usr/lib/chromium-browser/libffmpeg.so --strip 4
    ar p chromium-codecs-ffmpeg-extra_65.0.3325.181*.deb data.tar.xz | tar Jx ./usr/lib/chromium-browser/libffmpeg.so --strip 4
    install -Dm644 libffmpeg.so "$HOME/.local/lib/vivaldi/libffmpeg.so"

    Next time you restart Vivaldi it should find this library and use it to decode proprietary media.
    5 changes: 4 additions & 1 deletion latest-proprietary-media.sh
    Original file line number Diff line number Diff line change
    @@ -48,7 +48,10 @@ case $(uname -m) in
    esac

    # Work out the VERSION
    UBUNTU_PACKAGE=$(${SILENT_DL} $REPO | sed -rn "s/.*(chromium-codecs-ffmpeg-extra_([0-9]+\.){3}[0-9]+-[0-9]ubuntu[0-9]\.([0-9]{2}\.){2}[0-9\.]*_$DEB_ARCH.deb).*/\1/p" | sort | tail -n 1)
    # Limit the UBUNTU version to 16.04 to avoid the glibc bump in 18.04, so that this works for older distros
    UBUNTU_PACKAGE=$(${SILENT_DL} $REPO | sed -rn "s/.*(chromium-codecs-ffmpeg-extra_([0-9]+\.){3}[0-9]+-[0-9]ubuntu[0-9]\.16.04.[1-9]_$DEB_ARCH.deb).*/\1/p" | sort | tail -n 1)
    ## The original match was
    ## UBUNTU_PACKAGE=$(${SILENT_DL} $REPO | sed -rn "s/.*(chromium-codecs-ffmpeg-extra_([0-9]+\.){3}[0-9]+-[0-9]ubuntu[0-9]\.([0-9]{2}\.){2}[0-9\.]*_$DEB_ARCH.deb).*/\1/p" | sort | tail -n 1)
    VERSION=$(echo "${UBUNTU_PACKAGE}" | sed -rn "s/.*_(([0-9]+\.){3}[0-9]+)-.*/\1/p")

    # Error out if $VERISON is unset, e.g. because previous command failed
  11. ruario revised this gist Apr 27, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion h264-vivaldi-linux.md
    Original file line number Diff line number Diff line change
    @@ -30,7 +30,7 @@ If you want to use the latest snapshot, install [vivaldi-snapshot](https://aur.a

    Alternatively, you can also get both of these packages from from the unofficial [[herecura]](http://repo.herecura.eu/) repo.

    **Note:** Do not use the herecura repo, if you use related distros like Chakra and Manjaro. These are not real “Arch Linux” and have differences that ar great enough that you are likely to encounter problems (if not right away then some time in the future).
    **Note:** Do not use the herecura repo, if you use related distros like Chakra and Manjaro. These are not real “Arch Linux” and have differences that are great enough, that you are likely to encounter problems (if not right away, then some time in the future).

    After installing from the AUR or the linked unofficial repository, will now need to restart Vivaldi. You can then test support on [this page](http://www.quirksmode.org/html5/tests/video.html).

  12. ruario revised this gist Apr 27, 2018. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion h264-vivaldi-linux.md
    Original file line number Diff line number Diff line change
    @@ -28,7 +28,9 @@ If you want to use the latest snapshot, install [vivaldi-snapshot](https://aur.a

    #### Install from the unofficial herecura repo

    Alternatively, you can also get both of these packages from from the unofficial [[herecura]](http://repo.herecura.eu/) repo.
    Alternatively, you can also get both of these packages from from the unofficial [[herecura]](http://repo.herecura.eu/) repo.

    **Note:** Do not use the herecura repo, if you use related distros like Chakra and Manjaro. These are not real “Arch Linux” and have differences that ar great enough that you are likely to encounter problems (if not right away then some time in the future).

    After installing from the AUR or the linked unofficial repository, will now need to restart Vivaldi. You can then test support on [this page](http://www.quirksmode.org/html5/tests/video.html).

  13. ruario revised this gist Apr 27, 2018. 2 changed files with 20 additions and 2 deletions.
    2 changes: 1 addition & 1 deletion h264-vivaldi-linux.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # How to enable HTML5 MP4 (H.264/AAC) video and MP3 audio in Vivaldi for Linux, via an alternative FFMpeg library
    # How to enable HTML5 MP4 (H.264/AAC) video in Vivaldi for Linux, via an alternative FFMpeg library

    ## Intro

    20 changes: 19 additions & 1 deletion latest-proprietary-media.sh
    Original file line number Diff line number Diff line change
    @@ -43,7 +43,8 @@ STAGINGDIR=$TMP/chromium-codecs-ffmpeg-extra-staging
    case $(uname -m) in
    x86_64) ARCH=x86_64; DEB_ARCH=amd64; REPO=http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/ ;;
    i?86) ARCH=i386; DEB_ARCH=i386; REPO=http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/ ;;
    arm*) ARCH=arm; DEB_ARCH=armhf; REPO=http://ports.ubuntu.com/ubuntu-ports/pool/universe/c/chromium-browser/ ;;
    armhf) ARCH=armhf; DEB_ARCH=armhf; REPO=http://ports.ubuntu.com/ubuntu-ports/pool/universe/c/chromium-browser/ ;;
    arm64) ARCH=arm64; DEB_ARCH=arm64; REPO=http://ports.ubuntu.com/ubuntu-ports/pool/universe/c/chromium-browser/ ;;
    esac

    # Work out the VERSION
    @@ -91,6 +92,23 @@ else
    exit 1
    fi
    $DEB_EXTRACT_COMMAND ${UBUNTU_PACKAGE} data.tar.xz | tar xJf - ./usr/lib/chromium-browser/libffmpeg.so --strip 4

    # Check the libffmpeg.so dependencies are resolved
    if LANGUAGE=en ldd libffmpeg.so 2>&1 | grep -qm1 'not \(a dynamic executable\|found\)'; then
    cat <<EOF >&2
    It is not possible to use this alternative libffmpeg on your system.
    Let us know via a post in our forums, mentioning your distro and distro
    version:
    https://forum.vivaldi.net/category/35/vivaldi-browser-for-linux
    EOF
    exit 1
    fi

    # Note the version number for future reference, during upgrades
    echo "INSTALLED_VERSION=$VERSION" > chromium-codecs-ffmpeg-extra-version.txt

    # Install the files
  14. ruario revised this gist Jan 19, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion h264-vivaldi-linux.md
    Original file line number Diff line number Diff line change
    @@ -46,7 +46,7 @@ Fetch it like so (adjusting the package name as needed):

    To Extract out the lib and install it for Vivaldi's usage, enter the following (adjusting the package name as needed):

    ar p chromium-codecs-ffmpeg-extra_*.deb data.tar.xz | tar Jx ./usr/lib/chromium-browser/libffmpeg.so --strip 4
    ar p chromium-codecs-ffmpeg-extra_63.0.3239.84*.deb data.tar.xz | tar Jx ./usr/lib/chromium-browser/libffmpeg.so --strip 4
    install -Dm644 libffmpeg.so "$HOME/.local/lib/vivaldi/libffmpeg.so"

    Next time you restart Vivaldi it should find this library and use it to decode proprietary media.
  15. ruario revised this gist Jan 19, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion h264-vivaldi-linux.md
    Original file line number Diff line number Diff line change
    @@ -42,7 +42,7 @@ First, have a look in http://security.ubuntu.com/ubuntu/pool/universe/c/chromium

    Fetch it like so (adjusting the package name as needed):

    wget http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/chromium-codecs-ffmpeg-extra_62.0.3202.94-0ubuntu0.17.10.1388_amd64.deb
    wget http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/chromium-codecs-ffmpeg-extra_63.0.3239.84-0ubuntu0.17.10.1_amd64.deb

    To Extract out the lib and install it for Vivaldi's usage, enter the following (adjusting the package name as needed):

  16. ruario revised this gist Jan 19, 2018. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions h264-vivaldi-linux.md
    Original file line number Diff line number Diff line change
    @@ -6,6 +6,8 @@ The following is a quick guide to get this working on various Linux distros. As

    If you don't have working Flash video and need that in addition, please refer to [these instructions](https://gist.github.com/ruario/215c365facfe8d3c5071).

    **Note:** *This guide is primarrily aimed at users of Vivaldi stable releases. If it does not solve your issues, [read this](https://gist.github.com/ruario/4eecac838ebfd3a7a164b4f4ee850f30) in addition.*

    ### Ubuntu

    #### Install chromium-codecs-ffmpeg-extra
  17. ruario revised this gist Jan 19, 2018. 1 changed file with 0 additions and 119 deletions.
    119 changes: 0 additions & 119 deletions latest-proprietary-media-future.sh
    Original file line number Diff line number Diff line change
    @@ -1,119 +0,0 @@
    #!/bin/sh

    # Warn the user that this might not be the appropriate script
    cat <<EOW >&2
    This script installs the Chromium beta libffmpeg.so from the Saikrishna
    Arcot PPA (saiarcot895). You only need to do this if you are running
    a Vivaldi Snapshot with a newer Chromium engine that the current
    Chromium stable. If this is not the case you should use
    "latest-proprietary-media.sh" instead.
    EOW
    sleep 1

    available () {
    command -v $1 >/dev/null 2>&1
    }

    # Make sure we have wget or curl
    if available wget; then
    SILENT_DL="wget -qO-"
    LOUD_DL="wget"
    elif available curl; then
    SILENT_DL="curl -sL"
    LOUD_DL="curl -O"
    else
    echo "Install Wget or cURL" >&2
    exit 1
    fi

    # Set temp dir
    TMP=${TMP:-/tmp}

    # Set staging dir
    STAGINGDIR=$TMP/chromium-codecs-ffmpeg-extra-staging-future

    # Setup Arch
    case $(uname -m) in
    x86_64) ARCH=x86_64; DEB_ARCH=amd64 ;;
    i?86) ARCH=i386; DEB_ARCH=i386 ;;
    arm*) ARCH=arm; DEB_ARCH=armhf ;;
    esac

    # Use a PPA containing Chromium beta as the source of libs
    REPO=http://ppa.launchpad.net/saiarcot895/chromium-beta/ubuntu/pool/main/c/chromium-browser/

    # Work out the VERSION
    UBUNTU_PACKAGE=$(${SILENT_DL} $REPO | sed -rn "s/.*(chromium-codecs-ffmpeg-extra_([0-9]+\.){3}[0-9]+-[0-9]ubuntu[0-9]\~ppa[12]\~([0-9]{2}\.){2}[0-9\.]*_$DEB_ARCH.deb).*/\1/p" | sort | tail -n 1)
    VERSION=$(echo "${UBUNTU_PACKAGE}" | sed -rn "s/.*_(([0-9]+\.){3}[0-9]+)-.*/\1/p")

    # Error out if $VERISON is unset, e.g. because previous command failed
    if [ -z "$VERSION" ]; then
    echo "Could not work out the latest version; exiting" >&2
    exit 1
    fi

    # Don't start repackaging if the same version is already installed
    if [ -r "/opt/vivaldi-snapshot/chromium-codecs-ffmpeg-extra-version.txt" ]; then
    . "/opt/vivaldi-snapshot/chromium-codecs-ffmpeg-extra-version.txt"
    if [ "$INSTALLED_VERSION" = "$VERSION" ]; then
    echo "The latest chromium-codecs-ffmpeg-extra ($VERSION) is already installed"
    exit 0
    fi
    fi

    # Now we could screw things up so exit on first error
    set -e

    # If the staging directory is already present from the past, clear it down
    # and re-create it.
    if [ -d "$STAGINGDIR" ]; then
    rm -fr "$STAGINGDIR"
    fi

    mkdir "$STAGINGDIR"
    cd "$STAGINGDIR"

    # Now get the deb package
    $LOUD_DL "$REPO$UBUNTU_PACKAGE"

    # Extract the contents of the chromium-codecs-ffmpeg-extra package
    if available bsdtar; then
    DEB_EXTRACT_COMMAND='bsdtar xOf'
    elif available ar; then
    DEB_EXTRACT_COMMAND='ar p'
    else
    echo 'You must install BSD tar or GNU binutils to use this script.' >&2
    exit 1
    fi
    $DEB_EXTRACT_COMMAND ${UBUNTU_PACKAGE} data.tar.xz | tar xJf - ./usr/lib/chromium-browser/libffmpeg.so --strip 4
    echo "INSTALLED_VERSION=$VERSION" > chromium-codecs-ffmpeg-extra-version.txt

    # Escalate privileges if needed and install the files
    if [ "$(whoami)" = "root" ]; then
    install -m644 libffmpeg.so /opt/vivaldi-snapshot/libffmpeg.so
    install -m644 chromium-codecs-ffmpeg-extra-version.txt /opt/vivaldi-snapshot/chromium-codecs-ffmpeg-extra-version.txt
    rm -r "$STAGINGDIR" # Cleanup if root to prevent the script running as a regular user in the future
    elif [ -r /etc/os-release ] && grep -qx 'ID=ubuntu' /etc/os-release; then
    echo "Calling sudo ... (if prompted, please enter your password, so files can be copied into place)"
    sudo install -m644 libffmpeg.so /opt/vivaldi-snapshot/libffmpeg.so
    sudo install -m644 chromium-codecs-ffmpeg-extra-version.txt /opt/vivaldi-snapshot/chromium-codecs-ffmpeg-extra-version.txt
    else
    echo "Please enter your root password so files can be copied into place (or re-run this script via sudo)"
    su -c "sh -c \"install -m644 libffmpeg.so /opt/vivaldi-snapshot/libffmpeg.so && install -m644 chromium-codecs-ffmpeg-extra-version.txt /opt/vivaldi-snapshot/chromium-codecs-ffmpeg-extra-version.txt\""
    fi

    # Tell the user we are done
    cat <<EOF
    The following files were installed onto your system:
    /opt/vivaldi-snapshot/libffmpeg.so
    /opt/vivaldi-snapshot/chromium-codecs-ffmpeg-extra-version.txt
    Restart Vivaldi and test H.264/MP4 support via this page:
    http://www.quirksmode.org/html5/tests/video.html
    EOF
  18. ruario revised this gist Jan 19, 2018. 1 changed file with 119 additions and 0 deletions.
    119 changes: 119 additions & 0 deletions latest-proprietary-media-future.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,119 @@
    #!/bin/sh

    # Warn the user that this might not be the appropriate script
    cat <<EOW >&2
    This script installs the Chromium beta libffmpeg.so from the Saikrishna
    Arcot PPA (saiarcot895). You only need to do this if you are running
    a Vivaldi Snapshot with a newer Chromium engine that the current
    Chromium stable. If this is not the case you should use
    "latest-proprietary-media.sh" instead.
    EOW
    sleep 1

    available () {
    command -v $1 >/dev/null 2>&1
    }

    # Make sure we have wget or curl
    if available wget; then
    SILENT_DL="wget -qO-"
    LOUD_DL="wget"
    elif available curl; then
    SILENT_DL="curl -sL"
    LOUD_DL="curl -O"
    else
    echo "Install Wget or cURL" >&2
    exit 1
    fi

    # Set temp dir
    TMP=${TMP:-/tmp}

    # Set staging dir
    STAGINGDIR=$TMP/chromium-codecs-ffmpeg-extra-staging-future

    # Setup Arch
    case $(uname -m) in
    x86_64) ARCH=x86_64; DEB_ARCH=amd64 ;;
    i?86) ARCH=i386; DEB_ARCH=i386 ;;
    arm*) ARCH=arm; DEB_ARCH=armhf ;;
    esac

    # Use a PPA containing Chromium beta as the source of libs
    REPO=http://ppa.launchpad.net/saiarcot895/chromium-beta/ubuntu/pool/main/c/chromium-browser/

    # Work out the VERSION
    UBUNTU_PACKAGE=$(${SILENT_DL} $REPO | sed -rn "s/.*(chromium-codecs-ffmpeg-extra_([0-9]+\.){3}[0-9]+-[0-9]ubuntu[0-9]\~ppa[12]\~([0-9]{2}\.){2}[0-9\.]*_$DEB_ARCH.deb).*/\1/p" | sort | tail -n 1)
    VERSION=$(echo "${UBUNTU_PACKAGE}" | sed -rn "s/.*_(([0-9]+\.){3}[0-9]+)-.*/\1/p")

    # Error out if $VERISON is unset, e.g. because previous command failed
    if [ -z "$VERSION" ]; then
    echo "Could not work out the latest version; exiting" >&2
    exit 1
    fi

    # Don't start repackaging if the same version is already installed
    if [ -r "/opt/vivaldi-snapshot/chromium-codecs-ffmpeg-extra-version.txt" ]; then
    . "/opt/vivaldi-snapshot/chromium-codecs-ffmpeg-extra-version.txt"
    if [ "$INSTALLED_VERSION" = "$VERSION" ]; then
    echo "The latest chromium-codecs-ffmpeg-extra ($VERSION) is already installed"
    exit 0
    fi
    fi

    # Now we could screw things up so exit on first error
    set -e

    # If the staging directory is already present from the past, clear it down
    # and re-create it.
    if [ -d "$STAGINGDIR" ]; then
    rm -fr "$STAGINGDIR"
    fi

    mkdir "$STAGINGDIR"
    cd "$STAGINGDIR"

    # Now get the deb package
    $LOUD_DL "$REPO$UBUNTU_PACKAGE"

    # Extract the contents of the chromium-codecs-ffmpeg-extra package
    if available bsdtar; then
    DEB_EXTRACT_COMMAND='bsdtar xOf'
    elif available ar; then
    DEB_EXTRACT_COMMAND='ar p'
    else
    echo 'You must install BSD tar or GNU binutils to use this script.' >&2
    exit 1
    fi
    $DEB_EXTRACT_COMMAND ${UBUNTU_PACKAGE} data.tar.xz | tar xJf - ./usr/lib/chromium-browser/libffmpeg.so --strip 4
    echo "INSTALLED_VERSION=$VERSION" > chromium-codecs-ffmpeg-extra-version.txt

    # Escalate privileges if needed and install the files
    if [ "$(whoami)" = "root" ]; then
    install -m644 libffmpeg.so /opt/vivaldi-snapshot/libffmpeg.so
    install -m644 chromium-codecs-ffmpeg-extra-version.txt /opt/vivaldi-snapshot/chromium-codecs-ffmpeg-extra-version.txt
    rm -r "$STAGINGDIR" # Cleanup if root to prevent the script running as a regular user in the future
    elif [ -r /etc/os-release ] && grep -qx 'ID=ubuntu' /etc/os-release; then
    echo "Calling sudo ... (if prompted, please enter your password, so files can be copied into place)"
    sudo install -m644 libffmpeg.so /opt/vivaldi-snapshot/libffmpeg.so
    sudo install -m644 chromium-codecs-ffmpeg-extra-version.txt /opt/vivaldi-snapshot/chromium-codecs-ffmpeg-extra-version.txt
    else
    echo "Please enter your root password so files can be copied into place (or re-run this script via sudo)"
    su -c "sh -c \"install -m644 libffmpeg.so /opt/vivaldi-snapshot/libffmpeg.so && install -m644 chromium-codecs-ffmpeg-extra-version.txt /opt/vivaldi-snapshot/chromium-codecs-ffmpeg-extra-version.txt\""
    fi

    # Tell the user we are done
    cat <<EOF
    The following files were installed onto your system:
    /opt/vivaldi-snapshot/libffmpeg.so
    /opt/vivaldi-snapshot/chromium-codecs-ffmpeg-extra-version.txt
    Restart Vivaldi and test H.264/MP4 support via this page:
    http://www.quirksmode.org/html5/tests/video.html
    EOF
  19. ruario revised this gist Dec 19, 2017. 1 changed file with 5 additions and 4 deletions.
    9 changes: 5 additions & 4 deletions latest-proprietary-media.sh
    Original file line number Diff line number Diff line change
    @@ -41,12 +41,13 @@ STAGINGDIR=$TMP/chromium-codecs-ffmpeg-extra-staging

    # Setup Arch
    case $(uname -m) in
    x86_64) ARCH=x86_64; DEB_ARCH=amd64 ;;
    i?86) ARCH=i386; DEB_ARCH=i386 ;;
    x86_64) ARCH=x86_64; DEB_ARCH=amd64; REPO=http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/ ;;
    i?86) ARCH=i386; DEB_ARCH=i386; REPO=http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/ ;;
    arm*) ARCH=arm; DEB_ARCH=armhf; REPO=http://ports.ubuntu.com/ubuntu-ports/pool/universe/c/chromium-browser/ ;;
    esac

    # Work out the VERSION
    UBUNTU_PACKAGE=$(${SILENT_DL} http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/ | sed -rn "s/.*(chromium-codecs-ffmpeg-extra_([0-9]+\.){3}[0-9]+-[0-9]ubuntu[0-9]\.([0-9]{2}\.){2}[0-9\.]*_$DEB_ARCH.deb).*/\1/p" | sort | tail -n 1)
    UBUNTU_PACKAGE=$(${SILENT_DL} $REPO | sed -rn "s/.*(chromium-codecs-ffmpeg-extra_([0-9]+\.){3}[0-9]+-[0-9]ubuntu[0-9]\.([0-9]{2}\.){2}[0-9\.]*_$DEB_ARCH.deb).*/\1/p" | sort | tail -n 1)
    VERSION=$(echo "${UBUNTU_PACKAGE}" | sed -rn "s/.*_(([0-9]+\.){3}[0-9]+)-.*/\1/p")

    # Error out if $VERISON is unset, e.g. because previous command failed
    @@ -77,7 +78,7 @@ mkdir "$STAGINGDIR"
    cd "$STAGINGDIR"

    # Now get the deb package
    $LOUD_DL "http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/${UBUNTU_PACKAGE}"
    $LOUD_DL "$REPO$UBUNTU_PACKAGE"


    # Extract the contents of the chromium-codecs-ffmpeg-extra package
  20. ruario revised this gist Dec 19, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion h264-vivaldi-linux.md
    Original file line number Diff line number Diff line change
    @@ -44,7 +44,7 @@ Fetch it like so (adjusting the package name as needed):

    To Extract out the lib and install it for Vivaldi's usage, enter the following (adjusting the package name as needed):

    ar p chromium-codecs-ffmpeg-extra_62.0.3202.94-0ubuntu0.17.10.1388_amd64.deb data.tar.xz | tar Jx ./usr/lib/chromium-browser/libffmpeg.so --strip 4
    ar p chromium-codecs-ffmpeg-extra_*.deb data.tar.xz | tar Jx ./usr/lib/chromium-browser/libffmpeg.so --strip 4
    install -Dm644 libffmpeg.so "$HOME/.local/lib/vivaldi/libffmpeg.so"

    Next time you restart Vivaldi it should find this library and use it to decode proprietary media.
  21. ruario revised this gist Dec 7, 2017. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions h264-vivaldi-linux.md
    Original file line number Diff line number Diff line change
    @@ -36,9 +36,9 @@ If your distro does not provide a package with a suitable library or one is not

    If you would prefer not use a script, here is a short summary of how to do this manually.

    First, have a look in http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/ for a *chromium-codecs-ffmpeg-extra* package from a recent Ubuntu version. At the time of writing these instructions *chromium-codecs-ffmpeg-extra_62.0.3202.94-0ubuntu0.17.10.1388_amd64.deb*, would be such a package.
    First, have a look in http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/ for a chromium-codecs-ffmpeg-extra package from a recent Ubuntu version.

    Fetch it like so:
    Fetch it like so (adjusting the package name as needed):

    wget http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/chromium-codecs-ffmpeg-extra_62.0.3202.94-0ubuntu0.17.10.1388_amd64.deb

  22. ruario revised this gist Dec 7, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion h264-vivaldi-linux.md
    Original file line number Diff line number Diff line change
    @@ -42,7 +42,7 @@ Fetch it like so:

    wget http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/chromium-codecs-ffmpeg-extra_62.0.3202.94-0ubuntu0.17.10.1388_amd64.deb

    To Extract out the lib and install it for Vivaldi's usage, enter the following:
    To Extract out the lib and install it for Vivaldi's usage, enter the following (adjusting the package name as needed):

    ar p chromium-codecs-ffmpeg-extra_62.0.3202.94-0ubuntu0.17.10.1388_amd64.deb data.tar.xz | tar Jx ./usr/lib/chromium-browser/libffmpeg.so --strip 4
    install -Dm644 libffmpeg.so "$HOME/.local/lib/vivaldi/libffmpeg.so"
  23. ruario revised this gist Dec 7, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion h264-vivaldi-linux.md
    Original file line number Diff line number Diff line change
    @@ -53,4 +53,4 @@ Next time you restart Vivaldi it should find this library and use it to decode p

    If you want to build your own replacement libffmpeg use the [Arch vivaldi-snapshot-ffmpeg-codecs PKGBUILD](https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=vivaldi-snapshot-ffmpeg-codecs) as a guide.

    If you are a maintainer and intend to repackage Vivaldi browser for your distro, you might want to consider making **vivaldi-ffmpeg-codecs** or **vivaldi-snapshot-ffmpeg-codecs** packages containing a replacement libffmpeg.so library. It is suggested that you place this library in the directory `/opt/vivaldi/` or `/opt/vivaldi-snapshot/` directories respectively. **You will need to update these packages from time to time as Vivaldi ups its Chromium version. If your libffmeg.so is compiled from a Chromium that is too old, it could prevent Vivaldi from displaying any videos and/or cause crashes.**
    If you are a maintainer and intend to repackage Vivaldi browser for your distro, you might want to consider making **vivaldi-ffmpeg-codecs** or **vivaldi-snapshot-ffmpeg-codecs** packages containing a replacement libffmpeg.so library. It is suggested that you place this library in the directory `/opt/vivaldi/` or `/opt/vivaldi-snapshot/` directories respectively. **You will need to update these packages from time to time as Vivaldi ups its Chromium version.**
  24. ruario revised this gist Dec 7, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion h264-vivaldi-linux.md
    Original file line number Diff line number Diff line change
    @@ -34,7 +34,7 @@ After installing from the AUR or the linked unofficial repository, will now need

    If your distro does not provide a package with a suitable library or one is not detected, you can run the script `./latest-proprietary-media.sh` (*included with this gist*) as your normal user (not root) to fetch and install the Ubuntu file. Once installed, simply restart Vivaldi. You can then test support on [this page](http://www.quirksmode.org/html5/tests/video.html).

    If you would prefer not use a script, here is a shrt summary of how to do this manually.
    If you would prefer not use a script, here is a short summary of how to do this manually.

    First, have a look in http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/ for a *chromium-codecs-ffmpeg-extra* package from a recent Ubuntu version. At the time of writing these instructions *chromium-codecs-ffmpeg-extra_62.0.3202.94-0ubuntu0.17.10.1388_amd64.deb*, would be such a package.

  25. ruario revised this gist Dec 7, 2017. 1 changed file with 15 additions and 0 deletions.
    15 changes: 15 additions & 0 deletions h264-vivaldi-linux.md
    Original file line number Diff line number Diff line change
    @@ -34,6 +34,21 @@ After installing from the AUR or the linked unofficial repository, will now need

    If your distro does not provide a package with a suitable library or one is not detected, you can run the script `./latest-proprietary-media.sh` (*included with this gist*) as your normal user (not root) to fetch and install the Ubuntu file. Once installed, simply restart Vivaldi. You can then test support on [this page](http://www.quirksmode.org/html5/tests/video.html).

    If you would prefer not use a script, here is a shrt summary of how to do this manually.

    First, have a look in http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/ for a *chromium-codecs-ffmpeg-extra* package from a recent Ubuntu version. At the time of writing these instructions *chromium-codecs-ffmpeg-extra_62.0.3202.94-0ubuntu0.17.10.1388_amd64.deb*, would be such a package.

    Fetch it like so:

    wget http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/chromium-codecs-ffmpeg-extra_62.0.3202.94-0ubuntu0.17.10.1388_amd64.deb

    To Extract out the lib and install it for Vivaldi's usage, enter the following:

    ar p chromium-codecs-ffmpeg-extra_62.0.3202.94-0ubuntu0.17.10.1388_amd64.deb data.tar.xz | tar Jx ./usr/lib/chromium-browser/libffmpeg.so --strip 4
    install -Dm644 libffmpeg.so "$HOME/.local/lib/vivaldi/libffmpeg.so"

    Next time you restart Vivaldi it should find this library and use it to decode proprietary media.

    ## Building your own replacement libffmpeg.so

    If you want to build your own replacement libffmpeg use the [Arch vivaldi-snapshot-ffmpeg-codecs PKGBUILD](https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=vivaldi-snapshot-ffmpeg-codecs) as a guide.
  26. ruario revised this gist Oct 11, 2017. 1 changed file with 15 additions and 14 deletions.
    29 changes: 15 additions & 14 deletions latest-proprietary-media.sh
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,8 @@
    #!/bin/sh

    # Discourage Ubuntu users from using this script, since they can (and should) install oxideqt-codecs-extra directly
    # Discourage Ubuntu users from using this script, since they can (and should) install chromium-codecs-ffmpeg-extra directly
    if [ -r /etc/os-release ] && grep -qx 'ID=ubuntu' /etc/os-release; then
    echo "You should not use this script on Ubuntu, install oxideqt-codecs-extra via apt instead." >&2
    echo "You should not use this script on Ubuntu, install chromium-codecs-ffmpeg-extra via apt instead." >&2
    read -p "Do you wish to continue anyway? [y/N]: " YN
    case "$YN" in
    [Yy]*) : ;;
    @@ -37,7 +37,7 @@ fi
    TMP=${TMP:-/tmp}

    # Set staging dir
    STAGINGDIR=$TMP/oxideqt-codecs-extra-staging
    STAGINGDIR=$TMP/chromium-codecs-ffmpeg-extra-staging

    # Setup Arch
    case $(uname -m) in
    @@ -46,8 +46,8 @@ case $(uname -m) in
    esac

    # Work out the VERSION
    UBUNTU_PACKAGE=$(${SILENT_DL} http://security.ubuntu.com/ubuntu/pool/main/o/oxide-qt/ | sed -rn "s/.*(oxideqt-codecs-extra_([0-9]+\.){2}[0-9]+-[0-9]ubuntu[0-9]\.([0-9]{2}\.){2}[0-9\.]*_$DEB_ARCH.deb).*/\1/p" | sort | tail -n 1)
    VERSION=$(echo "${UBUNTU_PACKAGE}" | sed -rn "s/.*_(([0-9]+\.){2}[0-9]+)-.*/\1/p")
    UBUNTU_PACKAGE=$(${SILENT_DL} http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/ | sed -rn "s/.*(chromium-codecs-ffmpeg-extra_([0-9]+\.){3}[0-9]+-[0-9]ubuntu[0-9]\.([0-9]{2}\.){2}[0-9\.]*_$DEB_ARCH.deb).*/\1/p" | sort | tail -n 1)
    VERSION=$(echo "${UBUNTU_PACKAGE}" | sed -rn "s/.*_(([0-9]+\.){3}[0-9]+)-.*/\1/p")

    # Error out if $VERISON is unset, e.g. because previous command failed
    if [ -z "$VERSION" ]; then
    @@ -56,10 +56,10 @@ if [ -z "$VERSION" ]; then
    fi

    # Don't start repackaging if the same version is already installed
    if [ -r "$HOME/.local/lib/vivaldi/oxideqt-codecs-extra-version.txt" ]; then
    . "$HOME/.local/lib/vivaldi/oxideqt-codecs-extra-version.txt"
    if [ -r "$HOME/.local/lib/vivaldi/chromium-codecs-ffmpeg-extra-version.txt" ]; then
    . "$HOME/.local/lib/vivaldi/chromium-codecs-ffmpeg-extra-version.txt"
    if [ "$INSTALLED_VERSION" = "$VERSION" ]; then
    echo "The latest oxideqt-codecs-extra ($VERSION) is already installed"
    echo "The latest chromium-codecs-ffmpeg-extra ($VERSION) is already installed"
    exit 0
    fi
    fi
    @@ -77,9 +77,10 @@ mkdir "$STAGINGDIR"
    cd "$STAGINGDIR"

    # Now get the deb package
    $LOUD_DL "http://security.ubuntu.com/ubuntu/pool/main/o/oxide-qt/${UBUNTU_PACKAGE}"
    $LOUD_DL "http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/${UBUNTU_PACKAGE}"

    # Extract the contents of the oxideqt-codecs-extra package

    # Extract the contents of the chromium-codecs-ffmpeg-extra package
    if available bsdtar; then
    DEB_EXTRACT_COMMAND='bsdtar xOf'
    elif available ar; then
    @@ -88,20 +89,20 @@ else
    echo 'You must install BSD tar or GNU binutils to use this script.' >&2
    exit 1
    fi
    $DEB_EXTRACT_COMMAND ${UBUNTU_PACKAGE} data.tar.xz | tar xJf - ./usr/lib/$ARCH-linux-gnu/oxide-qt/libffmpeg.so --strip 5
    echo "INSTALLED_VERSION=$VERSION" > oxideqt-codecs-extra-version.txt
    $DEB_EXTRACT_COMMAND ${UBUNTU_PACKAGE} data.tar.xz | tar xJf - ./usr/lib/chromium-browser/libffmpeg.so --strip 4
    echo "INSTALLED_VERSION=$VERSION" > chromium-codecs-ffmpeg-extra-version.txt

    # Install the files
    install -Dm644 libffmpeg.so "$HOME/.local/lib/vivaldi/libffmpeg.so"
    install -Dm644 oxideqt-codecs-extra-version.txt "$HOME/.local/lib/vivaldi/oxideqt-codecs-extra-version.txt"
    install -Dm644 chromium-codecs-ffmpeg-extra-version.txt "$HOME/.local/lib/vivaldi/chromium-codecs-ffmpeg-extra-version.txt"

    # Tell the user we are done
    cat <<EOF
    The following files were installed onto your system:
    $HOME/.local/lib/vivaldi/libffmpeg.so
    $HOME/.local/lib/vivaldi/oxideqt-codecs-extra-version.txt
    $HOME/.local/lib/vivaldi/chromium-codecs-ffmpeg-extra-version.txt
    Restart Vivaldi and test H.264/MP4 support via this page:
  27. ruario revised this gist Oct 11, 2017. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions h264-vivaldi-linux.md
    Original file line number Diff line number Diff line change
    @@ -8,10 +8,10 @@ If you don't have working Flash video and need that in addition, please refer to

    ### Ubuntu

    #### Install oxideqt-codecs-extra
    #### Install chromium-codecs-ffmpeg-extra

    ```
    sudo apt update && sudo apt install oxideqt-codecs-extra
    sudo apt update && sudo apt install chromium-codecs-ffmpeg-extra
    ```

    You will now need to restart Vivaldi. You can then test support on [this page](http://www.quirksmode.org/html5/tests/video.html).
  28. ruario revised this gist Mar 30, 2017. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions latest-proprietary-media.sh
    Original file line number Diff line number Diff line change
    @@ -100,8 +100,8 @@ cat <<EOF
    The following files were installed onto your system:
    "$HOME/.local/lib/vivaldi/libffmpeg.so"
    "$HOME/.local/lib/vivaldi/oxideqt-codecs-extra-version.txt"
    $HOME/.local/lib/vivaldi/libffmpeg.so
    $HOME/.local/lib/vivaldi/oxideqt-codecs-extra-version.txt
    Restart Vivaldi and test H.264/MP4 support via this page:
  29. ruario revised this gist Mar 30, 2017. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions latest-proprietary-media.sh
    Original file line number Diff line number Diff line change
    @@ -103,4 +103,8 @@ The following files were installed onto your system:
    "$HOME/.local/lib/vivaldi/libffmpeg.so"
    "$HOME/.local/lib/vivaldi/oxideqt-codecs-extra-version.txt"
    Restart Vivaldi and test H.264/MP4 support via this page:
    http://www.quirksmode.org/html5/tests/video.html
    EOF
  30. ruario revised this gist Mar 30, 2017. 1 changed file with 2 additions and 64 deletions.
    66 changes: 2 additions & 64 deletions h264-vivaldi-linux.md
    Original file line number Diff line number Diff line change
    @@ -36,68 +36,6 @@ If your distro does not provide a package with a suitable library or one is not

    ## Building your own replacement libffmpeg.so

    If you don't want to use the file in the package provided by Ubuntu, you can compile your own. This is much more work however as you need to donload the entire chromium source and install various build dependencies. In addition, **you will need to recompile a new version and update this file when Vivaldi increases its Chromium engine, otherwise all HTML5 videos may fail to load or you may experience crashes.**
    If you want to build your own replacement libffmpeg use the [Arch vivaldi-snapshot-ffmpeg-codecs PKGBUILD](https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=vivaldi-snapshot-ffmpeg-codecs) as a guide.

    ### Installing build dependencies

    #### Ubuntu, Debian & Mint

    ```
    sudo apt update && sudo apt install automake build-essential libtool pkg-config yasm zlib1g-dev
    ```

    #### Fedora

    ```
    sudo dnf install autoconf automake gcc gcc-c++ libtool make nasm pkgconfig zlib-devel
    ```

    #### openSUSE

    ```
    zypper in -t pattern devel_basis
    ```

    #### Other distros

    * autoconf
    * automake
    * gcc
    * gcc-c++
    * libtool
    * make
    * nasm (or yasm)
    * pkg-config
    * the zlib development support files

    ### Fetch and unpack the appropriate Chromium source archive

    Issue the following commands:

    ```
    CHRVER=48.0.2564.109
    wget http://commondatastorage.googleapis.com/chromium-browser-official/chromium-$CHRVER.tar.xz
    tar xf chromium-$CHRVER.tar.xz
    cd chromium-$CHRVER
    ```

    ### Fetch and configure Depot Tools

    ```
    git clone --depth 1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
    export PATH="$PATH:`pwd`/depot_tools"
    ```

    ### Build libffmpeg.so

    ```
    touch chrome/test/data/webui/i18n_process_css_test.html
    ./build/gyp_chromium --depth . -Dcomponent=shared_library -Dffmpeg_branding=ChromeOS -Dclang=0
    ninja -C out/Release ffmpeg
    ```

    **Note:** On systems that don't use PulseAudio (e.g. older Slackware), you should also include the define `-Duse_pulseaudio=0`.

    ## Tips for package maintainers

    If you repackage Vivaldi browser for your distro, you might want to consider making **vivaldi-ffmpeg-codecs** or **vivaldi-snapshot-ffmpeg-codecs** packages containing a replacement libffmpeg.so library. It is suggested that you place this library in the directory `/opt/vivaldi/` or `/opt/vivaldi-snapshot/` directories respectively. **You will need to update these packages from time to time as Vivaldi ups its Chromium version. If your libffmeg.so is compiled from a Chromium that is too old, it could prevent Vivaldi from displaying any videos and/or cause crashes.**
    If you are a maintainer and intend to repackage Vivaldi browser for your distro, you might want to consider making **vivaldi-ffmpeg-codecs** or **vivaldi-snapshot-ffmpeg-codecs** packages containing a replacement libffmpeg.so library. It is suggested that you place this library in the directory `/opt/vivaldi/` or `/opt/vivaldi-snapshot/` directories respectively. **You will need to update these packages from time to time as Vivaldi ups its Chromium version. If your libffmeg.so is compiled from a Chromium that is too old, it could prevent Vivaldi from displaying any videos and/or cause crashes.**