What's new

Need help setting up DLNA server

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

r00tb33r

Occasional Visitor
My goal:
SMB (CIFS) share -> ASUS router DLNA server -> Roku device (Ultra)

Normally ASUS/Merlin is set up to serve DLNA from USB. I already have an SMB share on another device on the network, so I need the DLNA server on the router to serve those files from there.

I understand I'll probably have to set this up through the shell. Can anyone provide me the steps or point me in the right direction?

Help is appreciated.

My router is RT-AC66U running 374.43_2-15E5j9527 (has DLNA server, enabled)
 
I already have an SMB share on another device on the network, so I need the DLNA server on the router to serve those files from there.
What is the device or computer that is storing the media files? If a computer why not simply install a DLNA media server on that computer? If a NAS, most NAS boxes come with a DLNA media server or have the ability to have one installed.
 
What is the device or computer that is storing the media files? If a computer why not simply install a DLNA media server on that computer? If a NAS, most NAS boxes come with a DLNA media server or have the ability to have one installed.
Dune HD set top box with a 5TB HDD in it, it has the SMB (CIFS) share on it. It's great for H.264 content but it has no H.265 playback and beyond. It's old. No, it will not support DLNA natively.
 
You will likely (I assume) have to find a way to mount the local network Dune HD box's drive or Share to the router. Then hope (or find a way) to get the MiniDLNA service on the Asus router to see that mounted share and access it. There are some old discussions along the lines of mounting remote Shares on an Asus router:
A subforum search for "mount Share":
https://www.snbforums.com/search/11...t&c[child_nodes]=1&c[nodes][0]=37&o=relevance
And a subforum search for "miniDLNA":
https://www.snbforums.com/search/11...t&c[child_nodes]=1&c[nodes][0]=37&o=relevance

It might be easier to either repurpose an existing computer or network device like an NAS or SoC device like Raspberry Pi to host the DLNA media server (or a full fledged media server like Plex, or by using Kodi or similar). It may be easier to mount a Share to those devices than the Asus router firmware and it's MiniDLNA media server module. Depending on the Asus router firmware and how one can mount a Share, it is possible that mount point may not survive a reboot or power cycle.
 
As others have said, the difficult part is going to find a way to create a mount point on the router. If you're able to successfully do that, you may or may not be able to add that remote file system to the index list. If not, you'll need to have a folder structure on the router's storage device that miniDLNA can access. What I've done where I have a mount point that's not on miniDLNA's defined list of folders that I want miniDLNA to index as one hierarchy is to add wide_links=yes to my minidlna.conf file, then create a symbolic file reference for the media file into the directory where I want miniDLNA to index it. That's worked great and Roku then sees and reads from the multiple storage devices as one folder structure. The structure doesn't always survive a reboot, so I have a script that triggers off of every media server restart that validates the existence of the symbolic link and confirms that the media file exists in the sql database. It either adds it or re-creates the symbolic link as required. Roku's media player does a good job of displaying metadata, but miniDLNA doesn't do the greatest job of picking data consistently (titles, dates, plot info) out of various media file types. Adding an .nfo file for each media file seems to solve that problem fairly well.
 
Last edited:
FYI, I was able to mount and remove a remote Samba share on my RT-AX86U with the following commands:

mkdir /tmp/mnt/(your mount point)
mount -t cifs //192.168.50.xxx/(folder) /tmp/mnt/(your mount point) -o username=(your username),password=(your password)

umount -l /tmp/mnt/(your mount point)
rmdir /tmp/mnt/(your mount point)

I was able to cd to it and view the files on it. I did not try to get miniDLNA to index it or serve it yet. Note that the username and password are the Samba credentials of the remote share.

UPDATE: I was able to stream a media file on a remote mount to Roku successfully. Mounting the remote share does not create an option in the GUI to add that file system to miniDLNA's scanned directories, but when I linked the media file into an existing scanned directory with a symbolic link, it was immediately added to the SQL database and Roku was able to see it and read it.
 
Last edited:
As others have said, the difficult part is going to find a way to create a mount point on the router. If you're able to successfully do that, you may or may not be able to add that remote file system to the index list. If not, you'll need to have a folder structure on the router's storage device that miniDLNA can access. What I've done where I have a mount point that's not on miniDLNA's defined list of folders that I want miniDLNA to index as one hierarchy is to add wide_links=yes to my minidlna.conf file, then create a symbolic file reference for the media file into the directory where I want miniDLNA to index it. That's worked great and Roku then sees and reads from the multiple storage devices as one folder structure. The structure doesn't always survive a reboot, so I have a script that triggers off of every media server restart that validates the existence of the symbolic link and confirms that the media file exists in the sql database. It either adds it or re-creates the symbolic link as required. Roku's media player does a good job of displaying metadata, but miniDLNA doesn't do the greatest job of picking data consistently (titles, dates, plot info) out of various media file types. Adding an .nfo file for each media file seems to solve that problem fairly well.
That's the idea. Will miniDLNA periodically rescan the directory for new content?

What's the format of the .nfo file that miniDLNA accepts?


FYI, I was able to mount and remove a remote Samba share on my RT-AX86U with the following commands:

mkdir /tmp/mnt/(your mount point)
mount -t cifs //192.168.50.xxx/folder /tmp/mnt/(your mount point) -o username=(your username),password=(your password)

umount -l /tmp/mnt/(your mount point)
rmdir /tmp/mnt/(your mount point)

I was able to cd to it and view the files on it. I did not try to get miniDLNA to index it or serve it yet. Note that the username and password are the Samba credentials of the remote share.

UPDATE: I was able to stream a media file on a remote mount to Roku successfully. Mounting the remote share does not create an option in the GUI to add that file system to miniDLNA's scanned directories, but when I linked the media file into an existing scanned directory with a symbolic link, it was immediately added to the SQL database and Roku was able to see it and read it.

Awesome! You pretty much did all the heavy lifting there while I was away on vacation for a week.

You said an existing scanned directory... What if I have no other directory, can I create the dummy on the router filesystem? I guess if all fails I can just keep a USB flash drive plugged into it for it to scan, but I'd rather make it cleaner with nothing but a shell script.

If I want to automate this, what's a good place to put my custom shell script in Merlin?
 
That's the idea. Will miniDLNA periodically rescan the directory for new content?

What's the format of the .nfo file that miniDLNA accepts?
There is an active watch process when miniDLNA is running that processes changes to files/directories as they occur. Every time a file/directory is added/modified/deleted, the change is reflected to the SQL database.

The .nfo format is like this:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<movie>
<title>title text</title>
<episodetitle>title text</episodetitle>
<plot>plot text</plot>
<genre>genre text</genre>
<capturedate>year</capturedate>
<season>season number</season>
<episode>episode number</episode>
</movie>

The .nfo file must have the same filename as the video file, so basically you can have 4 files of each filename.... a video file, a .nfo file, a .jpg file for the thumbnail and an .srt file for subtitles. Roku will use them all.
 
That's the idea. Will miniDLNA periodically rescan the directory for new content?

What's the format of the .nfo file that miniDLNA accepts?




Awesome! You pretty much did all the heavy lifting there while I was away on vacation for a week.

You said an existing scanned directory... What if I have no other directory, can I create the dummy on the router filesystem? I guess if all fails I can just keep a USB flash drive plugged into it for it to scan, but I'd rather make it cleaner with nothing but a shell script.

If I want to automate this, what's a good place to put my custom shell script in Merlin?
You're going to have to have a directory structure that you can set up in the GUI, and that can only be a USB. You may be able to go around the GUI and define something independently, but that's territory I haven't explored.

I trigger my setup script in service-event-end and I look for $1 to be "start" or "restart" and $2 to be "media" or "nasapps" or "dms". Recognize that those same commands will initiate miniDLNA's own rescan, so if you want to come in with custom activities after that, allow enough time for that to finish. For me, the above service event triggers a media setup scheduler. The media scheduler is a once/minute cron job that first waits until the system date is set from the ISP. When it is, it schedules 4 cron jobs, the first of which runs after 10 minutes, then unschedules itself. The first job just cleans up some dates in the SQL database. The second removes any SQL databases that got created on devices other than the one defined in my minidlna.conf file. The third checks my symbolic links and makes sure they're in the SQL database. The fourth checks my playlists to be sure they're complete and recreates them if they're not. Each cron job unschedules itself after it completes.

It took me a number of iterations to get this process to work, but it now recovers perfectly from power outages, reboots, device mounts, etc.
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top