dlna流媒体服务搭建

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

161436_Mcol_3452433.png

简介

    DLNA的全称是DIGITAL LIVING NETWORK ALLIANCE(数字生活网络联盟), 其宗旨是Enjoy your music, photos and videos, anywhere anytime, DLNA(Digital Living Network Alliance) 由索尼、英特尔、微软等发起成立、旨在解决个人电脑,消费电器,移动设备在内的无线网络和有线网络的互联互通,使得数字媒体和内容服务的无限制的共享和增长成为可能,目前成员公司已达280多家。

 

安装minidlna

root@raspberrypi:~# apt-get install minidlna

 

配置文件

minidlna配置文件位置为 /etc/minidlna.conf 

主要配置几种目录位置media_dir多媒体目录、db_dir数据库目录、log_dir日志目录

# Path to the directory you want scanned for media files.
#
# This option can be specified more than once if you want multiple directories
# scanned.
#
# If you want to restrict a media_dir to a specific content type, you can
# prepend the directory name with a letter representing the type (A, P or V),
# followed by a comma, as so:
#   * "A" for audio    (eg. media_dir=A,/var/lib/minidlna/music)
#   * "P" for pictures (eg. media_dir=P,/var/lib/minidlna/pictures)
#   * "V" for video    (eg. media_dir=V,/var/lib/minidlna/videos)
#   * "PV" for pictures and video (eg. media_dir=PV,/var/lib/minidlna/digital_camera)
media_dir=/var/lib/minidlna

# Set this to merge all media_dir base contents into the root container
# (The default is no.)
#merge_media_dirs=no

# Path to the directory that should hold the database and album art cache.
db_dir=/var/cache/minidlna

# Path to the directory that should hold the log file.
log_dir=/var/log

 

操作

Samba操作脚本在/etc/init.d目录下,我们要切换到此目录下执行。

查看状态

root@raspberrypi:/etc/init.d# ./minidlna status
● minidlna.service - LSB: minidlna server
   Loaded: loaded (/etc/init.d/minidlna; generated; vendor preset: enabled)
   Active: active (running) since Wed 2018-05-30 14:18:07 UTC; 17h ago
     Docs: man:systemd-sysv-generator(8)
  Process: 18869 ExecStop=/etc/init.d/minidlna stop (code=exited, status=0/SUCCESS)
  Process: 18879 ExecStart=/etc/init.d/minidlna start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/minidlna.service
           └─18890 /usr/sbin/minidlnad -f /etc/minidlna.conf -P /run/minidlna/minidlna.pid

May 30 14:18:07 raspberrypi systemd[1]: Starting LSB: minidlna server...
May 30 14:18:07 raspberrypi systemd[1]: Started LSB: minidlna server.

启动服务

root@raspberrypi:/etc/init.d# ./minidlna start
[ ok ] Starting minidlna (via systemctl): minidlna.service.

停止服务

root@raspberrypi:/etc/init.d# ./minidlna stop
[ ok ] Stopping minidlna (via systemctl): minidlna.service.

重启服务

root@raspberrypi:/etc/init.d# ./minidlna restart
[ ok ] Restarting minidlna (via systemctl): minidlna.service.

 

windows系统访问

在windows系统的网络邻居中我们就可以找到流媒体服务了

dlna流媒体服务搭建_第1张图片

右键打开媒体播放机,就可以进行流媒体的浏览或播放了

dlna流媒体服务搭建_第2张图片

android系统访问

安卓系统的智能电视一般都内置了dlna功能。

安卓手机可以使用sPlayer进行播放

转载于:https://my.oschina.net/u/3452433/blog/1832824

你可能感兴趣的:(dlna流媒体服务搭建)