Back

搭建家用DLNA服务器

|

[DLNA](http://en.wikipedia.org/wiki/Digital_Living_Network_Alliance)协议可以干什么呢?简而言之,就是能够把所有支持DLNA的设备变成输出终端。比如说,可以在iPad上播放用手机拍摄的视频而无需把视频文件拷贝到iPad中;可以在手机上播放存放在电脑上的音乐而无需把音乐文件转存到手机里面。

一个简单的实现就是Win7的『家庭网络』。当把Win7的网络设置成『家庭』之后,就可以用处在同一网络中的其他设备(手机,平板,数字电视)播放Windows媒体库中的多媒体文件了。[BubbleUPnP](https://play.google.com/store/apps/details?id=com.bubblesoft.android.bubbleupnp&hl=en) (iOS上可以用[PlugPlayer](http://itunes.apple.com/AU/app/id293235450?mt=8&ign-mpt=uo%3D4)) 这个软件把Android智能机变成DLNA终端。安装之后,可以在BubbleUPnP的设备中找到Win7的媒体库。点击即可播放。

下面的方法可以用闲置的旧电脑搭建一个DLNA媒体服务器。首先,在电脑上安装一个Ubuntu操作系统,跟着:
[cc]apt-get install minidlna[/cc]
修改/etc/minidlna.conf配置dlna服务器:
[cc]# set this to the directory you want scanned.
# \* if have multiple directories, you can have multiple media\_dir= lines
# \* if you want to restrict a media\_dir to a specific content type, you
# can prepend the type, followed by a comma, to the directory:
# + "A" for audio (eg. media\_dir=A,/home/jmaggard/Music)
# + "V" for video (eg. media\_dir=V,/home/jmaggard/Videos)
# + "P" for images (eg. media\_dir=P,/home/jmaggard/Pictures)
media\_dir=V,/home/ushare/video
media\_dir=A,/home/ushare/audio
media\_dir=A,/home/ushare/pic[/cc]
上面的字段用来配置共享的文件夹,A是音频,V是视频,P是图片。注意更新一下这些文件夹的权限,保证minidlna有读取权限。
[cc]# set this to no to disable inotify monitoring to automatically discover new files
# note: the default is yes
inotify=yes[/cc]
inotify字段设置成yes之后,媒体文件夹中的内容发生改变的时候,minidlna能够及时刷新它的媒体库。
完成配置之后,重启一下服务器: service minidlna restart
这样只需把 电影/音乐/照片 放到这个服务器上面,就可以在所有的支持DLNA的设备中实时播放了。

另外还可以在这个Ubuntu服务器上安装[MLdonkey](http://mldonkey.sourceforge.net/Main_Page)电驴客户端。把下载文件夹加入到minidlna的媒体库中。下载完成就可以:靠在床上用iPad看 / 坐在马桶上用手机看 / 靠在沙发上用电视看。

No comments yet

Leave a comment

About me

I live in Tasmania, an island a little far from the rest of the world and very close to the sea.
Father of two little girls, have two puppies.

Work

Work in IT industry, AI is my working partner.