How to build your own Kodi media streaming box

Kodi and Pi

The first thing to do is add your media to your library. Kodi supports a wide range of containers and formats, so you should have no problem unless you've gone for a particularly obscure format.

Check the box (see Add Content to your Library, below) for advice on naming and organising your media so that allows Kodi to recognise it and display extra information about TV shows and movies. This uses the help of special 'scrapers': tools that extract metadata from online databases such as movie titles, TV episode synopses and artwork to pair them with your media files for identification.

Where should you store this local content for Kodi to get at it? If your micro SD card is large enough – we'd suggest 64GB or greater – then you can store a fair amount of video and music on there. You can transfer files across the local network – open File Manager and opt to browse your network.

Your Kodi/OpenELEC device should show up – double-click the file sharing entry and you'll see folders for Music, Pictures, TV Shows and Videos – simply copy your files here to add them to your library. Once done, browse to Video or Music and the media files should already be present and accounted for, although at this point in time they've not been assigned a scraper to help you identify them yet.

How to build your own Kodi media streaming box

The Amber skin is a beautiful alternative to the more functional Confluence default. Sadly, there's no access to the OpenELEC configuration menu from it

It can be slow copying files across in the network – you can transfer files directly to the card when it's mounted in a card reader on your PC, but you'll need to access File Manager as root to do so – in Ubuntu, eg, typing $ gksudo nautilus and hitting Enter will give you the access you need.

A simpler option – if you have a spare USB port on your Raspberry Pi – is to store your media on an external thumb or hard drive. Just plug the drive into your Raspberry Pi, browse to Videos or Music and choose the 'Add…' option. Click 'Browse' and select the top-level folder containing the type of media you're adding – TV, movies or music.

If you've plugged in a USB device, you'll find it under root/media, while NAS drives are typically found under 'Windows Network (SMB)'. Once selected, click 'OK'. The Set Content dialogue box will pop up – use the up and down arrow buttons to select the type of media you're cataloguing and verify the selected scraper is the one you want to use.

Check the content scanning options – the defaults should be fine for most people – and click 'Settings' to review advanced options (you may want to switch certification country to the UK for movies, eg). Click 'OK' twice and choose 'Yes' when prompted to update the library.

Once done, you'll find a new entry – Library – has been added to the media menu on the main screen. This gives you access to your content with filters such as genres, title or year to help navigate larger collections. Now repeat for the other types of media you have.

If you want to include multiple folder locations within single libraries, you'll need to browse to the Files view, then right-click the library name (or select it and press c on the keyboard) to bring up a context menu. Select 'Edit Source' to add more locations, and 'Change Content' to change the media type and scraper if necessary.

The smartest thing to do with any digital media library is host it on a media server, which allows you to easily access it from other devices on your network and – in some cases – over the wider internet. Kodi has UPnP media server capabilities that work brilliantly with other instances of Kodi on your network as well as making your media accessible from other compatible clients.

Media servers can be quite demanding, so we don't recommend using a Pi Zero or Raspberry Pi Model B+. Instead, set it up on your most powerful PC (or Raspberry Pi 2 or Raspberry Pi 3) and use OpenELEC to connect to it as a client.

As media servers go, Kodi's is rather basic. If you want an attractive, flexible server then maybe check out Emby.

Pair this with the Emby for Kodi add-on and you can access your Emby-hosted media without having to add it to your Kodi library. A similar add-on exists for users of Plex Media Server too, PleXBMC, providing you with an attractive front-end.

If you want access to other UPnP servers via Kodi without any bells and whistles, then browse to System > Settings > Services > UpnP/DLNA and select 'Allow remote control via UPnP'. You can also set up Kodi as a media server from here: select 'Share my libraries' and it should be visible to any UPnP client on your network, although you may have to reboot.

Performance is obviously going to be an issue on lower-powered devices, such as the Raspberry Pi, and while the Raspberry Pi 2 is pretty responsive out of the box, you may find the Raspberry Pi Zero struggles at times. It pays, therefore, to try and optimise your settings to give your Raspberry Pi as much resources as it needs to run smoothly.

Start by disabling unneeded services – look under both System > OpenELEC > Services (Samba isn't needed if you're not sharing files to and from Kodi, eg) and System > Settings > Services (AirPlay isn't usually required).

Incidentally, while you're in System > Settings, click 'Settings level: Standard' to select first Advanced > Expert to reveal more settings.

One bottleneck for Raspberry Pi devices is dealing with large libraries – give it a helping hand by first going to Settings > Music > File lists and disabling tag reading. Also go into Settings > Video > Library and disable 'Download actor thumbnails'.

You can also disable 'Extract thumbnails and video information' under File Lists, but you'll lose a lot of eye candy and the thumbnail caching for future use.

The default Confluence skin is pretty nippy, although if you suffer from stutter when browsing the home screen, consider disabling the showing of recently added videos and albums: select Settings > Appearance, then click Settings in the right-hand pane under Skin. Switch to 'Home Window Options' and de-select both 'Show recently added…' options.

Speaking of Confluence, if you don't like the default skin, then try Amber – it's beautiful to look at, but easy on system resources. You do lose access to the OpenELEC settings when it's running, but you can always switch back to Confluence temporarily or use SSH for tweaks, if necessary.

How to build your own Kodi media streaming box

Name your media files up correctly if you want them to appear fully formed in your media library

Add content to your library

Kodi works best with your locally stored digital media, but for it to recognise your TV shows from your music collection you need to name your media correctly and organise them into the right folders too.

Kodi supports the same naming convention as its rival services Embyand Plex – use the following table to help you:

How to build your own Kodi media streaming box

Need to rename files in a hurry? Then Filebot is your new best friend.