21 January 2014

MiniDLNA on a raspi

One of the best things in life is that you never stop learning and/or discovering new and exciting things. Today was a great day in that sense. I discovered the set -u builtin which warns you if a variable is not set and also that it is good to talk to people to share ideas. (I've been talking to a cousin of mine for a long, long while this afternoon, interesting things).
But in respect to software, the discovery of the day/week/month and probably the whole year (hmm) was MiniDLNAminidlna is a streaming server that can serve your files across the network to any device that supports the UPnP (Universal Plug and Play) protocol.
I was looking for a way to stream media from my raspi. Since I had only tried to do it once and it was with vlc, I installed vlc in my raspi and tried to stream video with it but it was almost impossible. It turned out to be a too resource intensive method.
Then I used a clever way of streaming media from my raspi to my network. I copied the files that I wanted to stream to /var/www and accessed the contents of that directory over http, either using vlc or just a web browser. But no matter how clever this idea is, it is not very handy. You have to do a lot of manual work.
Today I asked on irc and a friend of mine said he used minidlna. I installed and configured it follwowing a tutorial I found on the web. Basically what I did was to edit/etc/minidlna.conf with several settings that apply to my device. It is pretty simple and straightforward, and in case you do not know what to put in there, you can always use the default settings.
Then from another computer I launched vlc and went to View --> Playlist --> Local Network --> Universal Plug n' Play and there I could see all the files that I wanted to share. Impressive, huh?
And the best thing yet to come, minidlna does not stress your raspi cpu at all. While working, it only used 0.3% of the cpu power.
2966 minidlna 20 0 37332 5824 552 S 0.3 1.3 0:00.22 minidlna