Tag/tag.png

Needs Updating
This article needs updating to include the latest versions of Ubuntu. More info...

MiniDLNA is server software with the aim of being fully compliant with DLNA/UPnP clients. The MiniDNLA daemon serves media files (music, pictures, and video) to clients on a network. Example clients include applications such as totem and xbmc, and devices such as portable media players, smartphones, and televisions.

MiniDLNA is a simple, lightweight alternative to MediaTomb, but has fewer features. It does not have a web interface for administration and must be configured by editing a text file.

Installation

sudo apt-get install minidlna

Configuration Globally (for all users)

The configuration file is /etc/minidlna.conf and these are the necessary descriptors:

#network_interface=eth0         # Self-discovers if commented (good with NetworkManager)
media_dir=A,/home/user/Music    # Use A, P, and V to restrict media 'type' in directory
media_dir=P,/home/user/Pictures
media_dir=V,/home/user/Videos
friendly_name=Laptop            # Optional
db_dir=/var/cache/minidlna      # Needs to be un-commented
log_dir=/var/log                # Needs to be un-commented
inotify=yes                     # 'no' for less resources, restart required for new media

Restart the daemon for changes to take effect:

sudo service minidlna restart

To rebuild the database use:

sudo service minidlna force-reload

Configuration Locally (per user)

Disable the global daemon:

sudo service minidlna stop
sudo update-rc.d minidlna disable

Create the necessary local files and directories as regular user and edit the configuration:

mkdir -p ~/.minidlna/cache
cd ~/.minidlna
cp /etc/minidlna.conf .
$EDITOR minidlna.conf

Configure as you would globally above but these definitions need to be defined locally:

db_dir=/home/$USER/.minidlna/cache
log_dir=/home/$USER/.minidlna                                                    

To start the daemon locally:

minidlna -f /home/$USER/.minidlna/minidlna.conf -P /home/$USER/.minidlna/minidlna.pid

In recent ubuntu versions, please replace minidlna with minidlnad.

minidlnad -f /home/$USER/.minidlna/minidlna.conf -P /home/$USER/.minidlna/minidlna.pid

To stop the local daemon:

xargs kill </home/$USER/.minidlna/minidlna.pid

To rebuild the database:

minidlna -f /home/$USER/.minidlna/minidlna.conf -R

In recent ubuntu versions, please replace minidlna with minidlnad.

minidlnad -f /home/$USER/.minidlna/minidlna.conf -R

To have minidlna load at startup, create the file ~/.config/autostart/minidlna.desktop:

[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=MiniDLNA
Comment=Server to stream media over network
Exec=minidlna -f /home/$USER/.minidlna/minidlna.conf -P /home/$USER/.minidlna/minidlna.pid
StartupNotify=false
Terminal=false
Hidden=false

Troubleshooting

MiniDLNA problems that have been solved.

Flawed Official Version (Oneiric)

The official version of MiniDLNA in the Oneiric repositories (1.0.21+dfsg-1) is flawed (possibly because it hasn't been compiled with 'libavcodec' support). With this version you will not be able to play mp4 video files, display pngs, and possibly other things. This version too has a problem with permission problems in /var/cache/minidlna - it kept saving some files in the album art directory as root (possibly others) but requires user 'minidlna' to access them. I also seem to remember a write access problem to the files.db file.

Fix with Stedy Version

A rebuilt Stedy's minidlna for Oneiric can be found here.

Firewall Rules

If using a firewall the the ssdp (1900/udp) and trivnet1 (8200/tcp) ports will need to be opened. For example this can be done with arno's iptables firewall by editing firewall.conf to:

  OPEN_TCP="8200"
  OPEN_UDP="1900"


CategoryNetworking

MiniDLNA (last edited 2014-05-31 18:41:23 by 111)