DLNA(UPnP-AV) Control Point 만들어 보신 분 있으신가요?

Sdsf3qUr의 이미지
  • 데스크탑 : 아치 리눅스를 사용하고 minidlna 데몬이 돌고 있습니다.
  • 티비 : DLNA(AllShare) 기능이 있는 삼성 제품인데 리모콘을 이용해서 데스크탑에 있는 영상을 재생할 수 있습니다.
  • 스마트폰 : BubbleUPnP 앱을 설치해서 리모콘처럼 사용 합니다.

열편 스무편 이상씩 되는 연재물들을 번갈아 보다 보면 어느 편의 어느 부분까지 봤는지 기억해놔야 다음에 다시 볼 때 이 파일 저 파일 틀어가며 어디까지 봤는지 기억을 더듬는 수고를 하지 않습니다.

아쉽게도 티비 자체의 기능이나 BubbleUPnP의 기능중에 이런 기능은 없더군요. 그래서 이런 기능을 하는 프로그램을 데스크탑에서 직접 조정하려고 합니다. 다행히 티비, 데스크탑, 티비를 보는 제 위치 이 세가지가 가까이 모여 있습니다.

조사를 좀 해보니까 이런 기능을 담당하는 부분을 UPnP-AV Control Point라고 하더군요. 미디어 서버에서 파일 목록을 얻어서 원하는 파일을 미디어 렌더러에 재생하라고 지시하는 부분이 컨트롤 포인트의 핵심적인 기능입니다.

문제는 스크립트에서 가져다 쓸만한 관련 프로그램을 찾기가 쉽지가 않네요.

gupnp-tools 패키지의 gupnp-av-cp 프로그램이 딱 제가 원하는 기능을 가지고 있는데 GUI 프로그램이고 쉘에서 이렇게 저렇게 조작해서 쓸만한 인터페이스를 제공하지 않습니다. 마우스로만 조작해서 사용하게 되어 있네요.

avremote, upnp-cmd 이 두가지 프로그램도 제가 원하는 동작을 할 것 같은데 문제는 어떻게 사용할 지 감이 안 온다는 겁니다.

$ avremote -h
AVRemote 0.4.1 - send AVTransport commands to UPNP media services

Copyright (C) 2011 Jaromil @ NIMk.nl Artlab , License GNU AGPL v3+
This is free software: you are free to change and redistribute it.
The latest AVTransport sourcecode is published on <http://nimk.nl/avremote>

Syntax: avremote [options] [command] [args...]

Commands:

discover    scan for upnp devices on the network
load        load a file and prepare it for playback
mode        set playback mode (NORMAL or REPEAT_ONE)
play        start playing the selected file
pause       pause currently running playback
stop        stop playback and return to menu
status      print the current status of the device
jump        seek to a position in time (00:00:00)

none means load and play URL, or use - to read xml from stdin

Options:

-s          network address or hostname of the media server
-p          port on which the UPNP AVTransport daemon is listening
-t          dry run to test without a server (print out rendered xml)

-h          print this help
-v          version information for this tool

For more informations on AVRemote read the manual: man avremote
Please report bugs on <http://bugs.dyne.org>.

몇 가지 시도를 해봤습니다.

~ $ avremote
Performing upnp discovery...
upnp:rootdevice http://192.168.219.7:58645/dev/9bcc090a-f72b-dadc-0000-00002a4be90c/desc.xml    192.168.219.7   58645
upnp:rootdevice http://192.168.219.7:58645/dev/9bcc090a-f72b-dadc-ffff-ffff85fe2c02/desc.xml    192.168.219.7   58645
upnp:rootdevice http://192.168.219.6:7676/smp_10_   192.168.219.6   7676
upnp:rootdevice http://192.168.219.6:7676/smp_2_    192.168.219.6   7676
upnp:rootdevice http://192.168.219.2:8200/rootDesc.xml  192.168.219.2   8200
Please specify a target device host and port.
~ $
  • 219.7 : 전화기
  • 219.6 : 티비
  • 219.2 : 데스크탑
~ $ avremote -s 192.168.219.6 -p 7676 ~/Downloads/Some\ TV\ Show/S01E01.mkv
warning: command not recognized, loading and playing as url
HTTP/1.1 400 Bad Request
Content-Type: 
Content-Length: 0
Connection: close
 
~ $ avremote -s 192.168.219.6 -p 7676 ~/Downloads/Some\ TV\ Show/S01E01.mkv -t
dry run: printint out rendered upnp message without establishing connection
warning: command not recognized, loading and playing as url
send upnp header wrote only 4294967295 of 228 bytessend upnp message wrote only
4294967295 of 1259 byteserror: no such host as dry run (Success)
header (214 bytes):
POST /MediaRenderer_AVTransport/control HTTP/1.0
SOAPACTION: "urn:schemas-upnp-org:service:AVTransport:1#Play"
CONTENT-TYPE: text/xml ; charset="utf-8"
HOST: dry run:0
Connection: close
Content-Length: 321
 
 
 
message (321 bytes):
<?xml version="1.0" encoding="utf-8"?>
 
<s:Envelope
 s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
 xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
 
<s:Body>
<u:Play xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>0</InstanceID>
<Speed>1</Speed>
</u:Play>
</s:Body>
</s:Envelope>
 
 
~ $

이런 식으로 시도를 해봤는데 아무래도 파일 이름을 적을 때 로컬 경로를 적는 건 틀린 방법 같습니다. avremote 만든 분이 작성한 글타래에 질문을 올려두긴 했는데 혹시 여기도 실마리를 주실 분이 있을까 해서 질문 드립니다.

좋은 하루 보내세요.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.