Raspberry Pi and thanks minidlna DLNA

We will now make available our library of videos (and other media if you want) to your TV or freebox.

Raspberry Pi et DLNA grâce à minidlna

As we have already seen with the creation of our disk, We now have a partition for data sharing. My home is in /Media/usbdrive/share. Turn to the installation and configuration of minidlna.

  1. Download and install minidlna. You will need to install quite a package for a total of approximately 7 MB. Many bookstores for codecs I guess.
    apt - get install minidlna
  2. Update the file /etc/minidlna.conf :
    1. Add the directories that you want to share. Home I added the line :
      media_dir = V,/Media/usbdrive/share/Videos

      It shares the directory by specifying only the videos should be displayed.

    2. Change the type of display on TV. For me I prefer to directly navigate the tree so I use the option ' B’ :
      root_container = B
    3. Change the name that will be displayed on the TV (or console or …)
      Friendly_name = RaspberryPiHomeServer
    4. Automatically enable the discovery of new files. Attention it seems that consumer resources.
      inotify = yes
  3. Restart the service so that it can take into account your library. This operation is to do whenever your library will be changed (unless you have enabled auto-discovery)
    Service minidlna force-reload

Voilà. You have right now to a server visible by compatible devices and that broadcast you your videos by the network.

Serveur minidlna sur la Freebox

Raspberry Pi server with minidlna on the Freebox

Affichage de vidéos disponibles sur la Freebox grâce à minidlna

Showing videos available on the Freebox thanks minidlna

Cheers for a next service (je ne sais pas encore lequel 😉 )

You may also like...

  • silco

    What interest compared with XBMC ? (XBMC is airplay so even no need to install airplay and more)

    • I did not need XBMC, interface etc.. As stated in the first article, I would like to have a set of services on the server so install just XBMC for AirPlay would consume too much memory for simple functionality

  • Elpabre

    Hellos,

    Very interesting tutorial !

    I am also thinking a Raspberry solution for my Server DLNA home.

    Maybe silly question : Can I use samba to implement library of files on my network miniDLNA? (I use a box Multimedia WDTV Live)

    If Yes, more nothing me holds to buy a ! 🙂

    Thank you for your reply.

    • Technically Yes. You mounted the disk via Samba and share the directory with minidlna. By contrast side loses, I know not what it gives. The flow of data will go from your box to the raspberry (samba) then the raspberry to your TV (or box) via minidlna. Ca va se bousculer sur le réseau 😉

      • Elpabre

        Thank you for your reply. Yes, that is what I am also afraid…

        Currently, It passes via a laptop and it runs not too bad.

        I will nevertheless try experience. And then, a bit of tinkering, It's always nice… 😉

    • Hello, minidlna accède à ton filesystem donc si tu montes ton disque rien ne t empeche ensuite d y acceder comme un repertoire normal et donc aucun soucis pour minidlna 😉

      • Elpabre

        I come back to a small feedback :

        It goes without any problems !

        I indeed mounted the 2 HDD of the WD I filled in the config file of Minidlna.

        And all past ! Even 1080 p !

        Brief that happiness… 🙂

  • Hello,

    I discovered your blog a few days after having decided to offer me a RasPi, and now that it is in my possession (A LFB), I began a refit a cleaner HomeServer (my current Purring louder than an army of cats and also consumes more than them). The question that torments me once happens here is :

    My current homeServer serves me as a mediaCenter with XBMC. I think ordering a 2nd RasPi (RPi B this time), to install RaspBMC. The new mediaCenter will be he able to read the files of the homeServer ?

    Also, I go through SubSonic to access my music from the exterieux, Subsonic will be you it always necessary or there is make it an alternative via minidlna ?

    Thanks in advance.

    • Hello,
      I have a model B (512MB) for the home server and a model B (256MB) with Raspbmc. The first broadcasts videos via minidlna and the second receives directly in with a UPnP source XBMC.
      For Subsonic, I do not know. Minidlna can be accessed from the outside if your homeServer is also accessible (with the TCP/UDP ports that go with certainly)
      Bon courage dans ton montage 😉

      • All right, Thank you !

        I'll install everything and I come back here to make the results, CA may serve others.

  • Pixoo

    simple Tuto and worked the 1st time, I was gone at the start for a raspberry serviio (Unable to install it and certainly exploitable pas - big doubt on java + rapsberry). Finally I can turn the X Server.

    If it can serve, my config :

    - raspeberry pi 512 MB

    - D - link320 (Map via fstab in samba)

    - box numericable

    - j’ai viré serviio du pc windows 🙂

  • boogieman

    Hello,
    on the other hand, I understand why some avi files are not displayed and some have the truncated name. This is not a problem of length of road or length of name, Neither of . at the beginning, hidden file or, nor right, brief, I dry…

    • I also have a problem in sorting. There must be some hidden options. Should I dig ca a little more.

  • tourn007

    Good evening,

    I tried this tuto, My TV detect well the server but no files appear.

    Here is my config : Model B with installed raspbmc, the file that I want to share its on my external HDD format to NTFS. (I just the windows world).

    Thanks in advance for your answers.

    • Hello,
      If minidlna allows you to see the server on your TV but not file is that the config of sharing is not good. Check or post it here to take a look.
      With the NTFS, the CPU of the Raspberry is going to suffer because the drivers will take lot of resources.

  • tourn007

    Good evening,

    Please help me.

    In fact not only modified the line which are shown in the tutorial :
    - media_dir = / media/sharing (Sharing is the name of my HDD, “root@raspbmc:/media/sharing #”)
    - root_container = B
    - Friendly_name = Raspbmc
    - inotify = yes

    —————————————————————
    I put it in complete :

    # Path to the directory that should hold the log file.
    #log_dir = / var/log

    # Minimum level of importance of messages to be logged.
    # Must be one of “off”, “fatal”, “error”, “warn”, “info” or “debug”.
    # “off” turns of logging entirely, “fatal” is the highest level of importance
    # and “debug” the lowest.
    #log_level=warn

    # Use a different container as the root of the directory tree presented to
    # clients. The possible values are:
    # * “.” - standard container
    # * “B” - “Browse Directory”
    # * “M” - “Music”
    # * “P” - “Pictures”
    # * “V” - “Video”
    # if you specify “B” and client device is audio-only then “Music/Folders” will be used as root
    root_container = B

    # Network interface(s) to bind to (e.g. eth0), comma delimited.
    #network_interface=

    # IPv4 address to listen on (e.g. 192.0.2.1).
    #listening_ip=

    # Port number for HTTP traffic (descriptions, SOAP, media transfer).
    port=8200

    # URL presented to clients.
    # The default is the IP address of the server on port 80.
    #presentation_url=http://example.com:80

    # Name that the DLNA server presents to clients.
    Friendly_name = Raspbmc

    # Serial number the server reports to clients.
    serial=12345678

    # Model name the server reports to clients.
    #model_name=Windows Media Connect compatible (MiniDLNA)

    # Model number the server reports to clients.
    model_number=1

    # Automatic discovery of new files in the media_dir directory.
    inotify = yes

    # List of file names to look for when searching for album art. Names should be
    # delimited with a forward slash (“/”).
    album_art_names=Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg/AlbumArt.jpg/albumart.jpg/Album.jpg/album.jpg/Folder.jpg/folder.jpg/Thumb.jpg/thumb.jpg

    # Strictly adhere to DLNA standards.
    # This allows server-side downscaling of very large JPEG images, which may
    # decrease JPEG serving performance on (at least) Sony DLNA products.
    #strict_dlna=no

    # Support for streaming .jpg and .mp3 files to a TiVo supporting HMO.
    #enable_tivo=no

    # Notify interval, in seconds.
    #notify_interval=895

    # Path to the MiniSSDPd socket, for MiniSSDPd support.
    #minissdpdsocket=/run/minissdpd.sock

    Thank you.

    • At home I only take videos :
      # 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/usbdrive/share/Videos

      Otherwise is that the process has access to the directory ? He has read rights ?

      • tourn007

        My HDD contains only videos.

        I just made : “chmod 777 -R/media/sharing.” and still does not work.

        In fact, XBMC is DLNA Server, but type mkv files, that my TV can read from a usb stick or from serviio, and this TV does recognize more this type of files from XBMC. This is why I was looking for an alternative as minidlna.

        Thanks for responding.

        • Try again with media_dir=V,/media/Partage
          Do not forget to restart the service with service minidlna force-reload

          PS : in the complete file, not, I saw the line media_dir

          • tourn007

            #
            # This option can be specified more than once if you want multiple directories
            # scanned.
            #
            # If you want to restrict a media_dir to a specific content type, you can
            # prepend the directory name with a letter representing the type (A, P or V),
            # followed by a comma, as so:
            # * “A” for audio (eg. media_dir=A,/var/lib/minidlna/music)
            # * “P” for pictures (eg. media_dir=P,/var/lib/minidlna/pictures)
            # * “V” for video (eg. media_dir = V,/var/lib/minidlna/videos)
            #
            # WARNING: After changing this option, you need to rebuild the database. Either
            # run minidlna with the ‘-R’ option, or delete the ‘files.db’ file
            # from the db_dir directory (see below).
            # On Debian, you can run, as root, ‘service minidlna force-reload’ ins$
            #media_dir=/var/lib/minidlna
            media_dir = V,/media/Partage

            mais ne fonctionne toujours pas.

          • Et en arretant le service puis en lancant la commande ‘minidlna -R’ ?

  • tourn007

    Good evening
    ça ne fonctionne toujours pas !
    tant pis

    bon week end

  • tourn007

    Hello,

    Finally it works, This tutorial is very well ! I didn't mount my hdd in the fstab, therefore impossible to have rights.

    Thanks again.
    Good weekend break.

Handpicked links

disk Page Caching using disk: enhanced Database Caching 137/597 queries in 0.349 seconds using disk Served from: pihomeserver.fr @ 2017-09-30 20:16:27 by W3 Total Cache -->