User Tools

Site Tools


How to get Serviio running on Raspbian on a Raspberry Pi


This is guide is based on the assumption you have a working version of Raspbian “wheezy” installed on Raspberry Pi Model B (512mb version). It hasn't been tested on Raspberry Pi Model B 256mb or Model A.

Raspbian “wheezy” can be download from the link below. Please refer to for support setting up Raspbian.

“Oracle JDK 8 for ARM has JIT compiler and supports hard float point instructions. This is the fastest (1.5x-10x times faster than other JVMs) Java option for Raspberry Pi”

Install Oracle Java for ARM

Download Oracle JDK8 for ARM on your RaspberryPi and get the resulting file to your 'home' folder on Raspbian.

Oracle provide a good installation guide at:

If you have Raspbian setup already then skip to the section “Setting Up JavaFX Runtime on the RPI”

Configure Java

Decompress the tar file, the file name will change depending on the version you download

sudo tar zxvf jdk-8u60-linux-arm32-vfp-hflt.tar.gz -C /opt

Change the owner of JAVA:

root@raspberrypi /opt $ sudo chown -R root jdk1.8.0_60/

Set where the Java components are installed:

sudo update-alternatives --install /usr/bin/java java /opt/jdk1.8.0_60/bin/java 1
sudo update-alternatives --install /usr/bin/javac javac /opt/jdk1.8.0_60/bin/javac 1
sudo update-alternatives --set java /opt/jdk1.8.0_60/bin/java

Set version, you get to set as new versions of Raspbian have JDK7 preinstalled, you can install JDK8 as well just set which runs.

sudo update-alternatives --config javac
sudo update-alternatives --config java

Check versions

java -version
javac -version

Version numbers will update from the example below;

pi@raspberrypi ~ $ java -version
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) Client VM (build 25.60-b23, mixed mode)

Set the JAVA_HOME environment variable on Raspbian

Edit the file /etc/environment

root@raspberrypi $ sudo nano /etc/environment

Enter the following:


Exit nano making sure you save the file.

Edit your ~/.bashrc file:

sudo nano ~/.bashrc

Put the entries at the end of the file:

export JAVA_HOME="/opt/jdk1.8.0_60"
export PATH=$PATH:$JAVA_HOME/bin

Reboot Raspbian to make sure everything is update and 'export' settings in place.

Install Serviio

Download Serviio for Linux from:

Copy the file into your home folder 'home/pi' on Raspbian and extract the contents into a folder e.g 'home/pi/serviio'

In the folder 'home/pi/serviio/bin' folder you'll find the two shell scripts you need to run.

From terminal in the folder 'home/pi/serviio/bin'


In another terminal session


1, to run the service
2, to run the console on raspbian desktop

In Serviio desktop make sure you disable transcoding. The Raspberry Pi CPU even if overclocked is pretty weak and not up to transcoding. As an example a Intel Atom dual core D525 1.8ghz can just about do x264 to mpeg2 real time at SD quality, Raspberry Pi is an ARM6 cpu at 700mhz (default).

Rather than run Serviio console on Raspbian you can configure via a smart phone. See the links on for more details or for more desktop replacements.

Set Serviio to start on boot with Raspbian, this is for the service only not the GUI so save memory.
Create and init.d file to edit

sudo nano /etc/init.d/serviio

Paste the following code into your file

# Provides:          serviio
# Required-Start:    $syslog
# Required-Stop:     $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: serviio server
# Description:


case "$1" in

        echo "Stop Serviio..."
        su -l $User -c "/home/pi/serviio/bin/ -stop" > /dev/null 2>&1 &
        # start Serviio in background mode
        su -l $User -c "/home/pi/serviio/bin/" > /dev/null 2>&1 &
        echo "Start Serviio..."

Set permissions so the script is executable

sudo chmod 755 /etc/init.d/serviio

Register script to be run at start-up

sudo update-rc.d serviio defaults

If you want to remove from start-up

sudo update-rc.d -f serviio remove 


So far I've not got this to compile, it fails after about 10 minutes so this needs some work. For now I installed the standard version:

sudo apt-get install ffmpeg

If you want to experiment this guide is available, non-specific to Serviio.

The above guide worked to a point with a lot of tweaking but the resulting outputs didn't work on Raspbian.

My solution was to build on the Pi itself even though main guides say don't do it. Yes its slow but at least it will work !

Get lamemp3

sudo apt-get install libmp3lame-dev

Compiling libaacplus

sudo apt-get install autoconf 
sudo apt-get install libtool
cd /home/pi/
mkdir src
cd src
wget -O libaacplus-2.0.2.tar.gz
tar -xzf libaacplus-2.0.2.tar.gz
cd libaacplus-2.0.2
./ --with-parameter-expansion-string-replace-capable-shell=/bin/bash --host=arm-unknown-linux-gnueabi --enable-static
You have error message here. Change the line in autogen to "(libtoolize --help...".
sudo make install

Compiling libx264

cd /home/pi/src
git clone git://
cd x264
./configure --host=arm-unknown-linux-gnueabi --enable-static --disable-opencl
sudo make install

Build and Install libvpx
libvpx is an emerging open video compression library which is gaining popularity for distributing high definition video content on the internet. FFmpeg supports using the libvpx library to compress video content. To acquire and build libvpx, perform the following:

sudo apt-get install checkinstall
cd /home/pi/src
git clone
cd libvpx
sudo checkinstall --pkgname=libvpx --pkgversion="1:$(date +%Y%m%d%H%M)-git" --backup=no     --deldoc=yes --fstrans=no --default

Build and Install librtmp
librtmp provides support for the RTMP content streaming protocol developed by Adobe and commonly used to distribute content to flash video players on the web. FFmpeg supports using the librtmp library to stream content from RTMP sources. To acquire and build librtmp, perform the following:

sudo apt-get install libssl-dev
cd /home/pi/src
git clone git://
cd rtmpdump
make SYS=posix
sudo checkinstall --pkgname=rtmpdump --pkgversion="2:$(date +%Y%m%d%H%M)-git" --backup=no --deldoc=yes --fstrans=no --default

The first built I ran ffmpeg it failed and I had to go back and do this command here

sudo ldconfig

Then when I built and ran ffmpeg it was happy

Build and Install FFmpeg
This guide uses latest FFmpeg source, Serviio is tailored to work with a certain version though. I use the latest in this guide.

cd /home/pi/src
git clone --depth 1 git://
cd ffmpeg
./configure --arch=armel --target-os=linux --enable-gpl --enable-libx264 --enable-nonfree --enable-libaacplus --enable-librtmp --enable-libmp3lame
sudo make install
howto/linux/install/raspbian.txt · Last modified: 2016/01/27 16:45 by szati