Page 1 of 6 123 ... LastLast
Results 1 to 10 of 53

Thread: Guide to Installing and Running MiniDLNA on an Ubuntu Server

  1. #1
    Join Date
    Aug 2008
    Beans
    81

    Guide to Installing and Running MiniDLNA on an Ubuntu Server

    I have recently been experimenting with running MiniDLNA on a headless Ubuntu Server and have hit a few snags. After a lot of search and a few pointers from this and other forums I have finally managed to get it running fine. In case anyone else has this problem I have written this guide to hopefully take some of the pain out of installing and configuring an amazing program.


    The Hardware

    My server is a headless HP Microserver running Ubuntu 10.04.3 LTS 64 bit edition accessed through Putty and Webmin (www.webmin.com). I have also tried this using a virtual setup using Virtual Box and that also worked fine.

    As a receiver, I am using an LG HX806SH Blu-ray player connected to my LAN by a Homeplug adapter. I have also tried using Windows Media Player and they both work fine. I would like to try this with VLC to test it on a Linux desktop but configuring VLC to receive streaming media from a server is beyond me right now.


    The Server Setup

    The server has a standard headless setup including Samba installed (a combination of Windows and Linux machines share files stored on it). If you need any help installing and using Webmin, I suggest you have a look at the excellent guide at http://www.kelvinwong.ca/2010/05/22/...-04-lts-lucid/.


    Installing and Configuring MiniDLNA

    For some reason, when I tried to install MiniDLNA, through Putty I received error messages. From reading around, it turns out that this is a common problem as some repositories are missing.

    In the end, these commands installed the package:

    Code:
    sudo apt-get install --reinstall python-software-properties && sudo dpkg-reconfigure python-software-properties
    
    sudo add-apt-repository ppa:stedy6/stedy-minidna
    sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get install minidlna
    I would also recommend installing the Webmin MiniDLNA module from https://sourceforge.net/projects/minidlnawebmin/

    If you are accessing the server through Webmin and are not sure how to install the module, save it to a local location (such as your desktop on your computer). Select the "Webmin Configuration" module which is under the "Webmin" tab. Select the "Webmin Modules" and choose to load the module “From uploaded file". Once the module has been installed it will be automatically be configured and it will be available under the "Servers" tab.

    Once this is installed, you need to configure the MiniDLNA conf file located at /etc/minidlna.conf.

    You can use your favourite text editor or if you are accessing this through Webmin, you can use the "Edit" option in "File Manager". If you have installed the Webmin module, you can also change all of the settings from there.

    My minidlna.conf file reads as follows:

    Code:
    # port for HTTP (descriptions, SOAP, media transfer) traffic
    port=8200
    
    # network interface to bind to (this is the only interface that will serve files)
    #network_interface=eth0
    
    # set this to the directory you want scanned.
    # * if have multiple directories, you can have multiple media_dir= lines
    # * if you want to restrict a media_dir to a specific content type, you
    #   can prepend the type, followed by a comma, to the directory:
    #   + "A" for audio  (eg. media_dir=A,/home/jmaggard/Music)
    #   + "V" for video  (eg. media_dir=V,/home/jmaggard/Videos)
    #   + "P" for images (eg. media_dir=P,/home/jmaggard/Pictures)
    
    media_dir=V,/media/server/server/Media/Films
    media_dir=V,/media/server/server/Media/TV
    media_dir=V,/media/server/server/Media/Commedy
    media_dir=V,/media/server/server/Music/Videos
    media_dir=A,/media/server/server/Music/Music
    media_dir=P,/media/server/server/Stuff/Pictures
    
    # set this if you want to customize the name that shows up on your clients
    friendly_name=MiniDLNA Server
    
    # set this if you would like to specify the directory where you want MiniDLNA to store its database and album art cache
    db_dir=/media/server/server/Backup/Server/MiniDLNA
    
    # set this if you would like to specify the directory where you want MiniDLNA to store its log file
    #log_dir=/var/log
    
    # this should be a list of file names to check for when searching for album art
    # note: names should be delimited with a forward slash ("/")
    album_art_names=Front.jpg/front.jpg/Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg/AlbumArt.jpg/albumart.jpg/Album.jpg/album.jpg/Folder.jpg/folder.jpg/Thumb.jpg/thumb.jpg
    
    # set this to no to disable inotify monitoring to automatically discover new files
    # note: the default is yes
    inotify=yes
    
    # set this to yes to enable support for streaming .jpg and .mp3 files to a TiVo supporting HMO
    enable_tivo=no
    
    # set this to strictly adhere to DLNA standards.
    # * This will allow server-side downscaling of very large JPEG images,
    #   which may hurt JPEG serving performance on (at least) Sony DLNA products.
    strict_dlna=no
    
    # default presentation url is http address on port 80
    presentation_url=http://minidlna/index.php
    
    # notify interval in seconds. default is 895 seconds.
    notify_interval=895
    
    # serial and model number the daemon will report to clients
    # in its XML description
    serial=12345678
    model_number=1
    As you can see, I've made a few changes to the standard file:

    • I have added various sources of videos
    • I have changed the name of the server so I can recognise it easily on the network
    • I have moved the location of the database to a location that I backup each day and is shared by Samba (this is for my personal benefit only)
    • I have added extra filenames to the "AlbulmArt" section as I usually call the front cover of an album "Front"

    Despite the line “# default presentation url is http address on port 80” MiniDLNA does not have a webpage that it can be controlled from. From what I can gather, this was going to be a future feature that was not completed for whatever reason. However, the Webmin module takes care of everything that you need.

    From the "Command Shell" in Webmin or through an SSH session using Putty, you can control MiniDLNA using the commands:

    Code:
    sudo /etc/init.d/minidlna stop
    sudo /etc/init.d/minidlna start
    At first run, MiniDLNA will scan all of the folders (and their sub-folders) it has been pointed at and make all of these files available. The scan is extremely quick (less than 10 minutes to scan about 12,000 files).

    The Webmin module has a "Restart" button but for some reason (on my set-ups) it does not work properly. It will stop MiniDLNA but when it tries to restart it, it fails. Trying to manually start it using the command "sudo /etc/init.d/minidlna start" after using this "Restart" does not seem to work and the only way I have found to resolve this is to restart the whole server.


    Adding or Removing Files of Folders from the Database

    In my experience, MiniDLNA tends not to notice if a file has been added or removed from the folders so the database does not update and new files are not shown on your device and old files are still shown even though they have been removed. This seems to be a problem with MiniDLNA and not the receiving soft/hardware. If you change the name of the server, the soft/hardware picks that up fine.

    Some people have had success with the command:

    Code:
    minidlna -R
    or by removing the file /tmp/minidlna/files.db and restarting the server using the command:

    Code:
    rm -rf /tmp/minidlna
    Someone else suggested using the command:

    Code:
    minidlna -R -f /tmp/minidlna.conf
    However, I have found the easiest and most successful method is to use the "Rescan" button in the Webmin interface. This button deletes the MiniDLNA database and rescans from scratch. On my system, this new scan took less than 10 minutes to scan about 12,000 files. After the scan, any new files appear in the database and any deleted files are removed.


    Outstanding Problems

    The only thing I have not been able to get MiniDLNA to do so far is display my photos properly on the Blu-ray player even though they display fine on Windows Media Player. On the Blu-ray, it shows all of the folders where my pictures are stored and even gives me the option to search by camera but when I try to view the pictures or look into the folders, the folders are all empty. This suggests it is something to do with the Blu-ray player and not MiniDLNA however, to be honest this is not an issue for me as my main aim was to stream videos and music and it works perfectly for that.

    If anyone can point me to a walkthrough of how to receive streamed videos and music on VLC I would be grateful so I can test this set-up on that and add it to this guide.

    I hope you find this guide useful and it takes away some of the headaches I've had with setting up this excellent program.

  2. #2
    Join Date
    Oct 2007
    Location
    Lancashire, UK
    Beans
    41
    Distro
    Xubuntu 12.10 Quantal Quetzal

    Re: Guide to Installing and Running MiniDLNA on an Ubuntu Server

    If anyone can point me to a walkthrough of how to receive streamed videos and music on VLC I would be grateful so I can test this set-up on that and add it to this guide.
    To view the server on a Linux desktop, you can use Totem (IIRC it's the default media player on Ubuntu) with the Coherence plugin enabled.
    Coherence is a UPnP/DLNA controller which allows Totem to play the content served by miniDLNA.
    It's pretty easy to use - available UPnP and DLNA servers are displayed in the sidebar and media is browseable via the tree.

    MiniDLNA tends not to notice if a file has been added or removed from the folders so the database does not update and new files are not shown on your device and old files are still shown even though they have been removed
    The problem of files not being added to the database without a rescan is due to Samba shares not creating an inotify event. The issue does not exist when other methods are used (e.g. NFS shares or local access). To save yourself a rescan for an individual file you can 'touch' the file from a terminal on the server (e.g. an ssh/putty session or your webmin terminal) which inotify will pick up, and therefore so will miniDLNA.

    e.g.
    Code:
    touch /media/server/server/films/S-T/Three_Musketeers.mpg
    Obviously, for a lot of files this can be more hassle than a rescan.
    I'm not certain, but to remove files from the DB it may be a case of 'touching' the parent folder.

    /Craig
    Last edited by craigchambers; October 24th, 2011 at 09:57 AM.

  3. #3
    Join Date
    Aug 2008
    Beans
    81

    Re: Guide to Installing and Running MiniDLNA on an Ubuntu Server

    Hi Craig,

    For some reason my version of Totem (which does indeed come as standard on Ubuntu 11.10 32 Bit) will not see the Coherence plugin. When I used the Ubuntu Software Centre and searched for Coherence, I was shown two options: the extra plugins for totem and UPnP Inspector. When they did not work, I removed both and tried to install Coherence using the command:
    Code:
    sudo apt-get install python-coherence
    This seemed to install coherence with the latest version but it still does not show up in Totem.

    The extras plugin appears to have other plugins but there is no mention of Coherence. I tried activating all of the plugins but this did not show me a DLNA option in the drop-down. There is a “Python Console” plugin. When this plugin is activated, there is a new menu item of “Python” which opens a console which appears to be very similar to a text editor. As I do not know anything about Python, I stayed well clear of that one.

    UPnP inspector will see the MiniDLNA server but I cannot find any way to get it to play the files it finds.

    Thanks for your advice. I tried to add a file using the "touch" command. Unfortunately this did not work. I think it may have something to do with the there being a space in the name. I tried the commands:

    touch /media/server/server/films/S-T/New Film.mpg
    and
    touch "/media/server/server/films/S-T/New Film.mpg"

    but neither worked.

    Thanks for the thought though.

    Damian

  4. #4
    Join Date
    May 2011
    Beans
    6

    Re: Guide to Installing and Running MiniDLNA on an Ubuntu Server

    Don't get caught out with minidlna apparently not starting automatically.........

    When you use apt-get to install minidlna on Ubuntu Server it installs the start and stop scripts in the /etc/rcN.d folders with the minidlna server starting almost immediately in the boot process. This is too early! Things like RAID partitions might not be ready to be probed by minidlna at this point, so you need to delay it to later..... read on.....

    I'm running 11.10 (oneiric) and got minidlna to start automatically upon booting, with the following instructions:

    sudo apt-get minidlna install
    edit minidlna.conf to point towards the path for your video/audio etc.

    sudo update-rc.d -f minidlna remove
    this removes the incorrectly numbered start up scripts.

    sudo update-rc.d minidna defaults 99 01
    creates new start up scripts which will start near the end of the boot process

    All is now good in the world......

  5. #5
    Join Date
    Sep 2009
    Beans
    9

    Unhappy Re: Guide to Installing and Running MiniDLNA on an Ubuntu Server

    Thank you for your very concise guide to minidlna.
    I needed a dlna server to connect my Raidsonic MB3011 to my Philips TV.
    So I mounted the NAS to my Ubuntu Box and stream it with minidlna.
    As the MB3011 is not always on I disabled autostart and everything works fine.
    A strange thing I noticed is that the default database location is in /tmp and not in /var/cache as the config file suggests.
    Thus I uncommented the database line to get the database into the place where it should go.
    Strange enough the server log file gets then into that location too.
    As minidlna does not install a logrotate script it might be necessary to add it manually to /etc/logrotate.d if log files grow large.
    BTW: I have app. 500 videos and no music on my NAS and building the database takes about 2 hours so I do not regard this as fast ;-( I guess this has to do with the Wifi connection I have to my NAS and I further guess that the file size matters at scanning.
    As a result to my setup it can be very annoying to get new movies into the database if the auto recognition of new movies does not work properly.
    Update:
    After re-starting the service I found that the database was going to be rebuilt from scratch.
    This means that whenever I start minidlna to stream something I need to wait for 2 hours before the database gets ready.
    This is a no go, so I uninstalled minidlna.as it seems to be useless to me in its current state
    Last edited by latimerio; November 17th, 2011 at 03:19 PM. Reason: formatting issue

  6. #6
    Join Date
    Oct 2008
    Location
    West Lafayette, Indiana
    Beans
    26
    Distro
    Ubuntu 10.04 Lucid Lynx

    Lightbulb Re: Guide to Installing and Running MiniDLNA on an Ubuntu Server

    Quote Originally Posted by latimerio View Post
    Thank you for your very concise guide to minidlna.
    I needed a dlna server to connect my Raidsonic MB3011 to my Philips TV.
    So I mounted the NAS to my Ubuntu Box and stream it with minidlna.
    As the MB3011 is not always on I disabled autostart and everything works fine.
    A strange thing I noticed is that the default database location is in /tmp and not in /var/cache as the config file suggests.
    Thus I uncommented the database line to get the database into the place where it should go.
    Strange enough the server log file gets then into that location too.
    As minidlna does not install a logrotate script it might be necessary to add it manually to /etc/logrotate.d if log files grow large.
    BTW: I have app. 500 videos and no music on my NAS and building the database takes about 2 hours so I do not regard this as fast ;-( I guess this has to do with the Wifi connection I have to my NAS and I further guess that the file size matters at scanning.
    As a result to my setup it can be very annoying to get new movies into the database if the auto recognition of new movies does not work properly.
    Update:
    After re-starting the service I found that the database was going to be rebuilt from scratch.
    This means that whenever I start minidlna to stream something I need to wait for 2 hours before the database gets ready.
    This is a no go, so I uninstalled minidlna.as it seems to be useless to me in its current state
    FUPPES is quite a bit faster (from most other streamers), and the documentation has improved tremendously. I haven't had any issues downloading and compiling the latest version (691 IIRC) from the repos.

    http://fuppes.ulrich-voelkel.de/wiki...itle=Main_Page

  7. #7
    Join Date
    Aug 2008
    Beans
    81

    Re: Guide to Installing and Running MiniDLNA on an Ubuntu Server

    Hi latimerio,

    I'm so pleased that you found the guide easy to use even if it ended up not being suitable for your needs.

    With regards to the scan time, I can only guess that the problem is (like you say) related to the fact that the connection is a wireless one and the files are not always there for the database meaning that sometimes it scans and there are no files and then it scans and has to add the files from the NAS.

    My media files are held on a drive in the server so my scans are much quicker. I have around 1,800 video files of varying sizes, 2,800 music files and 300 pictures (which are now showing on my blu-ray player). A complete rescan of the database takes around 9 minutes which is a lot quicker than yours.

    Good luck with trying other programs and please let me know if you find a one that works. I'm always up for trying new programs to see how they compare.

    Damian

  8. #8
    Join Date
    Feb 2012
    Beans
    93

    Re: Guide to Installing and Running MiniDLNA on an Ubuntu Server

    hi damo12,
    maybe you could help me with this ... it's kind of new territory for me.
    1. I installed minidlna. After that I installed webmin.
    2. minidlna starts automatically after reboot and I also could access webmin .
    Two issues I have:
    1. when I login to webmin ... I don't know what to do next i.e. I don't see dlna module. Could it be because I didn't install it as a module of webmin? How could I re-do it?
    2. when I try to access dlna server from my smartphone it get connected to my server i.e. Ubuntu but it shows only 2 folders and it can't see any folders were actually my pictures and video were stored. FYI: I have samba installed and my home directory is shared so I'd expect to see all folders but I don't. Actually when I try to open e.g. Video folder it states: 'No files to display'. Maybe I should configure some files? BTW I could access my Linux home directory from iPad.
    Could you pls answer my question and explain how you practically are using it? I mean currently I'm playing with my smart-phone but the goal is to use dlna client on my TV. Could/should I delete both dlna and webmin and do it again?
    Thanks

    Thanks

  9. #9
    Join Date
    Aug 2008
    Beans
    81

    Re: Guide to Installing and Running MiniDLNA on an Ubuntu Server

    Hi susja,

    I'll do my best to help you through the problems as best I can.

    1. You need to ensure that you install the minidlna webmin module. You can find the latest version at http://sourceforge.net/projects/mini...2.wbm/download. Save the file to a local location (such as your desktop on your computer). Log into Webmin and select the "Webmin Configuration" module which is under the "Webmin" tab. Select the "Webmin Modules" and choose to load the module "From uploaded file". Once the module has been installed it will be automatically be configured and it will be available under the "Servers" tab. If you can't see it there, it might have placed itself in the "Un-used Modules" tab.

    2. I have never tried accessing my media through a smart phone only my Blu-ray player and Windows computers. From the description of your problems, it sounds like you have not configured the MiniDLNA conf file correctly. The file is located at /etc/minidlna.conf. Ensure that your locations are correct remembering that Linux filenames are case sensitive. Once you have configured this file to point at your media files tell minidlna to rescan your files using the "Rescan" button in the Webmin module. Do not try using the "Restart" button as in my experience this just stops the program from working.

    My Blu-ray player, scans the network and sees the server as miniDLNA server. Once I open that, I can see the files and then can select which one I want to view / listen to.

    My current minidlna.conf file is:

    Code:
    # port for HTTP (descriptions, SOAP, media transfer) traffic
    port=8200
    
    
    # network interface to bind to (this is the only interface that will 
    #serve files) network_interface=eth0
    
    
    # set this to the directory you want scanned. * if have multiple 
    # directories, you can have multiple media_dir= lines * if you want to 
    # restrict a media_dir to a specific content type, you
    #   can prepend the type, followed by a comma, to the directory: + "A" 
    #   for audio (eg. media_dir=A,/home/jmaggard/Music) + "V" for video 
    #   (eg. media_dir=V,/home/jmaggard/Videos) + "P" for images (eg. 
    #   media_dir=P,/home/jmaggard/Pictures)
    
    media_dir=V,/media/media/Films
    media_dir=V,/media/media/TV
    media_dir=V,/media/media/Comedy
    media_dir=V,/media/media/Daft
    media_dir=V,/media/media/F1
    media_dir=V,/media/server/server/Music/Music Videos
    media_dir=V,/media/media/Magic
    media_dir=V,/media/media/Stop and Think 
    media_dir=A,/media/server/server/Music/Music/iTunes 
    media_dir=P,/media/server/server/Pictures
    
    
    # set this if you want to customize the name that shows up on your 
    # clients
    friendly_name=MiniDLNA Server
    
    
    # set this if you would like to specify the directory where you want 
    # MiniDLNA to store its database and album art cache
    db_dir=/media/server/server/Backup/Server/MiniDLNA
    
    
    # set this if you would like to specify the directory where you want 
    #MiniDLNA to store its log file log_dir=/var/log
    
    
    # this should be a list of file names to check for when searching for 
    # album art note: names should be delimited with a forward slash ("/")
    album_art_names=Front.jpg/front.jpg/Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg/AlbumArt.jpg/albumart.jpg/Album.jpg/album.jpg/Folder.jpg/folder.jpg/Thumb.jpg/thumb.jpg
    
    
    # set this to no to disable inotify monitoring to automatically discover 
    # new files note: the default is yes
    inotify=yes
    
    
    # set this to yes to enable support for streaming .jpg and .mp3 files to 
    # a TiVo supporting HMO
    enable_tivo=no
    
    
    # set this to strictly adhere to DLNA standards. * This will allow 
    # server-side downscaling of very large JPEG images,
    #   which may hurt JPEG serving performance on (at least) Sony DLNA 
    #   products.
    strict_dlna=no
    
    
    # default presentation url is http address on port 80
    presentation_url=http://minidlna/index.php
    
    
    # notify interval in seconds. default is 895 seconds.
    notify_interval=895
    
    
    # serial and model number the daemon will report to clients in its XML 
    # description
    serial=12345678 model_number=1
    I hope this is of use to you.

  10. #10
    Join Date
    Feb 2012
    Beans
    93

    Re: Guide to Installing and Running MiniDLNA on an Ubuntu Server

    -damo12
    thanks so much for speedy reply.
    1. I was able to do 1. from your note and now I could see minidlna from webmin
    2. That sounds reasonable and I'll modify minidlna.conf file when I'll be at home
    3. After that I'll rescan it and home to access server from both my iPad and TV.
    Thanks again and I'll update you when I try.
    P.S. Since you are familiar with this stuff maybe you could explain me the difference between DLNA and Plex Media Server? I know that my TV supports both but I just don't know which one is better
    Thanks again

Page 1 of 6 123 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •