|
楼主 |
发表于 2009-9-17 10:46
|
显示全部楼层
http://www.godiy.net/thread-3678-1-1.html
盒子安装媒体服务器DLNA/Upnp (Mediatomb Ushare Twonkymedia)完全篇
一,什么是媒体服务器
1,DLNA/UPNP介绍
DLNA/UPnP是在家中构建一个由PC、家用电器和一些mobile的设备组成有线无线的操作网络,为整个数字家庭系统提供了一个seamless的环境。 UPnP他是DLNA网络协议及的核心,也是设备连入数字家庭网络的最普适的方式,并且是数字家庭网络的公共协议。
一种协议支持各种软硬件播放功能,将家电、通讯设备(包括手机、电话)与网络统一整合,家电可以播放计算机上面的各种档案,计算机也可以播放家电上的各种档案。
有线及无线网络的环境成熟家中任何产品都已经可以藉由网络来传播讯息,不需要再添购各种各式各样不同标准的配备来播放影音档案
2,什么设备可以使用?
目前可以使用媒体服务器的设备包括计算机(安装相应软件),PS3,Xbox360,及其他带网络接口可使用DLNA协议的媒体播放器硬件。计算机可以直接使用共享,安装媒体服务器没有意义,所以,如果你没有其他硬件,可以忽略本文。
3,linux软件支持
Linux上能够实现Upnp的软件基本有三个Mediatomb UshareTwonkymedia,
Twonkymedia安装简单但需要注册码Mediatomb支持格式不多 Ushare支持格式最全并且免费。
以上三个软件我都有安装,访问设备是PS3,从使用效果看,以上三个软件图片及MP3共享都没有问题,主要区别集中在电影共享上,针对高清TS格式电影Twonkymedia支持最好,PS3,可发现并播放,但没有字幕,Mediatomb只有AVI,但PS3不能播放,及Ushare则有部分高清,没有AVI。
总的来说各软件都或多或少有点问题,能否共享和上述软件支持格式有关,能否播放和播放设备有关
二,软件安装与配置
1,Ushare
我安装时采用源码编译安装,经网友提示,可直接安装
a)
Putty进盒子
附件解压缩到Public
Putty进盒子
ipkg update
ipkg install ushare
b)
配置ushare.conf
cd /etcvi ushare.conf配置文件需更改部分见下,其他参数见后面自行决定是否更改。或者直接复制附件到/etc目录
# uShare UPnP Friendly Name (default is 'uShare').不可用中文名
USHARE_NAME=MediaCenter
# Port to listen to (default is random from IANA Dynamic Ports range)
# Ex : USHARE_PORT=49200 ushare访问端口
USHARE_PORT=49200
# Directories to be shared (space or CSV list).共享目录,不可用中文名,中间用英文逗号隔开
# Ex: USHARE_DIR=/dir1,/dir2
USHARE_DIR=/shares/internal/PUBLIC/MediaCenter/Photo,/share/internal/PUBLIC/MediaCenter/Movie,/shares/internal/PUBLIC/MediaCenter/HD,/shares/internal/PUBLIC/mp3,/shares/internal/PUBLIC/MediaCenter
# Enable Web interface (yes/no)是否可web管理
ENABLE_WEB=yes
# Use XboX 360 compatibility mode (yes/no)是否支持Xbox360
ENABLE_XBOX=yes
# Use DLNA profile (yes/no)是否支持PS3及其他DLNA设备
# This is needed for PlayStation3 to work (among other devices)
ENABLE_DLNA=yes
c)
加入SW,配置启动
cd/shares/internal/PUBLIC
cp S98ushare /etc
(已改好的启动文件,可直接复制使用)cp enable_ushare.php /usr/www/lib/sw
cp disable_ushare.php /usr/www/lib/swcd /etcvi sudoers 增加以下:root
ALL=(ALL) ALLwww-data ALL=(ALL) ALL…………………..在www-data ALL =(root)NOPASSWORD:下增加 /etc/init.d/s98ushare,\保存退出
更改 index.php
在适当位置插入以下代码,可在我的附件中复制粘贴。
<tr>
<?php
if(file_exists("/etc/init.d/S98ushare")){
?>
<td>Ushare已开启</td><td><inputtype="button" value="关闭" /></td>
<?php
}else{
?>
<td>Ushare已关闭</td><td><inputtype="button" value="开启" /></td>
<?php
}
?>
</tr>
做好以上工作即可在SW里进行管理,并可开机启动
d)
结束安装,启动程序
访问http://xxx.xxx.xxx.xxx/sw 单击启动Ushare,
访问http://xxx.xxx.xxx.xxx:49200/web/ushare.html看服务是否启动了?
若没有启动可能是目录设置问题更改ushare.conf设置共享目录
e)
主要参数设置
uShare (version 1.1a), a lightweight UPnP A/V and DLNA Media Server.Benjamin Zores (C) 2005-2007, for GeeXboX Team.See http://ushare.geexbox.org/ for updates. Usage: ushare [-n name] [-i interface] [-p port] [-c directory] [[-c directory]...]Options: -n, --name=NAME
Set UPnP Friendly Name (default is 'uShare') -i, --interface=IFACE
Use IFACE Network Interface (default is 'eth0') -f, --cfg=FILE
Config file to be used -p, --port=PORT
Forces the HTTP server to run on PORT -q, --telnet-port=PORT Forces the TELNET server to run on PORT -c, --content=DIR
Share the content of DIR directory -w, --no-web
Disable the control web page (enabled by default) -t, --no-telnet
Disable the TELNET control (enabled by default) -o, --override-iconv-err
If iconv fails parsing name, still add to media contents (hoping the renderer can handle it) -v, --verbose
Set verbose display -x, --xbox
Use XboX 360 compliant profile -d, --dlna
Use DLNA compliant profile (PlayStation3 needs this) -D, --daemon
Run as a daemon -V, --version
Display the version of uShare and exit -h, --help
Display this help
其他参考文献
http://packages.debian.org/search?lang=zh-cn&keywords=libupnp
http://users.telenet.be/bruno.keymolen/libmcupnp.html
http://pupnp.sourceforge.net/
http://www.nslu2-linux.org/wiki/Applications/UShare
http://buffalo.nas-central.org/i ... ia_Server_for_Linux
2,Mediatomb
a),英文原文参考,E文好的可以看,我按照次方法安装,E文有问题继续往后看
MediaTomb packages for NSLU2 and other Optware targets areavailable here
If you are running Optware you can easily install MediaTomb using the followingcommand:
ipkg install mediatomb
The current package provides an init script with some additional configuration.To enable automatic startup of the MediaTomb daemon edit/opt/etc/default/mediatomb and change the value of MT_ENABLE to true after thatstart the daemon by issuing the following command:
/opt/etc/init.d/S90mediatomb start
In this configuration MediaTomb will listen on port 50500, this behavior can bechanged by editing /opt/etc/mediatomb.conf and restarting the server which canby done by:
/opt/etc/init.d/S90mediatomb restart
The config.xml and the database of the daemon configuration will be created in/opt/etc/mediatomb after the first launch.
If you encounter strange behavior or are not sure what is going on, have a lookat the log output which will be located in /opt/var/log/mediatomb
There has been one more change in regard to the Optware package: the defaultsettings make use of the database backup function, have a look at the storagesettings in the documentation if you want to find out more about this.
b)翻译及结合实际安装
Putty进盒子,su。
Ipkg install mediatomb
/opt/etc/init.d/S90mediatomb start
vi/opt/etc/default/mediatomb
将MT_ENABLE参数改为 true
如需更改端口执行下面命令
vi /opt/etc/mediatomb.conf
保存后
/opt/etc/init.d/S90mediatomb restart
若出现缺少文件提示
将 /opt/lib 目录下的下述文件拷贝到 /lib 就可以了!
libavcodec.so.*
libavformat.so.*
libavutil.so.*
libdlna.so.*
libixml.so.*
libthreadutil.so.*
共18个文件!
到此安装结束。
c)加入SW,可参考 二.1.c,方法类似不再累述。
3,Twonkymedi
以下安装方式转自godwin1981的文章TwonkymediaUPNP A/V server安装步骤(DLNA) http://bbs.qzxx.com/thread-3638-1-1.html
鉴于论坛上有部分tx想在盒子上装DLNA软件,让盒子支持高清播放器,我特地安装了ushare和Twonkymedia两个服务器做了比较,发现 ushare虽然支持RMVB,但是我试了两个DMP都没有成功播放,(能看到文件,但是无法播放),Twonkymedia虽然现在还不支持RMVB, 但是已经相当不错,我将安装方式share给大家:
首先,当然是大家都知道的步骤,下载软件:
http://www.twonkyforum.com/unsup ... 4.4.11-20090108.zip
然后,解压缩copy到盒子的/usr/local/TwonkyVision 目录下(TwonkyVision需要自己建,且不要更改该名字,注意大小写)
第三步,修改/usr/local/TwonkyVision/Twonkymedia.sh 第80行
原本
if ( ["${DAEMON}"=="${running}" ] ); then
改为
if ( [ $running ]&& [ "${running}"=="${DAEMON}" ] ); then
并将所有TwonkyVision下的文件权限改为755
第四步:putty 然后输入 ln -s /usr/local/TwonkyVision/twonkymedia.sh/opt/etc/init.d/S90twonky
最后只要在putty里输入/opt/etc/init.d/S90twonky start就可以启动服务 stop就是停止。现在你的盒子就和QNAS的功能一样了,快去享受高清电影吧。
BTW:
通过一定设置,也可以将开关加入到sw中或者添加到启动组。
我很想装myihome lite版,但一直没找到下载地址,有谁知道的请提供一下,谢谢
三,电脑开启UPNP及共享文件配置
这么多媒体服务器是否可以共存,答案是肯定的,
那怎么管理,好多端口有记住。不需要,windows xp 网络邻居 开启 显示Upnp设备即可。
图片见http://bbs.qzxx.com/attachments/month_0902/20090203_c95d132c78863bf5b1d0QDDRG5HCVlAK.jpg
可同时发现所有服务器,甚至你的路由器,双击即可管理。共享文件管理各有不同,比较简单,各位自己研究吧。 |
|