Turn a Raspberry Pi into a DLNA server
Background
I recently bought myself an Apple TV. Absolutely amazing piece of design and technology but ... movies on the Apple Movies platform are (very) expansive. And what about my actual collection of video files ? There is no way to connect storage on the Apple TV. So, I needed to find a solution to play the movies files that I filmed with my camcorder on the Apple TV.
Actually, there is a way. The Apple TV AppStore is providing an app called InFuse. It allows you to play remote content. One of the supported protocol is DLNA. DLNA protocol is not new and usually well supported. It allows you to stream content over the network (local ideally to keep smooth broadcasting). You can find more details about DLNA here. For free, you can also use VLC for AppleTV. The user interface and functionalities are very light but if you don't need fancy menus and details about movies, this is a good start.
Disclaimer : this article is not encouraging piracy, you can perfectly generate video content by yourself or buy legit movies. I'm personally about photography.
Disclaimer : this article is not encouraging piracy, you can perfectly generate video content by yourself or buy legit movies. I'm personally about photography.
Let's go !
I have a Raspberry Pi3 who is managing my home automation installation and it is definitely not over-utilized so this is a great platform to play with. Since it runs Raspbian (Debian port for Raspberry) it is very easy to tweak it.
It exists a very nice app called mini dlna server part of the Raspbian repository so installation is very straight forward.
First, let's updates the Pi with the latest available patches
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get upgrade
Next, let's install mini-dlna server
$ sudo apt-get install minidlna
Next we need to configure it. Configuration is located into /etc/minidlna.conf. There are actually two things to do : tell mini dlna where to look for media files and give mini dlna server a friendly name.
$ vi /etc/minidlna.conf
Locate this section in the configuration file :
# * "A" for audio (eg. media_dir=A,/var/lib/minidlna/music)
# * "P" for pictures (eg. media_dir=P,/var/lib/minidlna/pictures)
# * "V" for video (eg. media_dir=V,/var/lib/minidlna/videos)
and change it to the relevant location. Assuming that your media storage is mounted on /mnt/DLNA, here is the sample configuration lines :
media_dir=A,/mnt/DLNA/Music
media_dir=P,/mnt/DLNA/Pictures
media_dir=V,/mnt/DLNA/Movies
media_dir=P,/mnt/DLNA/Pictures
media_dir=V,/mnt/DLNA/Movies
Now, let's give mini dlna server a friendly name :
# Name that the DLNA server presents to clients.
friendly_name=Raspberry
friendly_name=Raspberry
Once you are ready, save the file and then start the server with the below command :
$ sudo service minidlna start
Your server is ready, you just need to use any compatible DLNA client/player such as my Apple TV and InFuse.
The above setup is very basic and probably need some tweaks, feel free to look at the configuration file for more details or even have a look at the various wiki around mini dlna server. There is an active community.
Cool !!
ReplyDelete