Setup Personal MediaServer Using RaspberryPi and MiniDLNA

Few weeks back my sister ordered a raspberry pi so that she could get started with linux and small DIY projects in electronics.

As we didn’t have any modules/sensors/components needed for electronics projects; we decided that we will setup a media server using the RPi, we already have a 1TB external Hard Disk drive; which can be used for the storage.

There were a lot of different tools to implement it, some of them are:

Out of these, Plex Media Server and Universal Media Server are not free and open source softwares.

Open Media Vault is free and open source but the installation processs is quite complicated, besides that I don’t see any benifit of putting a lot of efforts in installing an enterprise level NAS solution for streaming videos on a couple of computers in the LAN.

The remaining two MiniDLNA and Media Tomb, Both of them are free and opensource.

The debian packages for MiniDLNA were available in Raspbian Jissie repository. For Media Tomb I could not find any packages in the Raspbian Jissie repo. Therefore I went ahed with MiniDLNA.

About ReadyMedia/MiniDLNA.

ReadyMedia (formerly known as MiniDLNA) is a simple media server software, with the aim of being fully compliant with DLNA/UPnP-AV clients. It is developed by a NETGEAR employee for the ReadyNAS product line.

It is not in any way endorsed by the Digital Living Network AllianceĀ®.

Source.

Let’s begin

Install MiniDLNA

$ sudo apt-get install minidlna

Configurations for MiniDLNA

To make changes in the config, edit the file /etc/minidlna.conf

$ sudo vim /etc/minidlna.conf

add or uncomment these lines in the config.

media_dir=<Path for HDD partition>
log_dir=/var/log
log_level=general,artwork,database,inotify,scanner,metadata,http,ssdp,tivo=warn
inotify=yes
notify_interval=300

the first line;

media_dir=<Path for HDD partition>

this is the tricky part of this config. You have to make sure that your user have all the required permissions on the mounted disk partition and the file system allows you to change the permission. For me the default mount point in debian Jissie which is /media/pi/ didn’t work, so I had to change the mount point to /home/pi/media/hdd also for mounting I had to;

$ sudo mount -t ntfs /dev/sda1 /home/pi/media/hdd -o umask=222

after this everything worked fine.

Start the service

To start the minidlna service.

sudo service minidlna start

To update the media database.

sudo service minidlna force-reload

This may take longer time if you have a huge collection of media files. But once it is done, it works just fine.

How to use it?

You can use VLC media player on desktop as a UPnP/DLNA client.

  • In VLC, go to View -> Playlist. Click the Universal Plug n Play option in the left column.

  • If you are connected to the same network as your raspberry pi on which minidlna service is running, then you will be able to see that device in the list.

  • To list all files in the drive It might take a long time depending upon the size of your collection.

  • Once all the files are listed in the VLC media player’s playlist, you can play the files just by clicking on them.

On Android devices, you can use Slick UPnP

The source code for this tool is available on github.

To stream media on android devices, just connect to the same network as your media server is connected to and you will be able to see it in the Slick Upnp android app.

comments powered by Disqus