「MediaTomb」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(en:MediaTombへの転送ページ)
 
1行目: 1行目:
  +
[[Category:ストリーミング]]
#redirect[[en:MediaTomb]]
 
  +
[[en:MediaTomb]]
  +
{{Related articles start}}
  +
{{Related|ストリーミングメディア}}
  +
{{Related articles end}}
  +
  +
[http://mediatomb.cc/ MediaTomb - Free UPnP MediaServer] より:
  +
  +
:''MediaTomb はオープンソース (GPL) の UPnP メディアサーバーです。ウェブユーザーインターフェイスが内蔵されており、デジタルメディアをホームネットワークにストリーミングして様々な UPnP 互換のデバイスから視聴することができます。''
  +
  +
MediaTomb は PlayStation 3 (Xbox 360 はサポートされていません) などの UPnP に対応するデバイスにデジタルメディアをストリーミングすることができます。[http://sourceforge.net/projects/fuppes FUPPES], [[PS3 Mediaserver|ps3mediaserver]], [[en2:uShare|uShare]] などと同じサーバーの一つです。MediaTomb の特徴して、抽出されたメタデータにあわせてサーバーレイアウトをカスタマイズすることができます (スクリプタブルな下層コンテナ)。MediaTomb は高度な柔軟性が確保されています。
  +
  +
== インストール ==
  +
  +
MediaTomb は [[AUR]] の {{AUR|mediatomb}} パッケージでインストールすることができます。
  +
  +
最新の開発版も [[AUR]] の {{AUR|mediatomb-git}} パッケージでインストール可能です。
  +
  +
Mediatomb は内蔵されているデーターベースと、ローカルの [[MariaDB]] サーバーのどちらかを使うことができます。[[MariaDB]] を利用する方法は [http://mediatomb.cc/pages/documentation#id2855459 ドキュメント] を見て下さい。
  +
  +
== 設定 ==
  +
  +
大抵の場合、デフォルト設定で問題ありませんが、PlayStation 3 を使うには設定の変更が必要です。MediaTomb はユーザー個別にも設定・実行することも、ユーザー全体のデーモンとして設定することもできます。インストール後、以下を実行すると現在のユーザーで MediaTomb が起動して {{ic|~/.mediatomb/config.xml}} にデフォルト設定が生成されます:
  +
$ mediatomb
  +
  +
もしくは、次のコマンドを実行すると MediaTomb デーモンが起動して {{ic|/var/lib/mediatomb/.mediatomb/config.xml}} にデフォルト設定が生成されます:
  +
  +
# systemctl start mediatomb
  +
  +
[[MariaDB]] データベースバックエンドを使う場合、次を実行してください:
  +
  +
# systemctl start mediatomb-mariadb
  +
  +
[[MariaDB]] が立ち上がっているか確認されてから MediaTomb が起動します。
  +
  +
== 使用方法 ==
  +
  +
デフォルトで使用されるデーモンのポートは 50500 です。ウェブインターフェイスにアクセスしてメディアをインポートするには、お好きなブラウザで http://127.0.0.1:50500/ を開いて下さい (JavaScript が必要です)。
  +
  +
ユーザー個別に MediaTomb のインスタンスを起動した場合、デフォルトのポートは 49152 です。ただし、サーバーを再起動するとポートが変わってしまう可能性があります。起動時にウェブインターフェイスの URL が出力されます。ユーザーは手動でポートを指定することも可能です:
  +
  +
$ mediatomb -p 50500
  +
  +
== メディアプレイヤーにフルパスを表示しない ==
  +
  +
デフォルトでは、フォルダをデバイスで閲覧したときはディレクトリのフルパスが表示されます。
  +
  +
例えば、{{ic|/media/my_media/video_data/videos/movies}} ディレクトリを追加した場合、接続したときに root から 'movies' ディレクトリに移動する必要があります。
  +
  +
フルパスを非表示にして追加したディレクトリだけを表示するには、インポートスクリプトを修正します。
  +
  +
For example, this script will automatically truncate the whole directory structure specified in the variable video_root. Any directories added directly under the video root path will show up on UPnP devices starting from the that folder rather than /.
  +
  +
function addVideo(obj)
  +
{
  +
var video_root = "/media/main_core/Server_Core_Folder/FTP_Services/Media/";
  +
  +
var absolute_path = obj.location;
  +
  +
var relative_path = absolute_path;
  +
  +
if(absolute_path.indexOf(video_root) == 0)
  +
relative_path = absolute_path.replace(video_root, "")
  +
  +
var chain = new Array();
  +
  +
var pathSplit = relative_path.split("/");
  +
  +
for(var i = 0; i < pathSplit.length - 1; i++)
  +
chain.push(pathSplit[i]);
  +
  +
addCdsObject(obj, createContainerChain(chain));
  +
}
  +
  +
To also hide the default PC Directory folder from UPnP device directory listings, add the following directly under the server node of your config.xml file.
  +
  +
<pc-directory upnp-hide="yes"/>
  +
  +
== Playstation 3 サポート ==
  +
  +
The following notes assume MediaTomb is running as a system-wide daemon. For a per-user install, the locations of the configuration file will be different (see above).
  +
  +
For PlayStation 3 support, users must set {{Ic|<nowiki><protocolInfo extend="yes"/></nowiki>}}. An "avi" mimetype mapping should also be uncommented for DivX support.
  +
  +
{{hc|/var/lib/mediatomb/.mediatomb/config.xml
  +
|2=<nowiki>
  +
...
  +
  +
<protocolInfo extend="yes"/>
  +
  +
...
  +
  +
<map from="avi" to="video/divx"/>
  +
  +
...
  +
</nowiki>}}
  +
  +
When importing media to the database, MediaTomb will create a virtual container layout as defined by the {{Ic|<nowiki><virtual-layout type="..."></nowiki>}} option. That is, media will be organized according to metadata (album, artist, etc.) through creation of virtual database objects. If your media is already organized on the file system, you may disable this feature to significantly improve import performance:
  +
  +
{{hc|/var/lib/mediatomb/.mediatomb/config.xml
  +
|2=<nowiki>
  +
...
  +
  +
<virtual-layout type="disabled"/>
  +
  +
...
  +
</nowiki>}}
  +
  +
Users may customize the import script to fine-tune the virtual layout. The [http://mediatomb.cc/dokuwiki/scripting:scripting Scripting] section of the MediaTomb wiki provides several examples. Starting with the built-in script available at {{ic|/usr/share/mediatomb/js/import.js}}:
  +
  +
$ cp /usr/share/mediatomb/js/import.js /var/lib/mediatomb/.mediatomb/
  +
  +
... and edit {{ic|/var/lib/mediatomb/.mediatomb/import.js}} as desired. To utilize the customized script, users must set {{Ic|<nowiki><virtual-layout type="js"></nowiki>}} and specify the script's location.
  +
  +
{{hc|/var/lib/mediatomb/.mediatomb/config.xml
  +
|2=<nowiki>
  +
...
  +
  +
<virtual-layout type="js">
  +
<import-script>/var/lib/mediatomb/.mediatomb/import.js</import-script>
  +
</virtual-layout>
  +
  +
...
  +
</nowiki>}}
  +
  +
You may have to specify an interface before MediaTomb will be recognized:
  +
  +
{{hc|/var/lib/mediatomb/.mediatomb/config.xml
  +
|<nowiki>
  +
<server>
  +
...
  +
<interface>eth0</interface>
  +
...
  +
</server>
  +
</nowiki>}}
  +
  +
... replacing eth0 with the interface you connect on.
  +
  +
After configuring MediaTomb to your liking, restart the server by running
  +
  +
# systemctl restart mediatomb
  +
  +
== Samsung TV サポート ==
  +
For Samsung TV support users should install {{AUR|mediatomb-samsung-tv}} from the [[AUR]], which it's the same as the {{AUR|mediatomb}} package with a few more patches. Note that the TV must have [http://en.wikipedia.org/wiki/Digital_Living_Network_Alliance DLNA] support. Also the server and the TV should be connected to the same network.
  +
  +
The following note assume MediaTomb is running as a system-wide daemon. For a per-user install, the locations of the configuration file will be different (see above).
  +
  +
Some models require changes in config.xml. Users should edit the {{Ic|<nowiki><custom-http-headers></nowiki>}} section and add two entries in the {{Ic|<nowiki><mappings></nowiki>}} section for better compatibility.
  +
  +
{{hc|/var/lib/mediatomb/.mediatomb/config.xml
  +
|2=<nowiki>
  +
...
  +
  +
<custom-http-headers>
  +
<add header="transferMode.dlna.org: Streaming"/>
  +
<add header="contentFeatures.dlna.org: DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=017000 00000000000000000000000000"/>
  +
</custom-http-headers>
  +
  +
...
  +
  +
<map from="avi" to="video/mpeg"/>
  +
<map from="mkv" to="video/mpeg"/>
  +
  +
...
  +
</nowiki>}}
  +
  +
== Systemd の統合 ==
  +
  +
mediatomb パッケージには [[systemd]] サービスファイルが2つ付属しています: {{ic|mediatomb.service}} と {{ic|mediatomb-mariadb.service}}。root で実行するのは危険なため、どちらもインストール時に作成される 'mediatomb' ユーザーで実行されます。
  +
  +
Choose which one you want to use, based on whether you want mediatomb to wait for mariadb to be up and running first or not. I.e. if you use a mariadb backend use mediatomb-mariadb.service, and use mediatomb.service otherwise.
  +
  +
If you experience problem with discovery of MediaTomb service on your device, make sure that it binds to interfaces other than 'lo' - check in /etc/default/mediatomb
  +
  +
== トラブルシューティング ==
  +
  +
=== ウェブフロントエンドでコンテンツを追加しても Mediatomb に表示されない ===
  +
Be aware of the fact that the user Mediatomb runs under, has to have read rights on the files that are added to be able to provide them.
  +
  +
So if Mediatomb runs under the user 'mediatomb' the (video-)files either have to be owned by the user 'mediatomb' and need to be readable or the files and the user 'mediatomb' have to belong to the same group with the file being readable ('mediatomb' has to be in the group to which the file belongs (the file then needs the read rights for the group to be set)).
  +
  +
=== 30分後にクライアントからの接続が途切れる ===
  +
Apparently this is related to SSNP message only being sent once which results in the Client dropping its connection in 30 minutes since it thinks the server is gone.
  +
  +
In the config.xml add the alive tag
  +
''
  +
<alive>180</alive>
  +
  +
Optional
  +
  +
Default: 180, this is according to the UPnP specification.
  +
  +
Interval for broadcasting SSDP:alive messages
  +
  +
From http://mediatomb.cc/pages/documentation#id2856362''
  +
  +
== バグ ==
  +
  +
The "-i" command-line option to bind to a specific IP address does not work. Bug reported in 2010 to [https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=693301 Debian] and [http://sourceforge.net/p/mediatomb/bugs/76 Upstream]. The webserver remains accessible on all interfaces.

2015年12月15日 (火) 17:51時点における版

関連記事

MediaTomb - Free UPnP MediaServer より:

MediaTomb はオープンソース (GPL) の UPnP メディアサーバーです。ウェブユーザーインターフェイスが内蔵されており、デジタルメディアをホームネットワークにストリーミングして様々な UPnP 互換のデバイスから視聴することができます。

MediaTomb は PlayStation 3 (Xbox 360 はサポートされていません) などの UPnP に対応するデバイスにデジタルメディアをストリーミングすることができます。FUPPES, ps3mediaserver, uShare などと同じサーバーの一つです。MediaTomb の特徴して、抽出されたメタデータにあわせてサーバーレイアウトをカスタマイズすることができます (スクリプタブルな下層コンテナ)。MediaTomb は高度な柔軟性が確保されています。

インストール

MediaTomb は AURmediatombAUR パッケージでインストールすることができます。

最新の開発版も AURmediatomb-gitAUR パッケージでインストール可能です。

Mediatomb は内蔵されているデーターベースと、ローカルの MariaDB サーバーのどちらかを使うことができます。MariaDB を利用する方法は ドキュメント を見て下さい。

設定

大抵の場合、デフォルト設定で問題ありませんが、PlayStation 3 を使うには設定の変更が必要です。MediaTomb はユーザー個別にも設定・実行することも、ユーザー全体のデーモンとして設定することもできます。インストール後、以下を実行すると現在のユーザーで MediaTomb が起動して ~/.mediatomb/config.xml にデフォルト設定が生成されます:

$ mediatomb

もしくは、次のコマンドを実行すると MediaTomb デーモンが起動して /var/lib/mediatomb/.mediatomb/config.xml にデフォルト設定が生成されます:

# systemctl start mediatomb

MariaDB データベースバックエンドを使う場合、次を実行してください:

# systemctl start mediatomb-mariadb

MariaDB が立ち上がっているか確認されてから MediaTomb が起動します。

使用方法

デフォルトで使用されるデーモンのポートは 50500 です。ウェブインターフェイスにアクセスしてメディアをインポートするには、お好きなブラウザで http://127.0.0.1:50500/ を開いて下さい (JavaScript が必要です)。

ユーザー個別に MediaTomb のインスタンスを起動した場合、デフォルトのポートは 49152 です。ただし、サーバーを再起動するとポートが変わってしまう可能性があります。起動時にウェブインターフェイスの URL が出力されます。ユーザーは手動でポートを指定することも可能です:

$ mediatomb -p 50500

メディアプレイヤーにフルパスを表示しない

デフォルトでは、フォルダをデバイスで閲覧したときはディレクトリのフルパスが表示されます。

例えば、/media/my_media/video_data/videos/movies ディレクトリを追加した場合、接続したときに root から 'movies' ディレクトリに移動する必要があります。

フルパスを非表示にして追加したディレクトリだけを表示するには、インポートスクリプトを修正します。

For example, this script will automatically truncate the whole directory structure specified in the variable video_root. Any directories added directly under the video root path will show up on UPnP devices starting from the that folder rather than /.

function addVideo(obj)
{
   var video_root = "/media/main_core/Server_Core_Folder/FTP_Services/Media/";

   var absolute_path = obj.location;

   var relative_path = absolute_path;

   if(absolute_path.indexOf(video_root) == 0)
      relative_path = absolute_path.replace(video_root, "")

  var chain = new Array();

  var pathSplit = relative_path.split("/");

  for(var i = 0; i < pathSplit.length - 1; i++) 
      chain.push(pathSplit[i]);

  addCdsObject(obj, createContainerChain(chain));
}

To also hide the default PC Directory folder from UPnP device directory listings, add the following directly under the server node of your config.xml file.

<pc-directory upnp-hide="yes"/>

Playstation 3 サポート

The following notes assume MediaTomb is running as a system-wide daemon. For a per-user install, the locations of the configuration file will be different (see above).

For PlayStation 3 support, users must set <protocolInfo extend="yes"/>. An "avi" mimetype mapping should also be uncommented for DivX support.

/var/lib/mediatomb/.mediatomb/config.xml
...

<protocolInfo extend="yes"/>

...

<map from="avi" to="video/divx"/>

...

When importing media to the database, MediaTomb will create a virtual container layout as defined by the <virtual-layout type="..."> option. That is, media will be organized according to metadata (album, artist, etc.) through creation of virtual database objects. If your media is already organized on the file system, you may disable this feature to significantly improve import performance:

/var/lib/mediatomb/.mediatomb/config.xml
...

<virtual-layout type="disabled"/>

...

Users may customize the import script to fine-tune the virtual layout. The Scripting section of the MediaTomb wiki provides several examples. Starting with the built-in script available at /usr/share/mediatomb/js/import.js:

$ cp /usr/share/mediatomb/js/import.js /var/lib/mediatomb/.mediatomb/

... and edit /var/lib/mediatomb/.mediatomb/import.js as desired. To utilize the customized script, users must set <virtual-layout type="js"> and specify the script's location.

/var/lib/mediatomb/.mediatomb/config.xml
...

<virtual-layout type="js">
  <import-script>/var/lib/mediatomb/.mediatomb/import.js</import-script>
</virtual-layout>

...

You may have to specify an interface before MediaTomb will be recognized:

/var/lib/mediatomb/.mediatomb/config.xml
<server>
...
  <interface>eth0</interface>
...
</server>

... replacing eth0 with the interface you connect on.

After configuring MediaTomb to your liking, restart the server by running

# systemctl restart mediatomb

Samsung TV サポート

For Samsung TV support users should install mediatomb-samsung-tvAUR from the AUR, which it's the same as the mediatombAUR package with a few more patches. Note that the TV must have DLNA support. Also the server and the TV should be connected to the same network.

The following note assume MediaTomb is running as a system-wide daemon. For a per-user install, the locations of the configuration file will be different (see above).

Some models require changes in config.xml. Users should edit the <custom-http-headers> section and add two entries in the <mappings> section for better compatibility.

/var/lib/mediatomb/.mediatomb/config.xml
...

<custom-http-headers>
   <add header="transferMode.dlna.org: Streaming"/>
   <add header="contentFeatures.dlna.org: DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=017000 00000000000000000000000000"/>
</custom-http-headers>

...

<map from="avi" to="video/mpeg"/>
<map from="mkv" to="video/mpeg"/>

...

Systemd の統合

mediatomb パッケージには systemd サービスファイルが2つ付属しています: mediatomb.servicemediatomb-mariadb.service。root で実行するのは危険なため、どちらもインストール時に作成される 'mediatomb' ユーザーで実行されます。

Choose which one you want to use, based on whether you want mediatomb to wait for mariadb to be up and running first or not. I.e. if you use a mariadb backend use mediatomb-mariadb.service, and use mediatomb.service otherwise.

If you experience problem with discovery of MediaTomb service on your device, make sure that it binds to interfaces other than 'lo' - check in /etc/default/mediatomb

トラブルシューティング

ウェブフロントエンドでコンテンツを追加しても Mediatomb に表示されない

Be aware of the fact that the user Mediatomb runs under, has to have read rights on the files that are added to be able to provide them.

So if Mediatomb runs under the user 'mediatomb' the (video-)files either have to be owned by the user 'mediatomb' and need to be readable or the files and the user 'mediatomb' have to belong to the same group with the file being readable ('mediatomb' has to be in the group to which the file belongs (the file then needs the read rights for the group to be set)).

30分後にクライアントからの接続が途切れる

Apparently this is related to SSNP message only being sent once which results in the Client dropping its connection in 30 minutes since it thinks the server is gone.

In the config.xml add the alive tag <alive>180</alive>

Optional

Default: 180, this is according to the UPnP specification.

Interval for broadcasting SSDP:alive messages

From http://mediatomb.cc/pages/documentation#id2856362

バグ

The "-i" command-line option to bind to a specific IP address does not work. Bug reported in 2010 to Debian and Upstream. The webserver remains accessible on all interfaces.