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 raspberrypi.org for support setting up Raspbian.
http://www.raspberrypi.org/downloads
“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”
Download Oracle JDK8 for ARM on your RaspberryPi and get the resulting file to your 'home' folder on Raspbian.
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Oracle provide a good installation guide at:
http://jdk8.java.net/fxarmpreview/index.html
If you have Raspbian setup already then skip to the section “Setting Up JavaFX Runtime on the RPI”
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)
Edit the file /etc/environment
root@raspberrypi $ sudo nano /etc/environment
Enter the following:
JAVA_HOME="/opt/jdk1.8.0_60"
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.
Download Serviio for Linux from:
http://www.serviio.org/download
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'
bash serviio.sh
In another terminal session
bash serviio-console.sh
1, serviio.sh to run the service
2, serviio-console.sh 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 http://www.serviio.org/apps for more details or http://wiki.serviio.org/doku.php?id=wikiconsoles 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
#!/bin/bash ### BEGIN INIT INFO # Provides: serviio # Required-Start: $syslog # Required-Stop: $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: serviio server # Description: # ### END INIT INFO User=pi case "$1" in stop) echo "Stop Serviio..." su -l $User -c "/home/pi/serviio/bin/serviio.sh -stop" > /dev/null 2>&1 & ;; start) # start Serviio in background mode su -l $User -c "/home/pi/serviio/bin/serviio.sh" > /dev/null 2>&1 & echo "Start Serviio..." ;; restart) $0 stop esac
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.
http://ffmpeg.org/trac/ffmpeg/wiki/How%20to%20compile%20FFmpeg%20for%20Raspberry%20Pi%20%28Raspbian%29
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 http://tipok.org.ua/downloads/media/aacplus/libaacplus/libaacplus-2.0.2.tar.gz tar -xzf libaacplus-2.0.2.tar.gz cd libaacplus-2.0.2 ./autogen.sh --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...". make sudo make install
Compiling libx264
cd /home/pi/src git clone git://git.videolan.org/x264 cd x264 ./configure --host=arm-unknown-linux-gnueabi --enable-static --disable-opencl make 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 https://chromium.googlesource.com/webm/libvpx 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 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://git.ffmpeg.org/rtmpdump 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://git.videolan.org/ffmpeg cd ffmpeg ./configure --arch=armel --target-os=linux --enable-gpl --enable-libx264 --enable-nonfree --enable-libaacplus --enable-librtmp --enable-libmp3lame make sudo make install