How to get a media server with Raspberry
After we seeing how to configure , to use commands e and transform it into NAS we will see in this article how to get a media server with Raspberry.
What is a media player
A media player server is nothing more than a multimedia content aggregator for our home network. Obviously the final devices will be our Smart TVs or our mobile or fixed devices. We have numerous server programs available for this use but as an exercise today we will install and configure miniDLNA. The advantage of using a Raspberry Pi for such a setup is in the energy savings we have.
A media server with Raspberry: miniDLNA
To install the server software on our Pi let’s connect through our SSH client to the same and give the following commands:
sudo apt-get update
sudo apt-get install minidlna
in this way we will first update the list of our repositories and with the second command install the actual program.
To configure the media server miniDLNA
At the end of the installation we will modify the server configuration file. In advance we will make a backup copy of the same to avoid losing or damaging the file and having to reinstall everything.
sudo cp /etc/minidlna.conf /etc/minidlna.conf.orig
sudo nano /etc/minidlna.conf
We then open the configuration file with the Nano editor to be able to edit it. As we have seen for Samba to activate or deactivate an option just remove or add # in front of it. The main directive to be changed will be the path to find our files within the system. We will therefore modify the following line as follows:
#media_dir=/var/lib/minidlna
#ESEMPIO 1
#media_dir=V,/media/nas/VIDEO
#media_dir=A,/media/nas/MUSICA
#media_dir=P,/media/nas/FOTO
#ESEMPIO 2
#media_dir=/media/nas/
In the first example we are going to indicate to our server all the paths of the various folders and their contents. In the second example, instead of communicating a generic path for all the categories that the client can read.
We will then go to activate the system logs to understand, in the event of a malfunction, what is wrong.
# Path to the directory that should hold the log file.
log_dir=/var/log
# Minimum level of importance of messages to be logged.
# Must be one of "off", "fatal", "error", "warn", "info" or "debug".
# "off" turns of logging entirely, "fatal" is the highest level of importance
# and "debug" the lowest.
log_level=warn
After that we will give a name to the server, we will enable the automatic search for new files and folders and we will assign the Raspberry IP.
# Name that the DLNA server presents to clients.
friendly_name=INFORMATICA37-DLNA
# IPv4 address to listen on (e.g. 192.0.2.1).
listening_ip=192.168.1.240
# Automatic discovery of new files in the media_dir directory.
inotify=yes
We could also enable the model name, Tivo support and change the notify interval.
# Model name the server reports to clients.
model_name=Windows Media Connect compatible (MiniDLNA)
# Support for streaming .jpg and .mp3 files to a TiVo supporting HMO.
enable_tivo=yes
# Notify interval, in seconds.
# notify_interval=895
notify_interval=30
Once the configuration is complete we could close the file with ctrl + x and give Y to confirm. Then restart the Raspberry and wait for the list file to update.
How I can find my contents
Now that we have completed the installation and configuration of the Media Server we could take advantage of our multimedia contents both on Smart TVs, equipped with DLNA clients both on our mobile and fixed devices.