Build Home Router with OpenWrt – Add miniDLNA
Add miniDLNA related packages
Add the following config options to target/linux/brcm2708/configs/rpi3b_defconfig, or add them with make menuconfig:
+CONFIG_PACKAGE_libbz2=y
+CONFIG_PACKAGE_libexif=y
+CONFIG_PACKAGE_libffmpeg-audio-dec=y
+CONFIG_PACKAGE_libflac=y
+CONFIG_PACKAGE_libid3tag=y
+CONFIG_PACKAGE_libjpeg=y
+CONFIG_PACKAGE_libogg=y
+CONFIG_PACKAGE_libsqlite3=y
+CONFIG_PACKAGE_libvorbis=y
+CONFIG_PACKAGE_luci-app-minidlna=y
+CONFIG_PACKAGE_minidlna=y
+CONFIG_PACKAGE_zlib=y
+CONFIG_SQLITE_FTS3=y
+CONFIG_SQLITE_RTREE=y
miniDLNA Configuration
miniDLNA wa enabled by default, and will scan the media files under /mnt/ directory, as usb stroage will be mounted here, so there is no nedd to change the default configuration, if there are multiple disks, go to Services » miniDLNA, add an new entry in Media directories section:
Watch movie with VLC
VLC can be act as a dlna client, all the video and other media(if exists) can be found under LOCAL NETWORK » Universal Plug’n’Play section:
VLC also supports ios, if there is dlna server detected in the same local network, it will be shown like this:
Add support for RealMedia(.rmvb)
The latest version of minidlna does not support rmvb video format, Bob Yang created a feature request at 25/1/2016, but not merged due to license issue.
Apply the following patch to watch rmvb video:
From 01dfa334e86defd31296c53a93bb63af6e1da4cc Mon Sep 17 00:00:00 2001
From: Fudong Bai <fudongbai@gmail.com>
Date: Sat, 26 Jan 2019 10:17:24 +0800
Subject: [PATCH] Add RealMedia Video (.rmvb) support.
Signed-off-by: Fudong Bai <fudongbai@gmail.com>
---
metadata.c | 4 ++++
upnpglobalvars.h | 1 +
utils.c | 1 +
3 files changed, 6 insertions(+)
diff --git a/metadata.c b/metadata.c
index 8a10c77..1af7563 100644
--- a/metadata.c
+++ b/metadata.c
@@ -844,6 +844,10 @@ GetVideoMetadata(const char *path, const char *name)
xasprintf(&m.mime, "video/x-matroska");
else if( strcmp(ctx->iformat->name, "flv") == 0 )
xasprintf(&m.mime, "video/x-flv");
+ else if( strcmp(ctx->iformat->name, "rm") == 0 )
+ xasprintf(&m.mime, "video/x-pn-realvideo");
+ else if( strcmp(ctx->iformat->name, "rmvb") == 0 )
+ xasprintf(&m.mime, "video/x-pn-realvideo");
if( m.mime )
goto video_no_dlna;
diff --git a/upnpglobalvars.h b/upnpglobalvars.h
index fd2b3db..fb27d35 100644
--- a/upnpglobalvars.h
+++ b/upnpglobalvars.h
@@ -162,6 +162,7 @@
"http-get:*:video/x-flv:*," \
"http-get:*:video/x-tivo-mpeg:*," \
"http-get:*:video/quicktime:*," \
+ "http-get:*:video/x-pn-realvideo:*," \
"http-get:*:audio/mp4:*," \
"http-get:*:audio/x-wav:*," \
"http-get:*:audio/x-flac:*," \
diff --git a/utils.c b/utils.c
index fc21b7f..d21db88 100644
--- a/utils.c
+++ b/utils.c
@@ -399,6 +399,7 @@ is_video(const char * file)
ends_with(file, ".m2t") || ends_with(file, ".mkv") ||
ends_with(file, ".vob") || ends_with(file, ".ts") ||
ends_with(file, ".flv") || ends_with(file, ".xvid") ||
+ ends_with(file, ".rm") || ends_with(file, ".rmvb") ||
#ifdef TIVO_SUPPORT
ends_with(file, ".TiVo") ||
#endif
--
2.7.4