Emby Inside OpenELEC
This post and accompanying video is all about installing Emby inside OpenELEC so I should first explain why I want to do that and what the issue is that justifies its own post.
OpenELEC is an HTPC operating system that primarily runs the HTPC mediacenter Kodi off of a disk image in RAM. This results in super fast bootups and very simple setup, once installed.
Kodi, in turn, is a pretty fantastic HTPC front-end, but it does have two notable issues. The first is that there is no way to do remote streaming. That is, say you are on a trip and want to watch a movie from your collection that is served up by Kodi. That’s not possible. The second problem is the bigger one in my opinion. Kodi has a terrible interface for movie metadata management. This includes things like artwork and movie info and maybe trailers and all of the rest of the data bits associated with a movie file. The Kodi interface is stuck in the era from when it used to be XBMC and run on an XBox. This console-style interface is now incredibly antiquated and is honestly one of the worst interfaces I’ve ever seen for managing information like this. It’s so bad that it’s almost a deal-breaker for using Kodi!
Handily, there are products that fill in those gaps, namely Plex and Emby. Both are native remote streaming platforms; both have excellent modern movie metadata management; and both have addons that integrate their functionality with Kodi. Nice!
I tend to prefer Emby for Kodi integration partially because it is Open Source, partially because it is more flexible and more powerful when doing metadata management than Plex, but mostly because it completely takes over the Kodi database when the addon is installed. This is in comparison to Plex, which exists sort of as a side-piece to Kodi and the two maintain separate databases.
It is possible to run the Emby server on a separate computer and stream the content to Kodi — the addon does support that. Unfortunately, that setup defeats the primary advantage of a dedicated HTPC, as far as I’m concerned. Specifically, if you are okay with streaming or transcoding the movies over the network then you are likely better served with a Roku or FireTV box as the front-end running a Plex or Emby client. The power of a dedicated HTPC box is that everything runs locally, giving everything super fast reaction times and much tighter integration. Separating Kodi and Emby goes against that purpose.
The problem here is that OpenELEC does not easily permit 3rd party software to be installed after the initial installation. It runs off of a disk image in RAM and so anything running that’s not part of the image is typically wiped out on reboot. That means that for the Emby server to run locally, it will need to be included as part of the OpenELEC disk image.
That’s what this post is about — how to install Emby inside of the OpenELEC disk image to be part of the cohesive system.
Here’s the video for those who prefer talking pictures to words:
Step 0: Create a Linux Development PC
We’ll be compiling OpenELEC from source so we need a Linux PC to do the build on. I did mine the easy way and just installed VirtualBox and installed the lasted Ubuntu image onto it. If you have a dedicated Linux box then all the better since it will likely be much faster.
Step 1: Building the OpenELEC Disk Image
Start out by cloning my forked version of the OpenELEC source code:
$ git clone https://github.com/granworks/OpenELEC.tv.git
This will download a couple hundred megabytes of source bits and expand to use another hundred or so. Better have at least 300MB available for the source and then quite a bit more for the build.
Building the disk image is exactly the same as doing so for the stock image, since I made the Emby build a default option:
$ PROJECT=Generic ARCH=x86_64 make image 2>&1 | tee make.log
Technically only the part up to ‘image’ is needed — the latter part is there to log everything, which is useful for debugging if something goes wrong.
So… how long should this take? Well, it massively depends on your system. Probably a long time no matter what. On my VirtualBox instance running on a Mac Mini, it takes a staggering amount of time. It’s not “get a cup of coffee” amount of time but more like “set it going before going to bed and it’ll be mostly done by the time you wake up”. Yes, it takes at least eight hours to build on my system! Gak!
When the build finishes, you’ll have a few files in the
target directory. The ones that matter are those that end with
img.gz, which is used for brand new installations and
tar, which is used to update an existing OpenELEC installation. I have a previous video which covers the former case and the latter case is completely standard and described here
Install the Emby Addon
After rebooting OpenELEC, you’ll see the Emby server running, but it doesn’t communicate with Kodi at all since the Emby addon isn’t installed. I was unable to find a way to make that part of the disk image, so you’ll have to do that manually.
This page describes how to do that: Installing the Kodi Emby Add-on
This setup is fully functional and is what I’m using on my HTPC as I write this. However, it is a bit of a hack. I was unable to coax the OpenELEC build process to successfully build the ‘mono’ package and so I resorted to pulling down a 64 bit pre-compiled package to use. This limits this image to only a 64 bit Intel chip and absolutely will not run on any other architecture such as the Raspberry Pi or a FireTV.
I was also unsuccessful in inserting the Kodo Emby repository into the disk image. I don’t know why that didn’t work since it seems pretty straightforward. Nevertheless, it’s not there, and so that addon needs to be installed manually.
It’s possible that if those two issues are fixed then my forked version could be merged back into the mainline, but until such day, this will need to remain a fork.