Language:EN / NE / AE / DE / IT

안녕하세요. 이번에는 U5PVR 에 MiniDLNA 를 설치해 보도록 하겠습니다.




이미 안드로이드에 DLNA 서버 및 렌더러가 설치가 되어 있지만 U5PVR 의 미디어를 다른 장치에서 끌고 가기 위해서는 기능상 부족함이 많습니다.


크게 문제는 아래와 같습니다.


1. 미디어 색인이 /mnt/sdcard (/storage/sdcard) 만 인덱싱 됩니다.

2. 자막지원이 안됩니다.

3. LG TV 의 DLNA 기능과 호환성이 떨어집니다.


따라서 이러한 문제를 해결하기 위해서 MiniDLNA 를 설치해 보도록 하겠습니다. SRT 및 SMI 자막을 정상적으로 지원하고 4K 10BIT 파일도 정상적으로 LG UHD TV 에서 정상적으로 사용이 가능하였습니다.



1. 설치 진행하기


실제로 상위 버전 1.2.0 이 있으나 컴파일을 해야하는 어려움이 있습니다. 그래서 jessie-backports 레포를 통해서 1.1.6 버전을 설치해 보도록 하겠습니다.

(저는 이미 설치를 하여 설치가 되어 있다고 나옵니다.)

(백포트 레포는 -t 옵션으로 지정합니다. U5PVR 에도 해당 데비안 버전에 맞는 버전보다 높은 버전을 사용해야할 경우가 있어서 사전에 주소가 입력되어 있습니다.)


root@u5pvr-debian:~# apt-get install -t jessie-backports minidlna

Reading package lists... Done

Building dependency tree

Reading state information... Done

minidlna is already the newest version.

0 upgraded, 0 newly installed, 0 to remove and 62 not upgraded.

root@u5pvr-debian:~#


다음으로 권한 문제에 대한 설정을 진행합니다.


root@u5pvr-debian:~# nano /etc/init.d/minidlna

.......................

# Defaults (could be overridden in /etc/default/$NAME)

CONFIGFILE=/etc/minidlna.conf

LOGFILE=/var/log/minidlna.log

USER=root

GROUP=root       <-- 권한 문제를 피하기 위해서 root 로 설정합니다.

DAEMON_OPTS=""

...................




root@u5pvr-debian:~# nano /etc/default/minidlna

...................

# Path to the configuration file

#CONFIGFILE="/etc/minidlna.conf"


# Path to the log file

#LOGFILE="/var/log/minidlna.log"


# User and group the daemon should run as

USER="root"

GROUP="root"    <-- 마찬가지로 동일하게 설정합니다.

..............




2. minidlna 설정하기


다음으로 minidlna 설정을 진행합니다.

(내용상 설정 구문 위치를 편하게 보기 위해서 전체 내용을 첨부드립니다.)


기본적으로 # 으로 되면 설정이 먹지 않는 것이고 # 을 지우면 설정이 반영이 됩니다. 아래를 참고하셔서 설정해 주시길 바랍니다.


root@u5pvr-debian:~# nano /etc/minidlna.conf


# This is the configuration file for the MiniDLNA daemon, a DLNA/UPnP-AV media
# server.
#
# Unless otherwise noted, the commented out options show their default value.
#
# On Debian, you can also refer to the minidlna.conf(5) man page for
# documentation about this file.

# Specify the user name or uid to run as.
user=root    <-- root 권한으로 구동되도록 설정합니다.


# 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=APV,/mnt    <-- 미디어가 위치하고 있는 장소를 설정합니다. 저는 /mnt 를 러프하게 음악,사진,비디오를 설정한 모습입니다.

# 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

# Type and minimum level of importance of messages to be logged.
#
# The types are "artwork", "database", "general", "http", "inotify",
# "metadata", "scanner", "ssdp" and "tivo".
#
# The levels are "off", "fatal", "error", "warn", "info" or "debug".
# "off" turns of logging entirely, "fatal" is the highest level of importance
# and "debug" the lowest.
#
# The types are comma-separated, followed by an equal sign ("="), followed by a
# level that applies to the preceding types. This can be repeated, separating
# each of these constructs with a comma.
#
# The default is to log all types of messages at the "warn" level.
#log_level=general,artwork,database,inotify,scanner,metadata,http,ssdp,tivo=warn

# Use a different container as the root of the directory tree presented to
# clients. The possible values are:
#   * "." - standard container
#   * "B" - "Browse Directory"
#   * "M" - "Music"
#   * "P" - "Pictures"
#   * "V" - "Video"
#   * Or, you can specify the ObjectID of your desired root container
#     (eg. 1$F for Music/Playlists)
# If you specify "B" and the client device is audio-only then "Music/Folders"
# will be used as root.
#root_container=.

# Network interface(s) to bind to (e.g. eth0), comma delimited.
# This option can be specified more than once.
#network_interface=

# Port number for HTTP traffic (descriptions, SOAP, media transfer).
# This option is mandatory (or it must be specified on the command-line using
# "-p").
port=8200

# URL presented to clients (e.g. http://example.com:80).
#presentation_url=/

# Name that the DLNA server presents to clients.
# Defaults to "hostname: username".
friendly_name=MiniDLNA on U5PVR    <-- 마음에 드는 이름을 입력합니다.

# Serial number the server reports to clients.
# Defaults to the MAC address of nework interface.
#serial=

# Model name the server reports to clients.
#model_name=Windows Media Connect compatible (MiniDLNA)

# Model number the server reports to clients.
# Defaults to the version number of minidlna.
#model_number=

# Automatic discovery of new files in the media_dir directory.
inotify=yes    <-- 파일시스템에 파일이 추가되거나 할 때 자동으롤 반영되도록 합니다. (구글 드라이브 같은 fuse 마운트는 새로운 파일갱신기능이 동작하지 않습니다.)

# List of file names to look for when searching for album art.
# Names should be delimited with a forward slash ("/").
# This option can be specified more than once.
album_art_names=Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg
album_art_names=AlbumArt.jpg/albumart.jpg/Album.jpg/album.jpg
album_art_names=Folder.jpg/folder.jpg/Thumb.jpg/thumb.jpg

# Strictly adhere to DLNA standards.
# This allows server-side downscaling of very large JPEG images, which may
# decrease JPEG serving performance on (at least) Sony DLNA products.
#strict_dlna=no

# Support for streaming .jpg and .mp3 files to a TiVo supporting HMO.
#enable_tivo=no

# SSDP notify interval, in seconds.
notify_interval=895

# Path to the MiniSSDPd socket, for MiniSSDPd support.
#minissdpdsocket=/run/minissdpd.sock

# Always set SortCriteria to this value, regardless of the SortCriteria
# passed by the client
# e.g. force_sort_criteria=+upnp:class,+upnp:originalTrackNumber,+dc:title
#force_sort_criteria=

# 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=yes    <-- 심링크인 디렉터리에서도 작동되게 하기 위해서 설정합니다.


wide_links 의 경우 U5PVR 은 /mnt 폴더에 심링크로 구성되어 마운트가 되는 경우가 있음으로 꼭 해주셔야합니다. 


예로써 SDCARD 의 경우 절대경로는 /data/media 입니다. 심링크 구조를 보면 /data/media -> /storage/sdcard -> /mnt/sdcard 로 되어 있습니다. 실제로는 해당 경로에 위치하는 것이 아니기 때문에 wide_links 를 yes 로 처리해 주지 않으면 아래의 에러가 발생합니다.


마지막으로 minidlna 를 재시작합니다.


root@u5pvr-debian:~# service minidlna restart

[ ok ] Restarting DLNA/UPnP-AV media server: minidlna.

root@u5pvr-debian:~#




3. minidlna 웹UI 접근하기 / 윈도우에서 사용해보기


minidlna 는 현재 미디어가 검색이 완료 되었는지, 몇개의 파일이 스캔되었는지에 대한 정보를 보여주는 웹 UI 가 있습니다.


탐색기 -> 네트워크로 이동하면 검색이 되어 나타납니다. 

(검색 설정을 하지 않으신 분들은 뜨지 않습니다.)



실제로 PlexMediaServer 도 DLNA 기능이 있습니다. 서버와 컨트롤러 및 렌더러 기능을 가지고 있습니다. 한편, MiniDLNA 의 경우 서버 기능만 가능하지만, 설정이 간편하고 다른 기기와 연동성이 좋습니다. 


해당 장치 아이콘을 더블클릭 하면 아래와 같이 웹 브라우저가 열리면서 서버 정보창이 보입니다.



상기 사진에서 스캔중이면 Media Scan in progress... 라는 알림이 보입니다. 


장치 아이콘을 우클릭하여 재생기 열기를 클릭하면 윈도우 미디어 플레이어가 뜨면서 재생가능한 파일일 경우 재생이 됩니다. (다른 플레이어와 연동하면 더욱 더 재생이 잘 되겠지만 윈도우에서는 DLNA 를 크게 사용하지 않아서 더이상 설명은 하지 않습니다.)




++ 추가적으로 미디어를 풀 재스캔 하는 명령어를 알려드립니다.


root@u5pvr-debian:~# minidlnad -R

root@u5pvr-debian:~# service minidlna restart

[ ok ] Restarting DLNA/UPnP-AV media server: minidlna.

root@u5pvr-debian:~#


다시 웹 UI 에 접속해 보시면 스캐닝이 진행중이라는 말이 뜹니다.



혹시나 이 명령 후에 검색이 되지 않으신다면 리부팅을 한번 해 주시면 됩니다.




4. LG UHD TV 와 연동해보기


기본적으로 WebOS 메뉴에는 음악 / 사진&동영상 메뉴가 있습니다. 해당 메뉴를 통해 U5PVR 의 MiniDLNA 서버로 접근을 할 수 있습니다. (참고사항으로 사진&동영상 앱을 실행하셔서 왜 음악이 안보이냐고 하시면 안됩니다 ㅎㅎ.. 분리가 되어 있네요. ㅎㅎ)


제가 실 사용자가 아니라 잠시만 연동 테스트만 진행하였습니다. 추가로 4K HDR 재생 테스트도 하였는데 잘 되었고 (사진은 없습니다.) 아쉽게도 webm 포맷은 DLNA 서버에서 지원이 되지 않아서 스캔을 하여도 목록 리스트에 뜨지를 않습니다.


일단 음악을 먼저 재생해 보도록 하겠습니다.



장치 리스트에서 MiniDLNA on U5PVR 을 선택합니다.



음악이 잘 나오는 부분입니다. (띠용 ~~)



비디오 재생을 해보도록 하겠습니다.



MiniDLNA on U5PVR 을 선택합니다.



SMI 자막 테스트로 명탐정 코난을 넣어 두었습니다.



자막이 잘 나옵니다.



실제로 메뉴가 없어지면서 자막이 내려가나 사진을 타이밍을 너무 잘 맞게 찍다 보니 아직도 중간에 있는 사진이 나와버렸네요.



결론적으로는 


1. SMI / SRT 자막 정상지원

2. 본래 안드로이드 내장 HiMediaServer 에서는 미디어 파일 재생에 에러가 발생하지만 문제 없이 작동을 합니다.

3. 미디어 스캐닝이 빠르고 파일 변동이 있을 시, 바로 바로 반영이 됩니다.

(예로써 녹화를 하고난 뒤 파일이 추가된 상태, 그 즉시 MiniDLNA 가 만응하여 파일 색인이 일어납니다.)



이상으로 글 마치겠습니다. ㅎㅎ 


감사합니다.