Minidlna UPnP Media Server through Debian Wheezy Mipsel

This version is for Mipsel routers: RT-N16, RT-N66U, Rt-AC66u...

Arm version here

1 - Setup Debian Wheezy from here (stock minidlna should be disabled from router ui)

2 - Enter chrooted debian with:

debian enter

3 - Update Debian

apt-get update
apt-get upgrade

4 - Install necessary packages

apt-get install wget libavutil-dev libexif-dev libjpeg8-dev libid3tag0-dev libFLAC-dev libvorbis-dev libsqlite3-dev libffmpegthumbnailer-dev

- Download and install minidlna

wget -c -O /var/tmp/minidlna_1.1.4-1_mipsel.deb
dpkg -i /var/tmp/minidlna_1.1.4-1_mipsel.deb

6 - Download startup script

wget -c -O /etc/init.d/S98minidlna-debian
chmod 755 /etc/init.d/S98minidlna-debian

7 - Download configuration file

wget -c -O /etc/minidlna.conf
chmod 755 /etc/minidlna.conf

8 - To create startup script we need to exit debian


9 - Add minidlna to chrooted services list

echo "" >>/opt/etc/chroot-services.list
echo "S98minidlna-debian" >>/opt/etc/chroot-services.list
chmod 755 /opt/etc/chroot-services.list

10 - For Optware only - create post-mount script (Entware will start automatically S99debian script)

nano /jffs/scripts/post-mount

Paste this lines

sleep 10
/opt/etc/init.d/S99debian start

Save with CTRL-O, press ENTER and exit nano with CTRL-X

Make script executable

chmod a+rx /jffs/scripts/post-mount

11 - Start minidlna from outside debian together with mounted external folder

debian restart

12 - Go to (this is the default router ip, modify to your router ip if you change it previously) and see how minidlna is creating db, press refresh on your browser for progress.

If all numbers are 0 (zero) after some time, you forget to set the right path to your media folder, read again point 4 from here

This is how it looks like on my Samsung TV with thumbnails and filmstrip enabled




If for some reason you don't like default penguin minidlna icon, I compiled a special version of minidlna where you can choose any icon as minidlna logo, thanks @R.L.Horn :)

1 - Enter chrooted debian with:

debian enter

2 - Stop minidlna

/etc/init.d/S98minidlna-debian stop

3 - Remove minidlna

dpkg -r minidlna
rm -r /opt/minidlna

4 - Download and install special version

wget -c -O /var/tmp/minidlna_1.1.4-298577-R.L.Horn_mipsel.deb
dpkg -i /var/tmp/minidlna_1.1.4-298577-R.L.Horn_mipsel.deb

5 - Open minidlna.conf

nano /etc/minidlna.conf

Paste after the last line

# PNG image to use for an icon, optionally followed by a hex background
# color

# Background color (hex rgb triplet) for PNG images converted to jpeg.
# Two colors indicate that a checkerboard background, in those colors,
# should be used.

Save with CTRL-O, press ENTER and exit nano with CTRL-X

Some explanations, for ex. put an icon on EXT_DIR in icons folder and name it myicon.png, or any other place, ex. inside debian etc folder, now icon path should look like this "icon=/etc/myicon.png,7f7f7f"

6 - Exit debian


7 - Restart services

debian restart

Now you have custom logo icon, see two different logos in my pics, one is volvo logo and another from my favorite football team:

  • Pingback: Engineer Aws Alkhazraji()

  • Pingback: best hiking equipment()

  • Dvdukas

    Your tutorials are great. Maybe U can make tutorial for transmission on Debian mipsel?

    • It's better to install optware-ng and transmission without debian

  • MelissaJS

    TeHashX do you have a git for your custom minidlna? I mean, the one with the custom logo and the video thumbnails? If not, why not make one? ;)

  • allexx88


    Could you please share custom icon patch? I've recently updated Optware-ng minidlna to 1.1.4 + thumbnails patch you referenced on github. I would also like to add custom logo icon capability too, but can't find the patch on the net.


    • Of corse, you have to clone this github
      and apply patch from here

      Thanks for adding minidlna + thumbnails, I will make tutorials based on this builds, are more simpler for beginners.
      You added both versions? Mipsel and Arm?

      • allexx88

        Thanks, I updated to latest git + thumbnails patch:

        For all Optware-ng targets: arm, mipsel and i686. btw, it would be nice if you could test it: it works fine with my Samsung Smart TV F series, but without thumbnails, though I clearly see them generated. I use your config with thumbnails enabled

        • Where is the ipk?

          • allexx88

            In the official repos. `ipkg update; ipkg install minidlna` should suffice.

            Or if you want to install manually:

          • I believe is better to make separate packages, with or without thumbnails because some user will complain about db creation will take more time.
            I will test on my E series tv.

          • allexx88

            OK, I'll make two versions:

          • allexx88

            Though, on the other hand, does it really make sense? Thumbnail generation can be disabled in the config file

          • You are right and it's better to leave them disabled by default and if someone need them just enable and run another scan.

          • allexx88

            The original Optware version had no config or rc script shipped, and I leave it that way: there're plenty tutorials on how to configure minidlna. And I hope there will be yours based on Optware-ng :)
            However, I'm still making two versions after all, since it makes sense to make emphasis on the fact that given version supports (or not) thumbnail creation

        • Unfortunately thumbnails are not created, did you enabled them at compile time?

          ./configure --enable-thumbnail

          • allexx88

            Yes, I did: ./configure --build=$(GNU_HOST_NAME) --host=$(GNU_TARGET_NAME) --target=$(GNU_TARGET_NAME) --prefix=/opt --disable-nls --enable-thumbnail --program-prefix=''

            and ldd shows that minildlnad is linked to

          • allexx88

            And they are actually generated: see /opt/minidlna/art_cache
            But for some reason not displayed

          • No, that are created by default.
            Now I look at your code on github and I see is based on L.R. Horn build, please try another build based on original minidlna git v1.1.4

          • allexx88
          • allexx88

            Ah, sorry, wrong arch. I'll compile for mipsel soon. That version you pointed (stable 1.1.4) was what I tried the very first time:

            (with thumbnail patch)
            And it didn't have thumbnails too

          • Yes, the same

          • Also can you check configure log if it's all ok? Maybe need some other packages.

            On debian I need:
            autopoint autoconf checkinstall gettext libavutil-dev libexif-dev libjpeg-dev libpng-devlibid3tag0-dev libFLAC-dev libvorbis-dev libsqlite3-dev libavformat-dev libffmpegthumbnailer-dev libavcodec-dev

          • allexx88

            Actually, the thumbs ARE being generated. Look into art_cache folder and you'll find images like this one:

            They're 160 px width, have film strips (as requested by the config file), and are random screen shots from the movies. But for some reasons those images aren't displayed on the TV

          • Strange, I only get thumbnails for audio albums, not videos and are without filmstrip

          • allexx88

            Hm, have you tried the latest version?

            This version generates thumbnails with filmstrips fine on my i686 NAS

          • The same, only for music, s###t

          • allexx88

            Here's the latest original minidlna git + thumbnail patch for mipsel:

          • I have to go now, this is the patch for latest commit cfab9b-2015.08.05 on minidlna git

            Working fine on chrooted debian wheezy rt-ac66u

          • allexx88

            P.S. The package 'minidlna' currently in repos is the thumbnailess version. Try 'minidlna-thumbnail'. I've uploaded the new binaries just recently, but maybe you've fetched the new 'minidlna' version without thumbnail generation enabled during compile time

    • I repeat, I'm not a developer but just a google-er if you know what I mean, I make this tutorials for beginners and I'm not using anymore minidlna because I have an Odroid C1 running Plex and Serviio whitch are more powerfull than minidlna, believe me. Back to subject, I don't have free time to spend on developing but I will still create some tutorials. If you want to clone minidlna gits, go ahead and I'll be happy to create tutorials based on your work :)

      • allexx88

        We all google, you know, since you can't know it all (sorry for a pun). And your tutorials are interesting not only for beginners (e.g., I used your minidlna config :) )
        I like minidlna for its speed and light weight, though I have a Synology DS with more powerful tools, like Synology VideoStation (used it before and still use it sometimes) or Plex.
        Looking forward for your new tutorials :)

      • MelissaJS

        I apologize for insisting

  • MelissaJS

    Hi TeHashX !

    This is a great compilation, but I was wondering if by any chance can you make an entware minidlna compilation (no debian involved) based on the latest version, but preserving bookmarks for samsung TVs and including the amazing filmstrips?

    I also requested such version from you here:

    Thank you!!

  • vanuch

    please, advise.
    Got error on 4th step
    root@RT-N66U:/# apt-get install wget libavutil-dev libexif-dev libjpeg-dev libid3tag0-dev libFLAC-dev libvorbis-dev libsqlite3-dev libavformat-dev libffmpegthumbnailer-dev
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Note, selecting 'libjpeg8-dev' instead of 'libjpeg-dev'
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:

    The following packages have unmet dependencies:
    libavformat-dev : Depends: libavcodec-dev (= 6:11.4-1~deb8u1) but it is not going to be installed
    Depends: libavformat56 (= 6:11.4-1~deb8u1) but it is not going to be installed
    E: Unable to correct problems, you have held broken packages.

    • I will take o look, thanks for heads up

  • Alexey Tsapko

    The other day I noticed one bug (if I may say so). Every time I reboot the router, DNLA stops working. This is manifested as follows:
    1. I can not run any of the video, not audio file on TV. I can see the files, but when you try to play I see the message "Invalid file format";
    2.Ceases to be updated database files;
    3. All these problems are eliminated stop and then running DNLA. We have to go into the Putty. Which is not very convenient.
    Is it possible to solve this problem? Can make some script?


    • Have you enabled built in minidlna from router ui?
      For the script send me Team Viewer id and temp password by contact form

      • Alexey Tsapko

        No, disabled, should be enabled? Now aftern turn off/on DNLA i can playback video, but database not update...

      • Alexey Tsapko

        So still need to include a built-in DLNA from router ui?

        • No, only one

          • Alexey Tsapko

            Excuse me, I meant to turn on (not include)))

          • I understand, only one must be started

  • Alexey Tsapko

    After all i cant see anything on Web page not available....

    • You didn't set right folder for CHROOT_DIR in S99debian script
      If you have entware, should be /tmp/mnt/INTERNAL/entware/debian

      • Alexey Tsapko

        I try 8 (eight) times from format SD CARD (Asus n66u intertnal sd) to install entware, wheezy and dlna... I try ALL variants!!! Again and again!!! Now i try yours solution. After "/opt/etc/init.d/S99debian start" i have "Chroot'ed services seems to be already started, exiting..." and blank screen on no page///

        • /opt/etc/init.d/S99debian stop
          /opt/etc/init.d/S99debian start

          • Alexey Tsapko

            Eeeeehaaaa!!! PROFIT!!!! Great THX!!!
            Last question how can i change penguin to my router logo and change name of dlna server ? Or where i can read about it?
            How can i donate to you?

          • To change penguin icon, minidlna must be recompiled with icon patch.
            To change server name, edit /opt/debian/etc/minidlna.conf but first stop server and restart after
            /opt/etc/init.d/S99debian stop
            nano /opt/debian/etc/minidlna.conf
            /opt/etc/init.d/S99debian start
            Send me an email, use contact form

          • This one is ok?

  • Darius

    I have problems setting up the minidlna media server on my rt-n66u:

    I'm stuck with step 12: When I go to (my router's ip) to see how minidlna is creating the database, all numbers are zero (0). Therefore, I guess I forget to set the right path to my media folders.

    The hdd connected to my router has a primary ext3 formatted partition named "mediadb" and a logic ntfs partition named "elements". My video files are stored in "elements" in the subfolders "Alissa" and "Fitness". My photos are stored in "elements" in the subfolder "Fotos".

    What is the path to my media files and where do I have to enter the path so that the media server "sees" the files?

    • To keep things simple, put all media files in one directory, name it Media for example and should look like this:

      Edit S99debian and to set external folder as

      • Darius

        Thank you for the quick response!

        I tried, but I couldn't find S99debian. I guess this is because I've set up entware according to these instructions (

        Could you please advise which file (instead of S99debian) I have to edit so that the media server "sees" the files?

        • To make it work follow that guide or follow this one from beginning without installing minidlna from entware.

          • Darius

            Thanks for all the help!

        • Contact me by chat, I'm online now, refresh page in browser if you not see chat button

  • pascal

    i performed all steps and all went ok but just with the final step i get some error

    admin@RT-N66U-2A98:/tmp/mnt/mediaserver/entware# /opt/etc/init.d/S99debian start
    Starting chroot'ed Debian services...
    chroot: can't execute '/etc/init.d/S98minidlna-debian': No such file or directory
    chroot: can't execute '/etc/init.d/S98minidlna-debian': No such file or directory

    • You didn't downloaded startup script from step 6, for this you have to enter chrooted debian with "debian" command

      • pascal

        root@RT-N66U-2A98:/# wget -c -O /etc/init.d/S98minidlna-debian
        --2015-01-03 16:43:56--
        Resolving (,,, ...
        Connecting to (||:80... connected.
        HTTP request sent, awaiting response... 301 Moved Permanently
        Location: [following]
        --2015-01-03 16:43:56--
        Resolving (
        Connecting to (||:80... connected.
        HTTP request sent, awaiting response... 416 Requested Range Not Satisfiable

        The file is already fully retrieved; nothing to do.

        root@RT-N66U-2A98:/# chmod 755 /etc/init.d/S98minidlna-debian

        • I'm online now, contact me by LiveSupport, refresh page and you'll see it in left bottom page

          • pascal

            i have restarted the rooter and all is working fine now, thanks alot for your support.
            One more question, is it possible to add more categories to the media library?

          • What kind of category? Only audio, video and music.

          • pascal

            ok then i need to put all the series i have inside the video folder


To be notified by email when a new tutorial is posted :)

Thanks for Subscribing! I'll keeping you up-to-date with latest tutorials!

Something went wrong, try again...