MiniDLNA: A Lightweight UPnP Media Server

For several years, I have been using MediaTomb as a streaming media server. Functionally, MediaTomb works fantastically, but a few things about it have bugged me for some time:

  1. The arrangement of media files. MediaTomb creates two hierarchies of file listings, called PC Directory and Folders. The former lets you browse from the root of your filesystem, and is a bit useless when the directory you are sharing is several levels down. Browsing through those levels each time you want to watch something is annoying. So I prefer the Folders listing, which places your shared folders at the top level and lets you drill down to subdirectories from there. Here’s where we get to the problem: While timed folder rescans and inotify allow you to add new files to the media browser simply by copying/moving those files to a watched directory, new files added in this fashion will show up in their own top-level directory under the Folders view, rather than staying organized. The only way around this is to use the web interface to delete the watched folder and re-add it, forcing a full re-scan of the media directory. It’s hard to tell whether this is a MediaTomb issue or a problem with the PS3′s DLNA client.
  2. Configuration Syntax. The configuration file for MediaTomb is in XML format. I have never been a fan of XML syntax in a config file.
  3. Streaming to a PlayStation 3 is not supported “out-of-box”. It’s simple enough to enable (in fact the option is present in the default config file, commented out), but this is an annoyance nonetheless.
  4. MediaTomb is not actively maintained. Releases are few and far between, the last of them coming over a year and a half ago.

That is not to say that that MediaTomb is without redeeming features. For one, it allows you to write scripts to transcode media types which it cannot handle. You won’t be able to seek or pause when viewing a transcoded file, but this is actually not a MediaTomb limitation. The very nature of transcoded media is that it is being converted on-the-fly, so seeking just isn’t possible. Another nice feature of MediaTomb is that its folder layout is scriptable, allowing you to control how the media files are presented in the file browser. Perhaps this would allow me to come up with a solution to my file arrangement problem, but I just don’t have the time or inclination to try to fix it.

A few days ago, while browsing Reddit, I saw a recommendation to use MiniDLNA to stream media. It has turned out to be a very simple to use alternative, and I have now officially switched to it from MediaTomb.

MiniDLNA is written and maintained by a Netgear employee and is used in their ReadyNAS line of storage devices. It is both actively maintained and easy to use.

MiniDLNA is not as feature-rich as MediaTomb. It is not scriptable, and it cannot transcode media. But what you sacrifice in features, you gain in sheer ease of use. You need only set one configuration variable in /etc/mediatomb.conf to get it up and running:

Additional media_dir lines can be added to share other directories. Streaming to the PS3 is supported without any special configuration needing to be done.

And that’s it! There are, of course, other things you should set up. First, you can change the server name shown to clients by setting the friendly_name value. Also, while not required, enabling MiniDLNA’s cache (which will keep it from needing to re-scan everything when it is restarted), as well as logging, are both good ideas. You’ll need to set up directories for both, which are writable by the nobody user (the user under which MiniDLNA runs). This can be accomplished by running the following two commands as root:

Then configure the following two parameters in the config file:

MiniDLNA has proven to be perfect for me. I don’t do any transcoding or scripting with MediaTomb, so I am not missing those features. MiniDLNA supports inotify to add new files to the media browser automatically, and does a better job of organizing files added to the watched folders. They stay organized in the the proper folder, but sometimes new files appear at the bottom of that folder’s file list rather than in place alphabetically. However, this doesn’t seem to be a MiniDLNA bug, but rather a bug in the PS3′s DLNA client since the files appear in the correct order the next time the PS3 is started up, or after telling the PS3 to do a new search for media servers.

All in all, if you want a simple alternative to MediaTomb, then I highly recommend MiniDLNA.