DLNA on SmartOS

DLNA on SmartOS

Digital Living Network Alliance (DLNA) was a fantastic answer to the age-old question of, "How the heck are we going to get all of these media libraries and media players to talk to each other?!"

I say "was" because Plex is pretty much the only serious media server at the point of writing this article.

What follows is a very brief guide on setting up Mediatomb, a DLNA compliant Media Server, on a SmartOS zone.  While Plex can operate under SmartOS as well, it can only do so within an LX branded zone, which will be the topic of a later post.

Installing

I picked Mediatomb because it's the only service that even comes close to being a Plex alternative that is already included in pkgsrc, making the decision (and installation) rather simple:

# pkgin in mediatomb

At the time of writing this article, the official package doesn't come with an SMF manifest, and we really want SMF to manage Mediatomb, so we're going to roll our own manifest.

/root/mediatomb.xml

Before we enable mediatomb, we will need to re-work the configuration a little bit.

Configuration

The Mediatomb configuration is an XML file located at /opt/local/etc/mediatomb/config.xml.  It is split into three major subsections: server, import and transcoding.

At the time of this writing, there is an error in the import section of the default Mediatomb configuration that ships with SmartOS.  Specifically, there are references to three javascript files under the /usr/pkg/share/mediatomb/js directory.  That directory doesn't exist in SmartOS, and should be changed to /opt/local/share/mediatomb/js.  Once you have fixed this, you may now enable mediatomb.

# svcadm enable mediatomb

Any additional changes made below should be followed by a refresh to mediatomb:

# svcadm refresh mediatomb

Server

The server section of Mediatomb's configuration controls how it presents its self to the network.  Points of interest here include:

  • config/server/ui.enabled controls if the web UI (WUI) will be active or not.
  • config/server/ui/accounts.enabled controls if the webserver will authenticate users (default: no)
  • config/server/ui/accounts/account user password pairs for each user.
  • config/server/port sets the port that Mediatomb will listen to HTTP traffic on (default 49152 or the next highest).
  • config/server/name sets the name that Mediatomb will be labeled as on DLNA clients.

I would recommend locking mediatomb down to use users and password to access it's WUI as that interface can expose any filename that the mediatomb user can read in the zone.  It might also be wise to disable the WUI entirely if you don't need it active.

Import

The import section of Mediatomb's configuration controls how it processes incoming media.  I didn't find anything overly interesting here besides the required modifications in the above section.

Transcoding

The transcode section of Mediatomb's configuration controls how it converts media into usable formats for display devices.  I've been running Mediatomb on an HP N54L Microserver, which is incapable of transcoding even a single stream of 1080p in anything close to real-time, which made this section completely useless for me.  In my reading, it also appears that Mediatomb has no way of selectively transcoding media: It tends to just transcode everything if given the chance.  This could be my error, but since my hardware is incapable of this functionality, I just turned it off.

If you manage to get this to work for you, please let me know about it, as I'd love to append this section with useful information.

Conclusion

This guide is by no means exhaustive.  If you have more time, I highly recommend reading the official Mediatomb Documentation if you would like to configure your installation any further.