Nicolas DeStefano

Random

Linux

Vitae

Research

About

Pi-Based Streaming

Hello again. This writeup is a step to remove google from my life, and a big part of my life includes streaming movies and TV, but one of the issues I (and likely many others have) with chromecast and most streaming sticks is how poor the performance is due to the bloatware. SO this is a process I used to make a minimal streaming box that makes use of a raspberry Pi and a premium streaming service. As a necessary protection, I will not specify which service I use personally, but this process will allow you to quickly stream your favorite movies and shows.

The setup involves using the Kodi media app, which is used as an open source media player usable on every platform and by itself can be used to play media stored on the device (or network storage). The "premium service" I keep alluding to is typically the form of a server, where paying a low fee (~$20 for 6 months of access) allows you to stream from those servers. These services can be accessed through Kodi using an addon called Seren to allow streaming from services such as Premiumize, RealDebrid, and AllDebrid.

To run the Kodi app and addon, I used an old Raspberry Pi 4 Model B, and find that the ethernet connection and 2Gb RAM works well for streaming 1080p media without long loading times or buffering. To guarantee that no bloatware is included on the Pi, I use LibreElec, which is a linux-based "just enough OS" to run the Kodi app. My original setup using an old google chromecast streamed over wi-fi and struggled with loading and continuous streaming, and suffered from the additional bloat chromecast keeps on their devices.

Without further ado, let's get started with flashing raspberry pi with LibreElec. For folks reading this in the far future, my system versions are:

LibreElec Installation

The first step is to flash the minimal OS onto the Raspberry pi. I used a USB adaptor to write to the SD card, which came with the Pi. I imagine you could use a normal USB drive, if you specify the bootloader to boot from the USB as opposed to the existing SD card on the Pi. I used Debian to flash the OS to the USB, but for Windows/MacOS people, LibreElec has a tool to flash the OS to the drive.

  1. Download the LibreElec image archive for your model of Pi
  2. decompress the archive onto a USB drive (or SD card to insert into the Pi) with the following pipeline:
    cat LibreELEC-RPiX.aarch64-12.2.1.img.gz | gzip -d | sudo dd of=/dev/sdY status=progress bs=16M
    Where you replace X and Y with your image archive and USB device indicators. To briefly explain the command, cat lists the files in the archive, gzip -d decompresses the listed files, and finally dd copies the decompressed files to output file /dev/sdY, completing with a progress status and bs=16M to improve write speed
  3. Unmount the drive, plug the SD card into the Pi, and boot it up. LibreElec, and therefore Kodi, should install from there.

Seren Installation

From here, everything can be done in Kodi, regardless of the system it's installed on. The process follows from the official install instructions, but summarized below:

  1. Go to file manager, located within Kodi's settings, and add source
  2. Click none and type https://nixgates.github.io/packages, enter whatever name you want, for example Nixgates and click OK
  3. Back at Kodi's home screen, go to the Add-ons menu and Install from zip file
  4. Select the previously name Nixgates repository and install the repository.nixgates-2.2.0.zip file, which installs the nixgates repositoryto Kodi.
  5. Returning to the Add-ons menu, now select Install from repository
  6. Select Nixgates Repo, Video add-ons, and Seren, then install Seren with Install

Premium Cloud Service & Trakt Connection

At this point Seren is installed, but you won't get very far before running into errors whenever you try to stream any media. There are a few things we need to do to get started up streaming.

The provider/scraper searches for valid media links, which the cloud services filter and match link hashes to ones stored on the premium server. My setup uses a4kscrapers which works well with Seren. In addition, we can also link Trakt.TV which is a media streaming tracker. Seren integrates this to track your watched movies and shows, provide suggestions, store watchlists, etc. You can get away without using this service, however, I find it adds a lot of convenience within the Seren add-on.

  1. Go to Seren's tools menu from Seren's home screen, then navigate to provider tools,manage provider packages, and Install package.
  2. Install from web location https://bit.ly/a4kScrapers
  3. Go to Seren settings, either through the side menu (push left on the remote), or selecting tools and Open Settings Menu
  4. Go to Accounts and enable your premium cloud service account (Premiumize, Real-Debrid, AllDebrid) and authorize that account with however Seren instructs you
  5. Optional: In the same Accounts menu, authorize Trakt with whatever similar instructions Seren provides you

"Playback failed" Error Fix

If you followed all previous instructions and notice that Seren doesn't recognize any playable media resulting in a Playback failed error, then a more recent version of Seren is required to fix this issue. The update uses a separate repository to install from. Note that installing a previous version of Seren is required in order to install the proper dependencies, so skipping the initial install in this guide is not an option.

  1. From the Kodi home screen, we're going to return to the File Manager menu accessed through Kodi settings and add another source with Add source
  2. This time type in https://bbviking.github.io/ and name it appropriately
  3. From the Kodi Add-ons menu, Install from zip and select bbviking (or whatever you named it), and plugin.video.seren-3.0.62.zip
  4. This installation may take a while so be patient. You can monitor the progress through the Add-ons menu in Kodi settings and going to Currently downloading add-ons. It will hang on 77%, but just let it install while you go touch grass
  5. Once complete, movies and shows should now be able to stream in the updated app

Kodi & Seren Configuration

Congratulations! through this long and difficult journey, you now have a minimal and efficient streaming box! While you could happily stream from this point, there are some configurations you can do to streamline your streaming experience. For example, setting a default language and subtitle so you don't have to listen to your media in German. Below I highlight some of the settings I have changed on my box to have a nice user experience. All provided options are changes from the default settings.

LibreElec

Kodi

Seren

Streaming Improvements & Outlook

There are quite a few things I need to change with my personal setup, or implement to improve the scope of this streaming system. Some future guides may detail:

Hopefully this guide helps you as much as it will help me in future reinstallations of this wonderful streaming box build. Nowadays with streaming providers constantly controlling what is and isn't inaccessible, this build provides a stable and wide variety of media to stream for a competitive subscription price. If you run into issues, you can try to contact me, but I can't guarantee immediate responses.

Until next time,

Nic