Ceci est une ancienne révision du document !
Last month I mentioned that we have several KODI boxes throughout the apartment that all get fed by our KODI server. Over the years, we’ve tried different incarnations (Netbooks, Android boxes) and ended up returning to a 1 server + various boxes (Android and a Zotac box running Xubuntu) setup.
Our main server, aptly named KODI, runs stock Xubuntu. During the install process, I made sure to set the user to auto-login. After the system was installed and updated, I installed lirc. Lirc works really well with the HP Windows Media Center remote that we use, and no extra configuration is required other than selecting “Windows Media Center Transceivers Remotes (all)” when LIRC prompts you to choose a remote or transmitter. Lirc will also ask for an IR transmitter. We got rid of our Scientific Atlanta Cable box long ago, but if you have some kind of cable box or satellite receiver, you can chose the Windows Media Center receiver v2 for the type of cable/satellite box you have. I selected None.
Next, head over to http://kodi.wiki/view/HOW-TO:Install_Kodi_for_Linux and copy and paste the 4 lines under the Installing Kodi on Ubuntu-based distributions title to install KODI. Once KODI is installed, you can get it to autostart on login (remembering that we set the user to autologin) by clicking:
Settings Manager > Session and Startup > Application Autostart > Add
Then add KODI as a startup application.
If you plan on using the PC as a PC rather than a dedicated KODI server, you might want to leave off the last step. As a dedicated server, we need a way to put files on the server. I use SSH. Installing SSH is easy:
sudo apt install ssh
The system we use to rip media runs Linux Mint. Originally, we used transcode to rip DVDs, but have long since switched to using a combination of Handbrake for DVDs and MakeMKV for Blu-ray media. That system also has a Windows partition, but we rarely use it for transferring media, but when we do, we use filezilla for the SSH connection.
Although we are running SAMBA, all media shared with SAMBA is shared with read-only as a precaution (not all family members might be as cautious as you might be). We use SSH/filezilla to do all transfers from our ripping machine to our server.
Over the years, we’ve upgraded across many hard drives - as a result our /etc/fstab file is a bit of a mess. Currently, we’re running 2 x 3TB drives and 1 x 2TB drive (though this might change by next month). Our /etc/fstab looks like that shown at the top of the next page.
To figure out which UUID a partition is, simply run:
sudo blkid
Running without sudo permission will turn up nothing, so make sure to use sudo to list the block id’s of the devices (shown above).
The observant will notice that our boot and root drive/partition is actually /dev/sdb2. The /dev/sdb2 partition matches the UUID assigned the / (root) mount point listed in our /etc/fstab. Last year, we removed the 250GB drive we were using as the boot drive and replaced it with a 3TB drive because our other 3TB storage drive was 98% full. The /dev/sda1 drive, mounted as /mnt/DVD in /etc/fstab, is a 2TB drive we used to use as an external drive (and thus the ntfs format). The last drive, mounted as /mnt/Blueray, is the 3TB drive we filled. The two 3TB drives were purchased much later than the 2TB drive, and were dedicated for storing our media, so ext4 made sense. Because we ran out of space on the Blu-ray drive, and that collection is only growing, the plan going forward is to buy 2 x 8TB drives and arrange them in a RAID 1 mirroring setup, plus a small SSD for the operating system drive. RAID 10 would be more ideal, but the cost of 8TB drives is a bit too prohibitive, and buying another couple of 3TB drives really doesn’t leave us with enough storage space.
Earlier, I mentioned that I share media to Windows PCs (and our Android boxes) via SAMBA. Our SAMBA shares look something like:
[dvd]
comment = DVD Movies path = /mnt/DVD/Movies browseable = yes read only = yes guest ok = yes
[blueray]
comment = Blu-ray Movies path = /mnt/Blueray/Blueray browseable = yes read only = yes guest ok = yes
We could have restricted guest ok to no, but, since no one is allowed to write to the share, and it’s only family on our network, it was easier to allow guest access. The DVD and Blu-ray collections are on separate drives, but, to the end user browsing them from the network, they just appear as separate folders.
This covers the sharing side of things. Once you’ve put content in one of the mount points, getting it in to KODI to be scraped is fairly simple. In KODI, click:
Movies > Add videos > Browse
Browse to a directory like /mnt/DVD/Movies, and in the area where KODI asks you to Enter a name for this media source, give it a title like DVDMOVIES, then click OK.
The next screen lets you set the type of content in the directory. Choose from Movies, Music videos, None. or TV shows. After you pick the type of content, KODI will list an initial “information provider.” The information provider is the site KODI scrapes for the Movie/Music video/TV show information. If you have movies in their own sub-folder, you can select the Movies are in separate folders that match the movie title switch, but even if you leave this off, KODI will scrape movies in sub-folders as long as you leave the Scan recursively switch set to on.
Clicking on OK will prompt you if you want to refresh information for all items within this path. Click OK to begin scraping. Now, if you escape back to the main KODI interface, some movies should be listed under Movies. There are a number of reasons why a movie might not be listed, but it mostly boils down to naming media correctly. The KODI wiki is the authoritative source on naming media for KODI, and covers a lot of different scenarios (for example: DVD movies spread across 2 files/DVDs):
http://kodi.wiki/view/Naming_video_files/Movies http://kodi.wiki/view/Naming_video_files/TV_shows http://kodi.wiki/view/Naming_video_files/Music_videos
If a movie (that you know is in the path) doesn’t get scraped, click the settings gear in the top left corner, then click the Event log.
This is a bit of a simplified overview of our KODI server setup. Over the years, it’s morphed a lot, so a lot has changed: device names, the way we named our media, even what got included with the media. When we first used transcode to rip DVDs, we never ripped subtitles. Handbrake makes everything so easy that we started ripping subtitles. DVDs we ripped before we started, including subtitles, all got thrown into the top level DVD folder /mnt/DVD/Movies. DVDs ripped with subtitles get their own sub-directory. For example: the movie ‘They Call Me Bruce’ would be in /mnt/DVD/Movies/They Call Me Bruce. Incidentally typing the path in a terminal is easy if you use quotation marks:
cd “/mnt/DVD/Movies/They Call Me Bruce”
Tab-completion works if you use quotes.
This might seem like the least planned media setup in the history of media centers, and looking at the /etc/fstab, it looks like a mess, but it’s an evolution of a system started back when KODI was still XBMC 10.0, using very different hardware. We’ve considered shelling out for a NAS, or simply buying one, but we like having a server that we can exit to a desktop and use if we needed so see something not in KODI.