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 http://goo.gl/vvJZDr
dpkg -i /var/tmp/minidlna_1.1.4-1_mipsel.deb

6 - Download startup script

wget -c -O /etc/init.d/S98minidlna-debian http://goo.gl/SrSq7p
chmod 755 /etc/init.d/S98minidlna-debian

7 - Download configuration file

wget -c -O /etc/minidlna.conf http://goo.gl/sSzjJh
chmod 755 /etc/minidlna.conf

8 - To create startup script we need to exit debian

exit

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

#!/bin/sh
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 192.168.1.1:8200 (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

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

Minidla-bookmarks

Enjoy...

CUSTOM LOGO ICON

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 http://goo.gl/zmmBma
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
icon=/mnt/icons/myicon.png,7f7f7f

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

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

exit

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:
minidlna-custom-icon1
minidlna-custom-icon2

  • 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

    Hi,

    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.

    Thanks

    • Of corse, you have to clone this github http://sourceforge.net/u/eastcheap/minidlna/ci/master/tree/
      and apply patch from here http://sourceforge.net/p/minidlna/patches/132/#bcb5

      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:
        https://github.com/alllexx88/Optware-ng/commit/f834539b714cddb6b6916ebbb6a4fb27c4d509e6

        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:
        http://optware-ng.zyxmon.org/buildroot-armeabi/minidlna_1.1.4+git20150323-1_arm.ipk
        http://optware-ng.zyxmon.org/buildroot-mipsel/minidlna_1.1.4+git20150323-1_mipsel.ipk

      • 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.
        Thanks

      • allexx88

        OK, I'll make two versions:
        minidlna
        minidlna-thumbnail

      • 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?

        ./autogen.sh
        ./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 libffmpegthumbnailer.so.4

      • 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:
        http://optware-ng.zyxmon.org/buildroot-mipsel/minidlna_1.1.4-1_mipsel.ipk

        (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:
        http://i62.tinypic.com/ajpcw6.jpg

        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?
        https://alllexx.no-ip.biz/minidlna-thumbnail_1.1.4+git20150805-1_mipsel.ipk

        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:
        https://alllexx.no-ip.biz/minidlna-thumbnail_1.1.4+git20150805-1_i686.ipk

      • I have to go now, this is the patch for latest commit cfab9b-2015.08.05 on minidlna git http://files.hqt.ro/temp/minidlna-cfab9b-2015.08.05-thumbnail-thx.patch

        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

        Ouch, of course I am a girl! I've been playing around with computers since I was 10 ;) I'm no software expert, but I guess I can understand some tutorials :) Still I'm a total klutz when it comes to compiling and more complex stuff, as you may have read in some other forums.

        Your new tutorial looks great! And sorry for being so curious, but I need to ask you the following:

        Do you know whether Optware-NG can coexist with Entware? I'm guessing it can't...

        And this minidlna version for Optware-NG, does it have the FLAG_SAMSUNG_DCM10 enabled in the clients.c file? If not, it won't work for me :(

        Is there a Transmission package for Optware-NG?

      • Optware and entware can coexist because have the same prefix /opt (why don't they make it /ent?)

        FLAG_SAMSUNG_DCM10 is enabled by default now https://sourceforge.net/p/minidlna/git/ci/c1bb37a38754e0fed6a55a2ebf204c68c3d2135b/

        Yes, transmission is there

        http://optware-ng.zyxmon.org/buildroot-armeabi/Packages.html
        http://optware-ng.zyxmon.org/buildroot-mipsel/Packages.html

      • MelissaJS

        Allright! Seems like an option to me.

        Which one do you think is using less resources/cpu: minidlna through debian, or minidlna through Optware-NG?
        I'd like to have the lightest and less demanding package installed...

      • Go with optware

      • Sorry for asking but are you really a girl or just mocking?

  • 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: https://github.com/Entware/entware/issues/107

    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?

    Thanks!

    • Have you enabled built in minidlna from router ui?
      For the script send me Team Viewer id and temp password by contact form https://www.hqt.ro/contact/

      • 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 192.168.1.1:8200... 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 192.168.1.1:8200... 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 https://www.hqt.ro/contact/

      • 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 192.168.1.98:8200 (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:
      /elements/Media/Videos/Alissa
      /elements/Media/Videos/Fitness
      /elements/Media/Videos/all_video_files_or_folders_with_video_files
      /elements/Media/Fotos/all_photos_or_folders_with_photos
      /elements/Media/Music/all_music_files_or_folders_with_music_files

      Edit S99debian and to set external folder as
      EXT_DIR=/tmp/mnt/elements/Media

      • 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 (http://pastebin.com/q6JWvXW0).

        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
    Done.
    admin@RT-N66U-2A98:/tmp/mnt/mediaserver/entware#

    • 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 http://goo.gl/4rVWwn
        --2015-01-03 16:43:56-- http://goo.gl/4rVWwn
        Resolving goo.gl (goo.gl)... 64.15.124.116, 64.15.124.122, 64.15.124.123, ...
        Connecting to goo.gl (goo.gl)|64.15.124.116|:80... connected.
        HTTP request sent, awaiting response... 301 Moved Permanently
        Location: https://hqt.ro/files/debian/mipsel/minidlna/S98minidlna-debian [following]
        --2015-01-03 16:43:56-- https://hqt.ro/files/debian/mipsel/minidlna/S98minidlna-debian
        Resolving hqt.ro (hqt.ro)... 91.216.151.23
        Connecting to hqt.ro (hqt.ro)|91.216.151.23|: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
        root@RT-N66U-2A98:/#

      • 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

SoftEther VPN Running on AsusWRT Routers
Minidlna UPnP Media Server through Debian Jessie Arm
How to Mount Samba Shares inside Chrooted Debian
Nginx Web Server with PHP Support through Optware-NG
Minidlna UPnP Media Server through Debian Jessie Arm
How to Mount Samba Shares inside Chrooted Debian
Spreed WebRTC server and web client
Asterisk VoIP Server running on AsusWRT Routers
SoftEther VPN Running on AsusWRT Routers
NZBGet through Entware
Minidlna UPnP Media Server through Debian Jessie Arm
NetData System Monitor Entware

SUBSCRIBE

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...