• Raspberry Pi
    3 min | 5388

    #Raspberry Pi: Amazon Prime, Netflix, etc. and a DRM solution!

    Raspberry Pi | 3 min | 5388

    It is a rainy day and you have a Raspberry Pi, which is running Raspberry OS (Raspbian), and you think: I can make a media center to watch some movies/series. You configure everything, and then you see something like the next picture, every time that you want to watch Amazon Prime, Netflix, etc. using the Chromium Web Browser:

    Fig. 1: Trying to play Amazon Prime videos on the Raspberry Pi running Raspberry OS.

    You could install Kodi, LibreElec or OSMC, and you'll be able to watch your series or movie without any problem (using some plugins). But, if you still want to use Raspberry OS (Raspbian), I can tell you: There is a solution! This means, your Raspberry Pi can still be a media center running Raspberry OS.

    But first, let me explain the error. This simply happens because of Digital Rights Management (DRM). The Chromium browser on the Raspberry OS doesn't support DRM. However, Chromium supports DRM using Widevine on Chrome OS running on ARM processors. This means, you could flash Chrome OS or Android on the Raspberry Pi, but they are not stable as I would like.

    DRM solution

    Therefore, the solution is to extract the library Widevine (libwidevinecdm.so) from ChromeOS and add it to Raspberry Pi OS. That sounds quite complex, right? But, it isn't at all! To do that, I found this script widevine-flash_armhf.sh, that fetches the lastest official recovery image of ChromeOS for ARM, mounts it as a disk, and extracts the Widevine and Flash libraries, saving them in a compressed archive. You won't need the Flash library, but it is also available. The script is used for Vivaldi 2.0. Therefore, I forked and modified it for Chromium.

    Unsupported Browser
    Fig. 2: Unsupported Browser for DRM.
    Supported Browser
    Fig. 3: Supported Browser for DRM (user-agent changed).

    Furthermore, the websites, which need DRM, usually check the user-agent from the browser. The agent Chromium X on Linux is not supported (actually, it is blocked) (Fig. 2). However, Chromium allows you to change the agent by using the argument --user-agent. Therefore, the modified script creates a new file chromium-drm-browser.desktop using the file chromium-browser.desktop and adds the following line to the Exec=chromium-browser:

    --user-agent="Mozilla/5.0 (X11; CrOS armv7l 11895.95.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36"

    and you'll get Fig. 3, when you add that line. The good news is that that browser is supported. :)

    You can check here for the last version of the browsers, and modify the script.

    DIY Instructions

    To add DRM support to Chromium on Raspberry OS, follow these steps:

    1. Download the script on the Raspberry Pi (you could use SSH):

      # Raspberry Pi OS (32bits) / Raspbian
      wget https://gist.githubusercontent.com/lemariva/0eb4ff4e847700627a5ebb71711c31bf/raw/0248371355b5fd26827934d37a52b46dd7d8fb5a/widevine-flash_armhf.sh
      # Raspberry Pi OS (64bits)
      wget https://gist.githubusercontent.com/lemariva/0eb4ff4e847700627a5ebb71711c31bf/raw/0248371355b5fd26827934d37a52b46dd7d8fb5a/widevine-flash_armhf_64.sh
    2. Change the file type to executable, typing:
      chmod +x widevine-flash_armhf.sh
    3. Run the script file, typing:
      sudo ./widevine-flash_armhf.sh

      The script needs sudo because it mounts the ChromeOS recovery image as a disk to extract the required files. Then, it copies the library Widevine under /usr/lib/chromium-browser/. It also creates and moves the chromium-drm-browser.desktop file to the /usr/share/applications folder. This folder is where the menu access is located. Important: You'll need about +2GB of free space on the microSD to download the recovery image of ChromeOS. After the required files are extracted, the image is deleted, and you get the space back.

    After doing that, you will get two direct accesses to the Chromium Web Browser (see Fig. 4). The Chromium (DRM) Web Browser has DRM support and you can use it to play videos from Netflix, Hulu, HBO, Disney+, Amazon Prime, Spotify, Pandora, and many others (see Fig. 5).

    Chromium (DRM) Web Browser
    Fig. 4: Direct accesses to Chromium with and without DRM support.
    Supported Browser
    Fig. 5: Playing videos on Amazon Prime
    using Chromium on the Raspberry Pi OS.
    Supported Browser
    Fig. 6: Playing music on Spotify
    using Chromium on the Raspberry Pi OS.

    Hardware Acceleration (Video Decoder)

    Check this article for more information:

    Extra information

    This section is intended for those who want to analyze the script. Google lists the recovery images of ChromeOS in this file:


    and the selected recovery images are:


    Noel Sheridan 07.09.2020

    chromium browser 78 seems to be ending. Is there a way to do drm with Chromium 83 which works with 5.4 kernel

    AnthonyD 07.11.2020

    That is a great solution to the DRM problem on Raspberry Pi! How is the video playback quality in Chromium? Do you know if it uses hardware acceleration or just the CPU?

    thek 07.10.2020

    Hi there. I have a question. Netflix works perfect but spotify web does not work. Is there a solution for this. Greetings Thek

    neale 07.15.2020

    Are you getting 4K playback?

    Eric 08.30.2020

    Fantastic explanation, Thankyou, worked very well. :-)

    Tamas 09.06.2020

    Hello there! Thank you for this solution! Unfoertunately, it doesn't work for me. The installation completes seemingly successfully. However, Amazon Prome shows the same error still when i open the "Chromium (DRM) Web browser" from "Internet". Then i checked whatismybrowser, and it detects the new broswer as Chromium not Chrome. Please let me know if you have any suggestion. Thank you, Tamas

    John 09.07.2020

    worked for me, video playback is working sufficiently, but just barely!

    thank you!