[HowTo] Install Emby-Server (BROKEN)

So this a new thread sprung from Emby server + OSMC on rpi2?

If you’re not familiar with Emby, check out www.emby.media

#What
In essence Emby, formerly MediaBrowser is a server software intended to provide an open source media server that can be used as a fancy DLNA server as well as through their own apps. It can also be tightly integrated with Kodi which is why I’m posting this :smile:

When integrated with kodi/Osmc Emby provides a great way to manage your media and metadata from any web browser as well as sync play positions between devices - Running Kodi or anything else!

Here’s a video showing how and why it integrates with Kodi:

So here’s the installation instructions. While they aren’t that complicated they do require you to be somewhat familiar with the terminal and have a bit of free time.

###Note: I have Emby-Server running flawlessly on my OSMC rpi2. Haven’t tried streaming or other DLNA devices yet so I can’t vouch for that. Haven’t integrated it into my Kodi installation yet so I can’t say how that works either, basically this is a proof of concept. Also it was a pain to get this up and running without instructions, thus these instructions are made as an afterthought and I might’ve missed something. Please tell me if you’ve tried the guide and something doesn’t work and I’ll try to get it sorted :smiley:

#HowTo
###Prerequisites:
Aptitude, unzip, git. Can be installed through apt-get:

sudo apt-get install aptitude unzip git

###1) Dependencies
Install dependencies using aptitude. Be sure to check the suggestions that aptitude throws at you, it might suggest to skip some of the packages, just say no to that suggestion until a better one comes along. If it doesn’t, try splitting these into several commands instead of installing them at once.

sudo aptitude install imagemagick imagemagick-6.q16 imagemagick-common libimage-magick-perl libimage-magick-q16-perl libmagickcore-6-arch-config libmagickcore-6-headers libmagickcore-6.q16-2 libmagickcore-6.q16-2-extra libmagickcore-6.q16-dev libmagickwand-6-headers libmagickwand-6.q16-2 libmagickwand-6.q16-dev libmagickwand-dev webp mediainfo sqlite3

###2) FFmpeg
Now we need to build ffmpeg from source
Note: This will take time. Serious time. I left this on overnight

sudo aptitude remove ffmpeg
cd /usr/src
sudo mkdir ffmpeg
sudo chown `whoami`:users ffmpeg
git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg
cd ffmpeg
./configure
make && sudo make install

###3) Get Mono
The next step is to get mono (the package, not the disease). While available through the official debian repo that version (2.3) is too old - Recommended version is ≥4. Therefore we need to get it from the maker of mono, Xamarin.

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
sudo apt-get update
sudo apt-get install mono-complete

4) Emby - Aka MediaBrowser

The next step is to get and configure Emby.

Download and unpack

wget https://raw.githubusercontent.com/MediaBrowser/MediaBrowser.Releases/master/Server/MediaBrowser.Mono.zip -O /tmp/MediaBrowser.Mono.zip
unzip /tmp/MediaBrowser.Mono.zip -d /opt/mediabrowser

Configure
Configure by editing the following three files so that they point to the correct versions of their corresponding libraries. It should be safe to just copy my files, but if you run into troubles you can edit them yourself using the instructions at the bottom of this section:

/opt/mediabrowser/ImageMagickSharp.dll.config

<configuration>
  <dllmap dll="CORE_RL_Wand_.dll" target="libMagickWand-6.Q16.so.2" os="linux"/>
  <dllmap dll="CORE_RL_Wand_.dll" target="libMagickWand-6.so" os="freebsd,openbsd,netbsd"/>
  <dllmap dll="CORE_RL_Wand_.dll" target="./MediaInfo/osx/libmediainfo.dylib" os="osx"/>
</configuration>

/opt/mediabrowser/System.Data.SQLite.dll.config

<configuration>
  <dllmap dll="sqlite3" target="libsqlite3.so.0" os="linux"/>
</configuration>

/opt/mediabrowser/MediaBrowser.MediaInfo.dll.config

<configuration>
  <dllmap dll="MediaInfo" target="./MediaInfo/osx/libmediainfo.dylib" os="osx"/>
  <dllmap dll="MediaInfo" target="libmediainfo.so.0" os="linux"/>
</configuration>

If this doesn’t work for you, the easiest way to do this yourself is to run

dpkg-query -f '${binary:Package}\n' -W

to list all your installed packages, make a note of the exact names of the packages for libMagickWand, sqlite3 and mediainfo and then run

dpkg -L <packagename>

to find the name of the actual file and enter it in the config files

5) Cleanup:

sudo apt-get clean
sudo rm -R /usr/src/ffmpeg
sudo rm /tmp/MediaBrowser.Mono.zip

6) Run!

Test your creation (sudo might not be required):

sudo mono /opt/mediabrowser/MediaBrowser.Server.Mono.exe -ffmpeg “/usr/local/share/man/man1/ffmpeg.1” -ffprobe “/usr/local/share/man/man1/ffprobe.1”

Your Emby-Server should now be available for you at http://(yourip):8096
Also, don’t forget too add the addons for Kodi - They are available on http://emby.media/downloads/emby-for-kodi/

##Extra
To run this at startup you could easily add that to the crontab file to run at reboot, a better way would probably be to add it as a system service so that it could be set to restart if it crashes. If I do this I’ll post my file here, if anyone else does they’re more than welcome to post theirs

Moved to howto section

yeah the ffmpeg takes time to compile gonna set this up on my cubieboard since its managing other media services for me but awesome howto :smile:

Thanks! Report back with results :slight_smile:

So far mono is being a bitch not sure why but it is had to use aptitude in order to install it

deb http://download.mono-project.com/repo/debian wheezy-libjpeg62-compat main

used this repo instead

and i had to create this file

/etc/apt/preferences.d

mono-complete-mono-pin-400

Package:  *
Pin: release o=download.mono-project.com
Pin-Priority: 400
Package:  *mono-complete*
Pin: release o=download.mono-project.com
Pin-Priority: 500

also might wanna add http://(yourip):8096 to the guide

Will add the ip!
Wonder if that repo is needed for the cubieboard but not pi?

Oh seems like a bug in discourse; Since I’m not allowed to post in this category I can’t edit my post without specifying a new category :open_mouth:
So maybe you can add a line at the bottom of the run section?

something like “Your Emby-Server should now be available for you at http://(yourip):8096 !”

Hi. You can edit your post now.

Hey there. First of all many thanks to your work you have invested to create this. I’m pretty new to all this things and needed help over all. Have Setup a Kodi player on a Intel NUC and wanted now to get an emby server running on a Raspberry Pi 2. I followed your instructions, but I failed at configuring ffmpeg. I made an SSH connection. Did all commands, but on ./configure I receivee this error:
gcc is unable to create an executable file.
If gcc is a cross-compiler, use the --enable-cross-compile option.
Only do this if you know what cross compiling means.
C compiler test failed.
If you think configure made a mistake, make sure you are using the latest
version from Git. If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file “config.log” produced by configure as this will help
solve the problem.

Could you offer me some help here? I’m pretty lost. Thanks in advance

Hmm I’m sort of new to all of this as well, if I were you I’d probably first try to add sudo before the command, if that fails try redownloading the package, might be corrupt?

Good luck! Report back with results

I am currently on Raspbian since I use my Pi as a headless server. Is there anything different that I have to do? I tried the very first step of installing dependencies using aptitude. Aptitude complains that a hell lot of packages aren’t available. Should I be adding other sources?

I get a unmet dependency for mono that I don’t seem to be able to resolve:

Depends: mono-devel (= 4.0.4.1-0xamarin1) but it is not going to be installed

any ideas?

That means you don’t have the necessary software to compile C code.

Run this:

apt-get install build-essential

You also want the build dependencies for ffmpeg:

apt-get build-dep ffmpeg

Then try again.

Told faramir85 this in a direct message, but thought it should be said on here - I know it is posted in bold in the OP but once again:

I never had the chance to test this out in OSMC!
After having played around so much with different packages my system wasn’t exactly stable, and while metadata worked on the emby server I didn’t have a chance to try playback out inside OSMC.

Also, the point of this was not to achieve a streaming server that could stream to other clients (I don’t think the rpi2 is powerful enough for that) but rather to get a better way of handling metadata as I find Kodi’s metadata retrieval and management seriously lacking.

Anxious to hear if anyone else managed to integrate Emby into Osmc?

I have followed the instructions, but when i try to start Emby on my rpi2 I get the following error:

osmc@osmc:~$ sudo mono /opt/mediabrowser/MediaBrowser.Server.Mono.exe-/usr/local/share/man/man1/ffprobe.1ffprobe  -/usr/local/share/man/man1/ffmpeg.1ffmpeg
Cannot open assembly '/opt/mediabrowser/MediaBrowser.Server.Mono.exe-/usr/local/share/man/man1/ffprobe.1ffprobe': No such file or directory.

Had some trouble installing mono but got it installed by following this Cannot install mono to install Sonarr - #9 by PreacherAT . Could that be the problem?

Anyone got any idea?

its missing ffprobe

Sorry for beeing a complete noob at this, but shouldn’t ffprobe be installed with ffmpeg?

see if it is im not sure, in regards to emby its a clusterfuck at best since its a microsoft windows application if you get it running it will be a small miracle.

i gave up along time ago we should probly mark this howto as broken

Glad it was built for my Asustor NAS… Getting setup on osmc was headache