Multimedia file server (DLNA/UPnP)

Have you ever wanted to watch movies, listen to the music or watching your picture collection on your TV or smartphone without a need to connect your laptop to the tv set? Maybe you have PS3 and you always dreamt of having access to those resources with PS3?
Of course you can always find a software for your laptop, but wouldn’t it be cooler to have your whole multimeda library just waiting for you in your network, ready whenever you want to use it and consuming only a fraction of electric power of what your laptop/desktop usually consumes?

You didn’t buy RPi just to watch beautiful full HD movies ;) you can do with it nearly everything so why not changing it to your multimedia file server. With our help it is VERY easy! Just follow the steps below and you can enjoy it :)

Update list of packages…

…and upgrade packages

When asked:

After this operation, xxx kB of additional disk space will be used.
Do you want to continue [Y/n]?

Confirm with Y.

It can take a lot of time to complete this step so be patient :)

Now it is time to install minidlna, our DLNA server software.

Again, when asked:
After this operation, XXX MB of additional disk space will be used.
Do you want to continue [Y/n]?

Confirm with Y

minidlna will be now downloaded and installed. It may take some time…

When it is done installing we need to make sure that we have anything to be shared :) I assume you have USB drive connected to RPi – in order to have it available for mindlna, we need to make sure it is mounted in specific/defined folder in file system.
As you may already know /etc/fstab file contains information about your file systems that are mounted during boot time. You will NOT see here your USB drive

So let’s add it – first we need to identify device ID by executing

Above you can see the last line describing my USB drive. I strongly recommend that name of the disk do NOT contain any spaces (you can change it in Windows and, of course, without disconnecting it from RPi using ntfslabel from the ntfs-3g package in case of ntfs file system disk).

We need to make sure that there is a directory to have disk mounted to. Let’s create directory then and set proper privileges:

Now we can edit /etc/fstab file. The easiest way to do that (for ‘Windows People’) is to use nano editor, but you can use anything else (like vi). Below you can see final file with new line highlighted:

UUID and type (ntfs) is the same as we got from blkid command. All fields are tab separated. I have added mask option to make sure that disk files are mounted with full privileges.

Now we need to identify directories that will be sources for Pictures, Video files and Music files. Let’s have a look at disk content:

Ok, so directories’ names, which I use for keeping media files are self explanatory. Now you need to tell minidlna where your files are – you do that by editing minidlna configuration file: /etc/minidlna.conf

There are a few lines to be modified:

1. Media directory(-ies) media_dir – drectory with your media files. You can specify what type of media there is or not. If you do, it will make navigation in your ‘client’ device a bit more smart/user friendly. Since I have dedicated directories for different types of files I will specify what is where:

2. Database location db_dir – where minidlna database files will be kept.

3. Log files location log_dir – here just un-comment the line:

4. Provide server name – it will be visible in your clients:

Save the file.

What we did not do yet is we did not create minidlna db directory.

After doing all this modification force minidlna database recreation by running:

You can check the log for more information/progress on db building:

You can also check if minidla is currently running:

If your minidlna does not start automatically with the system, run:

If you’ve done everything right, it should be working now :)

ENJOY!

Here is your raspberry pi ampilight system!