分类
服务器日志

Raspiberry Pi安装minidlna1.1.4并支持rmvb

首选参考1编译安装1.1.4.
1. 卸载掉1.0.24

sudo apt-get purge minidlna -y
sudo apt-get remove minidlna
sudo apt-get autoremove -y

2. 添加源:echo "deb-src http://archive.raspbian.org/raspbian wheezy main contrib non-free" | sudo tee -a /etc/apt/sources.list, 并更新源:sudo apt-get update
3. 安装编译环境依赖包:sudo apt-get build-dep minidlna -y, 你也可以手动安装:
sudo apt-get install libjpeg-dev libsqlite3-dev libexif-dev libid3tag0-dev libvorbis-dev libflac-dev -y
4. 下载minidlna1.1.4源码:wget http://sourceforge.net/projects/minidlna/files/minidlna/1.1.4/minidlna-1.1.4.tar.gz并解压:tar -xvf minidlna-1.1.4.tar.gz, 然后切换到目录:cd minidlna-1.1.4

5. 编辑源码使得支持rmvb, 主要修改的地方有23

diff -ur minidlna-1.1.4/metadata.c minidlna-1.1.4-usr/metadata.c
--- minidlna-1.1.4/metadata.c   2014-08-27 05:09:22.000000000 +0800
+++ minidlna-1.1.4-usr/metadata.c       2015-05-02 08:11:35.278306437 +0800
@@ -841,6 +841,12 @@
                        xasprintf(&m.mime, "video/x-matroska");
                else if( strcmp(ctx->iformat->name, "flv") == 0 )
                        xasprintf(&m.mime, "video/x-flv");
+               //add by user to support rmvb
+               //from http://blog.csdn.net/Haven200/article/details/43039261
+               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 -ur minidlna-1.1.4/upnpglobalvars.h minidlna-1.1.4-usr/upnpglobalvars.h
--- minidlna-1.1.4/upnpglobalvars.h     2014-08-27 05:09:22.000000000 +0800
+++ minidlna-1.1.4-usr/upnpglobalvars.h 2015-05-02 08:15:07.937072539 +0800
@@ -169,7 +169,8 @@
        "http-get:*:audio/mp4:*," 
        "http-get:*:audio/x-wav:*," 
        "http-get:*:audio/x-flac:*," 
-       "http-get:*:application/ogg:*"
+       "http-get:*:application/ogg:*,"
+  "http-get:*:video/x-pn-realvideo:*"

 #define DLNA_FLAG_DLNA_V1_5      0x00100000
 #define DLNA_FLAG_HTTP_STALLING  0x00200000
 diff -ur minidlna-1.1.4/utils.c minidlna-1.1.4-usr/utils.c
--- minidlna-1.1.4/utils.c      2014-08-27 05:09:22.000000000 +0800
+++ minidlna-1.1.4-usr/utils.c  2015-05-02 08:03:17.031201433 +0800
@@ -381,6 +381,7 @@
                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

6. 安装sudo apt-get install autoconf automake autopoint并执行./autogen.sh, 然后配置编译环境:./configure –disable-nls

7. 编译并安装:make && sudo make install

8. 复制minidlna配置文件:sudo cp minidlna.conf /etc/并编辑sudo vim /etc/minidlna.conf 修改

 media_dir=/home/pi/downloads/Torrent_complete
# Names the DLNA server
friendly_name=RasPi Media Server
# Tells the DLNA to update the library when there are changes
inotify=yes

这里我们把所有媒体都放到了media_dir, 请对应修改. inotify表示是否刷新新文件

9. 开启服务:sudo service minidlna start

10. 开机自启动:

sudo cp linux/minidlna.init.d.script /etc/init.d/minidlna
sudo chmod 755 /etc/init.d/minidlna
sudo update-rc.d minidlna defaults

参考文献

“Raspiberry Pi安装minidlna1.1.4并支持rmvb”上的2条回复

发表回复

您的电子邮箱地址不会被公开。

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据