本帖最后由 vanabel 于 2015-5-2 11:16 编辑
原教程发布于:
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 -y2
复制代码
2. 添加源:
- echo "deb-src <a target="_blank" href="http://archive.raspbian.org/raspbian">http://archive.raspbian.org/raspbian</a> rel="nofollow" wheezy main contrib non-free" | sudo tee -a /etc/apt/sources.list
复制代码
并更新源:
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 <a target="_blank" href="http://sourceforge.net/projects/minidlna/files/minidlna/1.1.4/minidlna-1.1.4.tar.gz">http://sourceforge.net/projects/ rel="nofollow" ... nidlna-1.1.4.tar.gz</a>
复制代码
并解压:
- tar -xvf minidlna-1.1.4.tar.gz
复制代码
然后切换到目录:
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
复制代码安装
- sudo apt-get install autoconf automake autopoint
复制代码
并执行
然后配置编译环境:
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
复制代码
参考文献