About technologies for your digital home

For beginners and tinkerers

Ubuntu Serviio

March 11th, 2014

This guide will help you install the Serviio media server from the sources on Ubuntu server.

After testing different media servers, I had the biggest success with Ubuntu Serviio media server. At the moment, I have it running with my D-Link DNS-320L NAS as well.

I assume you already have a basic Ubuntu Linux server running and log-in with the user, which you created during the initial Ubuntu setup.

Keep in mind, that to build and install all packages below mentioned may take to up to few hours! That depends mainly on you server computation power. Sorry, this guide is slightly geeky, however in the end you’ll get a more up to date Ubuntu Serviio setup.

Install Serviio Ubuntu prerequisites

After connecting to your server through SSH with the user, which you created during the initial server setup, you have to update the package lists from the repositories:

sudo apt-get update

Next, you will install the packages, which are required to build the prerequisites:

sudo apt-get install build-essential checkinstall git libfaac-dev libjack-jackd2-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev libtheora-dev libva-dev libvdpau-dev libvorbis-dev libx11-dev libxfixes-dev texi2html zlib1g-dev libssl1.0.0 libssl-dev libxvidcore-dev libxvidcore4 libass-dev librtmp-dev

The next step is to build & install Yasm:

cd ~
mkdir src
cd src
wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
tar xzvf yasm-1.2.0.tar.gz
cd yasm-1.2.0
./configure
make
sudo checkinstall --pkgname=yasm --pkgversion="1.2.0" --backup=no --deldoc=yes --fstrans=no --default

After doing this, you will have to build & install x264 codec:

cd ~/src
git clone git://git.videolan.org/x264
cd x264
./configure --enable-static --disable-opencl
make
sudo checkinstall --pkgname=x264 --pkgversion="3:$(./version.sh | awk -F'[" ]' '/POINT/{print $4"+git"$5}')" --backup=no --deldoc=yes --fstrans=no --default

After that, build and install libvpx:

cd ~/src
git clone http://git.chromium.org/webm/libvpx.git
cd libvpx
./configure
make
sudo checkinstall --pkgname=libvpx --pkgversion="1:$(date +%Y%m%d%H%M)-git" --backup=no --deldoc=yes --fstrans=no --default

Build and install FFmpeg:

cd ~/src
git clone --depth 1 git://git.videolan.org/ffmpeg
cd ffmpeg 
./configure --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab --enable-librtmp --enable-libxvid --enable-libass --enable-libvpx 
make 
sudo checkinstall --pkgname=ffmpeg --pkgversion="99:$(date +%Y%m%d%H%M)-git" --backup=no --deldoc=yes --fstrans=no --default

Now Install the Serviio media server

You need to download the latest Serviio package either manually from http://www.serviio.org/download or by issuing the commands:

cd ~
wget http://download.serviio.org/releases/serviio-1.4-linux.tar.gz

This will put tar.gz file in your user USERNAME home directory.
Extract tar.gz using the command tar:

sudo tar xvf serviio-1.4-linux.tar.gz

The start-up script in init needs to created:

 sudo nano /etc/init/serviio.conf

You should write this code inside the script:

start on started networking
script
/home/USERNAME/serviio-1.4-linux/bin/serviio.sh
end script

After doing this, you should restart your networking service:

 sudo /etc/init.d/networking restart

and start Serviio:

sudo start serviio

You can check if it is running by issuing the commands:

initctl list | grep serv

Next, you have to setup Serviio console on Windows client to control your Serviio media server.

Setup Serviio console on Windows

First, you need to download Serviio console file from
http://download.serviio.org/releases/serviio-1.4-win-setup.exe

You have deselect the Serviio server option during the installation process as it is shown below:

Ubuntu Serviio

After the installation, go on your Windows machine into the folder

C:\Program Files\Serviio\bin\ and find the file ServiioConsole.vmoptions file, open with e.g. Notepad.

You need to assign an IP address of your server to the variable -Dserviio.remoteHost=X.Y.Z.A and save it.

Open Serviio console, go to the “Library” tab, add the paths to your audio, music and video files on Ubuntu Linux server.

Do not forget to click the button “Save” at the end!

There is a tab “Presentation”, in which you can choose through which attributes you will be able to browse using your DLNA client:

Serviio installation on Ubuntu

If you change the tab “Presentation” configuration, don’t forget to click the button “Save” at the end!

If you are interested in having more reliable media server, it is worth considering to get a more reliable higher grade (server) hard drive for better durability in 24/7 operations. In my experience (it’s not absolute), however Western Digital hard drives brought less troubles. For instance, I am using this  WD2000F9YZ hard drive in my home NAS setup. Normally, their price is slightly higher (up to ~30%), however those hard drives have two CPUs on board. First of them is used for data processing, while the other is used for correcting errors.

You are ready to start uploading your media files to the server and stream them using your DLNA Serviio server 😉