Ubuntu TVやってみる(14) 動画インデックスの生成(xbmcが落ちるので作れず)

一応ぬるぬる動いている。
動画サンプル入れてみないとな。
このへんに映画のサンプルがあるので、~/Videosに落としてみる。
http://www.h264info.com/clips.html
サムネイルの生成は、以下のスクリプトで実行する。

linaro@linaro-ubuntu-desktop:~/Videos$ /usr/lib/unity-lens-video/create_tmb.sh ~/Videos/
/usr/lib/unity-lens-video/create_tmb.sh
Creating thumbnails for /home/linaro/Videos/Captain America - The First Avenger - Trailer 2.mp4...
Creating thumbnails for /home/linaro/Videos/The Hobbit - An Unexpected Journey - Trailer.mp4...

結構時間かかる。
たかだがトレーラーサイズなのに。
これって、早送り用のキーフレームのサムネイルも生成しているのかしらん。

linaro@linaro-ubuntu-desktop:~/Videos$ ls
Captain America - The First Avenger - Trailer 2.mp4
Captain America - The First Avenger - Trailer 2_0.tmb
Captain America - The First Avenger - Trailer 2_1.tmb
Captain America - The First Avenger - Trailer 2_2.tmb
Captain America - The First Avenger - Trailer 2_3.tmb
Captain America - The First Avenger - Trailer 2_4.tmb
Captain America - The First Avenger - Trailer 2_5.tmb
Captain America - The First Avenger - Trailer 2_6.tmb
Captain America - The First Avenger - Trailer 2_7.tmb
Captain America - The First Avenger - Trailer 2_8.tmb
Captain America - The First Avenger - Trailer 2_9.tmb
The Hobbit - An Unexpected Journey - Trailer.mp4
The Hobbit - An Unexpected Journey - Trailer_0.tmb
The Hobbit - An Unexpected Journey - Trailer_1.tmb
The Hobbit - An Unexpected Journey - Trailer_2.tmb
The Hobbit - An Unexpected Journey - Trailer_3.tmb
The Hobbit - An Unexpected Journey - Trailer_4.tmb
The Hobbit - An Unexpected Journey - Trailer_5.tmb
The Hobbit - An Unexpected Journey - Trailer_6.tmb
The Hobbit - An Unexpected Journey - Trailer_7.tmb
The Hobbit - An Unexpected Journey - Trailer_8.tmb
The Hobbit - An Unexpected Journey - Trailer_9.tmb

やっぱそうか。
データ量多くなりそうだな... orz


んー、これだけでは何も出てこないな。

video-lensの説明はこれ。
https://bazaar.launchpad.net/~s-team/ubuntutv/unity-lens-video/view/head:/README.txt

データは、Videos/unityの下に入るようだ。
そんなディレクトリはないな。


データの生成には、XMBCがいるのか。
ドキュメントに従ってPPA版を入れる。

linaro@linaro-ubuntu-desktop:~/Videos$ sudo add-apt-repository ppa:nathan-renniewaldock/xbmc-stable
You are about to add the following PPA to your system:
 XBMC Stable
 Stable releases of XBMC.
 More info: https://launchpad.net/~nathan-renniewaldock/+archive/xbmc-stable
Press [ENTER] to continue or ctrl-c to cancel adding it

Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /tmp/tmp.rEITkGdSnD --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver hkp://keyserver.ubuntu.com:80/ --recv 428926204FE30238F00B98224CDB129629A4B41A
gpg: requesting key 29A4B41A from hkp server keyserver.ubuntu.com
gpg: key 29A4B41A: public key "Launchpad PPA for Nathan Rennie-Waldock" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)

linaro@linaro-ubuntu-desktop:~/Videos$ sudo apt-get update

linaro@linaro-ubuntu-desktop:~/Videos$ apt-get install xbmc -s
NOTE: This is only a simulation!
      apt-get needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 xbmc : Depends: xbmc-bin (>= 2:11.0-0~beta1~ppa1~oneiric) but 2:11.0~git20111216.68fff18-0linaro7 is to be installed
        Recommends: python-qt3 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

うえ、パッケージコンフリクトだよ。
めんどくさすぎ。
インデックス作るだけなんだけどな。
PPAを削除。

linaro@linaro-ubuntu-desktop:~/Videos$ sudo rm /etc/apt/sources.list.d/nathan-renniewaldock-xbmc-stable-oneiric.list 
linaro@linaro-ubuntu-desktop:~/Videos$ sudo apt-get update


xbmcってないの?

linaro@linaro-ubuntu-desktop:~/Videos$ apt-cache search xbmc
texlive-latex-extra - TeX Live: LaTeX supplementary packages
libnfo1 - an NFO file parser/writer library
minidlna - lightweight DLNA/UPnP-AV server targeted at embedded systems
xbmc - XBMC Media Center (arch-independent data package)
xbmc-eventclients-wiiremote - XBMC Media Center (Event Client WII Remote support package)
xbmc-eventclients-common - XBMC Media Center (Event Client Common package)
xbmc-eventclients-dev - XBMC Media Center (Event Client Dev package)
xbmc-eventclients-j2me - XBMC Media Center (Event Client J2ME package)
xbmc-eventclients-ps3 - XBMC Media Center (Event Client PS3 package)
xbmc-bin - XBMC Media Center (binary data package)
xbmc-live - XBMC Media Center (XBMC Live package)
xbmc-eventclients-xbmc-send - XBMC Media Center (Event Client XBMC-SEND package)
xbmc-bin-dbgsym - debug symbols for package xbmc-bin

普通にあるんじゃん。
これだとダメかね?

linaro@linaro-ubuntu-desktop:~/Videos$ apt-get install xbmc -s
NOTE: This is only a simulation!
      apt-get needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libxcb-xfixes0 libgbm1 libwayland0 libxcb-dri2-0
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  libhal-storage1 libhal1 liblzo2-2 libmicrohttpd5 libmikmod2 libqt3-mt
  libsdl-mixer1.2 libsmpeg0 libyajl1 mesa-utils python-bluez python-central
  python-qt3 python-sip xbmc-bin
Suggested packages:
  libqt3-mt-psql libqt3-mt-mysql libqt3-mt-odbc python-qt3-gl python-qt3-doc
  xbmc-test-helper
Recommended packages:
  libcec
The following NEW packages will be installed:
  libhal-storage1 libhal1 liblzo2-2 libmicrohttpd5 libmikmod2 libqt3-mt
  libsdl-mixer1.2 libsmpeg0 libyajl1 mesa-utils python-bluez python-central
  python-qt3 python-sip xbmc xbmc-bin
0 upgraded, 16 newly installed, 0 to remove and 5 not upgraded.
Inst libhal1 (0.5.14-7ubuntu1linaro1 Linaro Overlay PPA:11.10/oneiric [armel])
Inst libhal-storage1 (0.5.14-7ubuntu1linaro1 Linaro Overlay PPA:11.10/oneiric [armel])
Inst liblzo2-2 (2.05-2ubuntu1linaro1 Linaro Overlay PPA:11.10/oneiric [armel])
Inst libmicrohttpd5 (0.4.6-1 Ubuntu:11.10/oneiric [armel])
Inst libmikmod2 (3.1.11-a-6.4 Ubuntu:11.10/oneiric [armel])
Inst libqt3-mt (3:3.3.8-b-8ubuntu1 Ubuntu:11.10/oneiric [armel])
Inst libsmpeg0 (0.4.5+cvs20030824-2.2ubuntu1 Ubuntu:11.10/oneiric [armel])
Inst libsdl-mixer1.2 (1.2.8-6.3build1 Ubuntu:11.10/oneiric [armel])
Inst python-central (0.6.17 Ubuntu:11.10/oneiric [all])
Inst python-bluez (0.18-1build1 Ubuntu:11.10/oneiric [armel])
Inst python-sip (4.12.4-1 Ubuntu:11.10/oneiric [armel])
Inst python-qt3 (3.18.1-4ubuntu3 Ubuntu:11.10/oneiric [armel])
Inst libyajl1 (1.0.12-0ubuntu2 Ubuntu:11.10/oneiric [armel])
Inst xbmc-bin (2:11.0~git20111216.68fff18-0linaro7 Linaro Overlay PPA:11.10/oneiric [armel])
Inst mesa-utils (8.0.1+git20110129+d8f7d6b-0ubuntu2 Ubuntu:11.10/oneiric [armel])
Inst xbmc (2:11.0~git20111216.68fff18-0linaro7 Linaro Overlay PPA:11.10/oneiric [armel])
Conf libhal1 (0.5.14-7ubuntu1linaro1 Linaro Overlay PPA:11.10/oneiric [armel])
Conf libhal-storage1 (0.5.14-7ubuntu1linaro1 Linaro Overlay PPA:11.10/oneiric [armel])
Conf liblzo2-2 (2.05-2ubuntu1linaro1 Linaro Overlay PPA:11.10/oneiric [armel])
Conf libmicrohttpd5 (0.4.6-1 Ubuntu:11.10/oneiric [armel])
Conf libmikmod2 (3.1.11-a-6.4 Ubuntu:11.10/oneiric [armel])
Conf libqt3-mt (3:3.3.8-b-8ubuntu1 Ubuntu:11.10/oneiric [armel])
Conf libsmpeg0 (0.4.5+cvs20030824-2.2ubuntu1 Ubuntu:11.10/oneiric [armel])
Conf libsdl-mixer1.2 (1.2.8-6.3build1 Ubuntu:11.10/oneiric [armel])
Conf python-central (0.6.17 Ubuntu:11.10/oneiric [all])
Conf python-bluez (0.18-1build1 Ubuntu:11.10/oneiric [armel])
Conf python-sip (4.12.4-1 Ubuntu:11.10/oneiric [armel])
Conf python-qt3 (3.18.1-4ubuntu3 Ubuntu:11.10/oneiric [armel])
Conf libyajl1 (1.0.12-0ubuntu2 Ubuntu:11.10/oneiric [armel])
Conf xbmc-bin (2:11.0~git20111216.68fff18-0linaro7 Linaro Overlay PPA:11.10/oneiric [armel])
Conf mesa-utils (8.0.1+git20110129+d8f7d6b-0ubuntu2 Ubuntu:11.10/oneiric [armel])
Conf xbmc (2:11.0~git20111216.68fff18-0linaro7 Linaro Overlay PPA:11.10/oneiric [armel])

行けそうじゃない。
入れる。

linaro@linaro-ubuntu-desktop:~/Videos$ sudo apt-get install xbmc

起動する。

linaro@linaro-ubuntu-desktop:~/Videos$ xbmc
/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py:57: GtkWarning: could not open display
  warnings.warn(str(e), _gtk.Warning)
Error: unable to open display 
FEH.py: cannot connect to X server 

うげ、これもダメなのかよ。


一旦、ubuntu-tvを終わる。

linaro@linaro-ubuntu-desktop:~/Videos$ ps ax | grep unity-2d-shell
 2774 pts/0    Sl+    7:22 ./shell/app/unity-2d-shell -opengl
linaro@linaro-ubuntu-desktop:~/Videos$ kill 2774

xbmcを起動すると、セグフォルトで落ちた... orz
というわけで、コンテンツインデックスが作れない罠。
手で作る?
インデックスだけ自動生成したらいいので、
なんかのスクリプトで書いた互換デーモンとかないのかね。
てーか、このへんxbmcに依存してるのがイヤ。