打开DLNA配置并编译
- 通过命令make buildroot_rootfs-menuconfig打开DLNA,conf/buildroot_rootfs_config中会添加BR2_PACKAGE_MINIDLNA=y
- 通过命令make buildroot_rootfs -j4进行编译
- 通过命令make img生成卡固件
- 卡启动
编译完成后生成如下内容:
fuqiang@snode1:~/workspace/jh7110/jh7110$ find . -name minidlna*
./work/buildroot_rootfs/build/minidlna-1.3.0 //中间文件
./work/buildroot_rootfs/build/minidlna-1.3.0/minidlna.conf
./work/buildroot_rootfs/build/minidlna-1.3.0/minidlnad
./work/buildroot_rootfs/build/minidlna-1.3.0/minidlnatypes.h
./work/buildroot_rootfs/build/minidlna-1.3.0/po/minidlna.pot
./work/buildroot_rootfs/build/minidlna-1.3.0/minidlna.conf.5
./work/buildroot_rootfs/build/minidlna-1.3.0/minidlnad.8
./work/buildroot_rootfs/build/minidlna-1.3.0/minidlna.c
./work/buildroot_rootfs/build/minidlna-1.3.0/minidlnapath.h
./work/buildroot_rootfs/build/minidlna-1.3.0/minidlna.o
./work/buildroot_rootfs/build/minidlna-1.3.0/linux/minidlna.init.d.script.tmpl
./work/buildroot_rootfs/build/minidlna-1.3.0/linux/minidlna.init.d.script
./work/buildroot_rootfs/build/buildroot-config/br2/package/minidlna.h
./work/buildroot_rootfs/target/etc/minidlna.conf //安装文件
./work/buildroot_rootfs/target/usr/sbin/minidlnad
./buildroot/package/minidlna //原始文件
./buildroot/package/minidlna/minidlna.mk
./buildroot/package/minidlna/minidlna.hash
./buildroot/package/minidlna/minidlnad.service
./buildroot/dl/minidlna //下载的包文件
./buildroot/dl/minidlna/minidlna-1.3.0.tar.gz
修改配置
原始配置如下:
# port for HTTP (descriptions, SOAP, media transfer) traffic
port=8200
# network interfaces to serve, comma delimited (8 interfaces max)
#network_interface=eth0
# specify the user account name or uid to run as
#user=jmaggard
# set this to the directory you want scanned.
# * if you want multiple directories, you can have multiple media_dir= lines
# * if you want to restrict a media_dir to specific content types, you
# can prepend the types, 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)
# + "PV" for pictures and video (eg. media_dir=PV,/home/jmaggard/digital_camera)
media_dir=/opt
# set this to merge all media_dir base contents into the root container
# note: the default is no
#merge_media_dirs=no
# set this if you want to customize the name that shows up on your clients
#friendly_name=My DLNA Server
# set this if you would like to specify the directory where you want MiniDLNA to store its database and album art cache
#db_dir=/var/cache/minidlna
# set this if you would like to specify the directory where you want MiniDLNA to store its log file
#log_dir=/var/log
# set this to change the verbosity of the information that is logged
# each section can use a different level: off, fatal, error, warn, info, or debug
#log_level=general,artwork,database,inotify,scanner,metadata,http,ssdp,tivo=warn
# this should be a list of file names to check for when searching for album art
# note: names should be delimited with a forward slash ("/")
album_art_names=Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg/AlbumArt.jpg/albumart.jpg/Album.jpg/album.jpg/Folder.jpg/folder.jpg/Thumb.jpg/thumb.jpg
# set this to no to disable inotify monitoring to automatically discover new files
# note: the default is yes
inotify=yes
# set this to yes to enable support for streaming .jpg and .mp3 files to a TiVo supporting HMO
enable_tivo=no
# set this to beacon to use legacy broadcast discovery method
# defauts to bonjour if avahi is available
tivo_discovery=bonjour
# set this to strictly adhere to DLNA standards.
# * This will allow server-side downscaling of very large JPEG images,
# which may hurt JPEG serving performance on (at least) Sony DLNA products.
strict_dlna=no
# default presentation url is http address on port 80
#presentation_url=http://www.mylan/index.php
# notify interval in seconds. default is 895 seconds.
notify_interval=900
# serial and model number the daemon will report to clients
# in its XML description
serial=12345678
model_number=1
# specify the path to the MiniSSDPd socket
#minissdpdsocket=/var/run/minissdpd.sock
# use different container as root of the tree
# possible values:
# + "." - use standard container (this is the default)
# + "B" - "Browse Directory"
# + "M" - "Music"
# + "V" - "Video"
# + "P" - "Pictures"
# + Or, you can specify the ObjectID of your desired root container (eg. 1$F for Music/Playlists)
# if you specify "B" and client device is audio-only then "Music/Folders" will be used as root
#root_container=.
# always force SortCriteria to this value, regardless of the SortCriteria passed by the client
# note: you can prepend the sort criteria with "!" to alter the titles of the objects so that they
# will be alphanumerically sorted in the order you specify here, to work around clients that do their
# own alphanumeric sorting.
#force_sort_criteria=+upnp:class,+upnp:originalTrackNumber,+dc:title
# maximum number of simultaneous connections
# note: many clients open several simultaneous connections while streaming
#max_connections=50
# set this to yes to allow symlinks that point outside user-defined media_dirs.
#wide_links=no
# enable subtitle support by default on unknown clients.
# note: the default is yes
#enable_subtitles=yes
修改点:
# port for HTTP (descriptions, SOAP, media transfer) traffic
port=8200
# network interfaces to serve, comma delimited (8 interfaces max)
#赛昉双以太网网口,eth1
network_interface=eth1
# specify the user account name or uid to run as
#user=jmaggard
# set this to the directory you want scanned.
# * if you want multiple directories, you can have multiple media_dir= lines
# * if you want to restrict a media_dir to specific content types, you
# can prepend the types, 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)
# + "PV" for pictures and video (eg. media_dir=PV,/home/jmaggard/digital_camera)
#挂载的U盘
media_dir=/mnt/usb/video
# set this to merge all media_dir base contents into the root container
# note: the default is no
#merge_media_dirs=no
# set this if you want to customize the name that shows up on your clients
friendly_name=Fuqiang DLNA Server
# set this if you would like to specify the directory where you want MiniDLNA to store its database and album art cache
#db_dir=/var/cache/minidlna
# set this if you would like to specify the directory where you want MiniDLNA to store its log file
#log_dir=/var/log
# set this to change the verbosity of the information that is logged
# each section can use a different level: off, fatal, error, warn, info, or debug
#log_level=general,artwork,database,inotify,scanner,metadata,http,ssdp,tivo=warn
# this should be a list of file names to check for when searching for album art
# note: names should be delimited with a forward slash ("/")
album_art_names=Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg/AlbumArt.jpg/albumart.jpg/Album.jpg/album.jpg/Folder.jpg/folder.jpg/Thumb.jpg/thumb.jpg
# set this to no to disable inotify monitoring to automatically discover new files
# note: the default is yes
inotify=yes
# set this to yes to enable support for streaming .jpg and .mp3 files to a TiVo supporting HMO
enable_tivo=no
# set this to beacon to use legacy broadcast discovery method
# defauts to bonjour if avahi is available
tivo_discovery=bonjour
# set this to strictly adhere to DLNA standards.
# * This will allow server-side downscaling of very large JPEG images,
# which may hurt JPEG serving performance on (at least) Sony DLNA products.
strict_dlna=no
# default presentation url is http address on port 80
#presentation_url=http://www.mylan/index.php
# notify interval in seconds. default is 895 seconds.
notify_interval=900
# serial and model number the daemon will report to clients
# in its XML description
serial=12345678
model_number=1
# specify the path to the MiniSSDPd socket
#minissdpdsocket=/var/run/minissdpd.sock
# use different container as root of the tree
# possible values:
# + "." - use standard container (this is the default)
# + "B" - "Browse Directory"
# + "M" - "Music"
# + "V" - "Video"
# + "P" - "Pictures"
# + Or, you can specify the ObjectID of your desired root container (eg. 1$F for Music/Playlists)
# if you specify "B" and client device is audio-only then "Music/Folders" will be used as root
#root_container=.
# always force SortCriteria to this value, regardless of the SortCriteria passed by the client
# note: you can prepend the sort criteria with "!" to alter the titles of the objects so that they
# will be alphanumerically sorted in the order you specify here, to work around clients that do their
# own alphanumeric sorting.
#force_sort_criteria=+upnp:class,+upnp:originalTrackNumber,+dc:title
# maximum number of simultaneous connections
# note: many clients open several simultaneous connections while streaming
#max_connections=50
# set this to yes to allow symlinks that point outside user-defined media_dirs.
#wide_links=no
# enable subtitle support by default on unknown clients.
# note: the default is yes
#enable_subtitles=yes
启动miniDLNA
使用如下命令启动:
/usr/sbin/minidlnad
如果该进程开机后已经默认启动,需要kill掉原来的进程再启动
验证
网址验证
局域网内的客户端通过IP:8200可以查看DLNA状态
播放验证
使用VLC进行DLNA发现,开是否能够发现该服务,并进行视频播放
可以流畅播放720P电影:
性能验证
验证片源:
- 片源1:B062_720P_AVC_AAC_907K_24F.mp4 ---->H264,720P,1M码率
- 片源2:D003_2160P_AVC_AAC_22M_30F.mp4 ---->H264,4K,22M码率
- 片源3:PT2_499_4K_H.266_30F_43M_H265.mp4 ---->H265,4K,43M码率
测试用例及结果:
编号 | 用例 | 结果 |
1 | 手机和PC同时播放片源1 | 通过 |
2 | 手机和PC同时播放片源2 | 通过 |
3 | 手机和PC同时播放片源3 | 不通过,手机上有卡顿,minidlna有规律性的signal 11,每次signal11伴随这卡顿出现 |
4 | PC播放片源3,手机播放片源1 | 通过 |
5 | PC播放片源3,手机播放片源2 | 不通过,有少量卡顿,minidlna有少量signal 11 |