Ubuntu 英語の "Tutorial & Tips" を翻訳してみませんか?詳しくはこちらを参照下さい。

  • HowTo: Jaunty Jackalopeに最新のMPlayerをインストール

序説

これはどのようにしてJaunty Jackalopeへ包括的にMPlayerをコンパイルする方法のデモンストレーション・ガイドです。 この方法は高度な操作が可能なユーザーに限ります。もしかすると、この高度なガイドは非常に興味のある試みかもしれません: Comprehensive Multimedia & Video Howto where Nathan will look after you.

事前に行う準備

実際にMPlayerをコンパイルする前にある程度の準備が必要です。必要な手順は:

  1. Medibuntuのリポジトリを使用する設定(リポジトリの追加)
  2. 最新の x264 libraries をコンパイル
  3. 最新の live555 libraries をコンパイル
  4. 必要なdevファイルをダウンロードしてインストール

最初に、Medibuntuのリポジトリを使用する設定が必要です:

Medibuntu

Medibuntu holds the dev files for amr wide and narrow band and you will need to both add Medibuntu to your sources list by issuing the following command:

Code:

$ sudo wget http://www.medibuntu.org/sources.list.d/jaunty.list \
--output-document=/etc/apt/sources.list.d/medibuntu.list

as well as adding the Medibuntu GPG key:

Code:

$ sudo apt-get update && sudo apt-get install medibuntu-keyring \
&& sudo apt-get update

You will get a message from apt similar to the following:

WARNING: The following packages cannot be authenticated!
  medibuntu-keyring
Install these packages without verification [y/N]?

Typing 'y' means that you trust the Medibuntu archive, as I personally do. With this done the next step is to download and compile the latest x264 libraries:

x264

Note that x264 is required so MEncoder can encode/transcode to the h264 format, MPlayer playback does not actually require these files. The x264 package included with Jaunty is a little newer than previous offerings, in fact a snapshot from December 30th, 2008, but it is still a good idea to download and compile your own. I would also strongly advise that all older versions of x264 are removed from your system before installing the newer version. Some software tools are required first:

Code:

$ sudo apt-get install build-essential checkinstall gpac libgpac-dev git-core yasm

On a fresh system, which is how I test this guide, this is a download of about 23 megs. The next few steps download the x264 libraries from git and then compile, package and install them:

Code:

$ cd $HOME
$ git clone git://git.videolan.org/x264.git
$ cd x264
$ ./configure --prefix=/usr --enable-shared
$ make
$ sudo checkinstall --fstrans=no --install=yes --pakdir "$HOME/Desktop" \
--maintainer "$USER" --pkgname=x264 --pkgversion "1:0.svn`date +%Y%m%d`-0.0ubuntu1" \
--backup=no --deldoc=yes --deldesc=yes --delspec=yes --gzman --default
$ make distclean

Return here from time to time to update x264 by using the command 'git up' from the source directory. Next to install the Live555 libraries:

Live555

Jaunty ships with quite an old version of the Live555 libraries which are required for some streaming broadcasts. The Ubuntu version in fact dates from July 25th, 2008, so we will install a much newer version:

Code:

$ cd $HOME
$ wget http://www.live555.com/liveMedia/public/live555-latest.tar.gz
$ tar xvf live555-latest.tar.gz
$ cd live
$ ./genMakefiles linux
$ make
$ sudo cp -r $HOME/live /usr/lib

Live555 is updated quite frequently so it may pay to return here from time to time to update. Simply repeat the process after removing the previous libraries at /usr/lib/live.

Next to install the required dev files:

dev ファイル

Ubuntu is not a particularly rich compiling environment so to give MPlayer extra functionality we need to install a truckload of dev files and in fact you will be downloading about 30 megs of files on a fresh system. Load these into a terminal and then make yourself a cup of tea while they are downloading and installing:

Code:

$ sudo apt-get install debhelper em8300-headers gawk gettext html2text \
intltool-debian ladspa-sdk libaa1-dev libasound2-dev libatk1.0-dev libaudio-dev \
libaudio2 libaudiofile-dev libavahi-client-dev libavahi-common-dev libcaca-dev \
libcairo2-dev libcdparanoia-dev libcelt0 libdbus-1-dev libdbus-glib-1-dev libdirectfb-dev \
libdirectfb-extra libdts-dev libdv4-dev libenca-dev libenca0 libesd0-dev libexpat1-dev \
libfaac-dev libfaac0 libffado0 libfontconfig1-dev libfreebob0 libfreetype6-dev \
libfribidi-dev libggi-target-x libggi2 libggi2-dev libggimisc2 libggimisc2-dev \
libgif-dev libgii1 libgii1-dev libgii1-target-x libgl1-mesa-dev libglib2.0-dev \
libglu1-mesa-dev libgtk2.0-dev libice-dev libjack-dev libjack0 libjpeg62-dev \
liblzo-dev liblzo1 liblzo2-2 liblzo2-dev libmad0-dev libmail-sendmail-perl \
libmp3lame-dev libmp3lame0 libmpcdec-dev libmpcdec3 libncurses5-dev libogg-dev \
libopenal-dev libopenal1 libpango1.0-dev libpixman-1-dev libpng12-dev libpopt-dev \
libpthread-stubs0 libpthread-stubs0-dev libpulse-dev libpulse-mainloop-glib0 \
libsdl1.2-dev libslang2-dev libsm-dev libsmbclient-dev libspeex-dev libsvga1 \
libsvga1-dev libsys-hostname-long-perl libsysfs-dev libtheora-dev libtwolame-dev \
libtwolame0 libvorbis-dev libx11-dev libxau-dev libschroedinger-dev libstdc++5  \
libxcb-render-util0-dev libxcb-render0-dev libxcb1-dev libxcomposite-dev \
libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxft-dev \
libxi-dev libxinerama-dev libxml++2.6-2 libxrandr-dev libxrender-dev libxt-dev \
libxv-dev libxvidcore4-dev libxvmc-dev libxxf86dga-dev libxxf86vm-dev mesa-common-dev \
po-debconf sharutils x11proto-composite-dev x11proto-core-dev x11proto-damage-dev \
x11proto-fixes-dev x11proto-input-dev x11proto-kb-dev x11proto-randr-dev \
x11proto-render-dev x11proto-video-dev x11proto-xext-dev x11proto-xf86dga-dev \
x11proto-xf86vidmode-dev x11proto-xinerama-dev xtrans-dev zlib1g-dev \
libamrnb-dev libamrwb-dev libamrnb3 libamrwb3 liboil0.3-dev libcddb2-dev

If you have an appropriate nvidia card, as well as the relevant drivers installed, consider adding the vdpau dev files as well. The required files can be found by running:

Code:

$ apt-cache search nvidia | grep libvdpau

This guide does not deal with vdpau but I note that there are other guides on these forums do. This concludes the preparatory work, now to start installing MPlayer itself:

MPlayerをインストール

実際のMPlayerのインストールには再び以下の手順が必要です:

  1. コーデックのインストール
  2. ソースのフォント
  3. svn mplayerをダウンロードおよびコンパイル

最初のコーデック:

コーデックをインストール

The following commands downloads a codec pack of about 13 megs suitable for 32bit systems, decompresses it and places it in the appropriate location:

Code:

$ cd $HOME
$ wget ftp://ftp.mplayerhq.hu/MPlayer/releases/codecs/all-20071007.tar.bz2
$ sudo mkdir -pv /usr/lib/codecs
$ tar xjvf all-20071007.tar.bz2
$ sudo cp -v $HOME/all-20071007/* /usr/lib/codecs

I am not qualified to comment too much on 64bit systems but I believe that these systems require another set of codecs that can be downloaded here. Unfortunately I know next to nothing about 64bit systems and their requirements but there are some 64bit users following this thread that may be able to help out with any problems.

MPlayer用ソースのフォント:

ソースのフォント

Mplayer needs to know the location of a TrueType Font to show movie subtitles. This can be selected from the commandline but more traditionally a symlink is created to the font of your choice:

Code:

$ mkdir -v $HOME/.mplayer
$ ln -sv /usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf ~/.mplayer/subfont.ttf

Feel free to choose your own font but this will certainly do to start with. Now to download and compile the svn MPlayer:

svn mplayerをダウンロードおよびコンパイル

Finally after all of the preparation it is time to download Mplayer from the subversion repository, compile it and use checkinstall to create a package and install it:

Code:

$ sudo apt-get install subversion
$ cd $HOME
$ svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
$ cd $HOME/mplayer
$ ./configure --confdir=/etc/mplayer
$ make
$ sudo checkinstall -D --install=yes --fstrans=no --pakdir "$HOME/Desktop" \
--pkgname mplayer --backup=no --deldoc=yes --deldesc=yes --delspec=yes --default \
--pkgversion "3:1.0~svn-`grep "#define VERSION" version.h | cut -d"-" -f2`"
$ make distclean

If you wish this installation to register both MPlayer and MEncoder with the Ubuntu package management system consider adding --provides "mplayer,mencoder" to the checkinstall line. Or perhaps you have no interest in MEncoder at all, in which case add --disable-mencoder to your ./configure options. Lots of choices!

And there you have the cutting edge MPlayer. Return here from time to time to update your copy by using the command 'svn update' and then compiling as before. But this is of course the commandline version, next to download the best graphical front-end for MPlayer available today:

SMPlayerをダウンロード

The default gui for MPlayer is known as gmplayer and it has been out of development for some time. Although something of a commandline guy I use SMPLayer in place of gmplayer and I would advise that you do the same. To download from the Ubuntu Repositories simply:

Code:

$ sudo apt-get install smplayer

This will be a download of about 13 megs on a fresh system as there are some QT requirements. The developer of SMPlayer also maintains a Personal Package Archive (PPA) with a newer version of the SMPlayer, details of how to access this can be seen here.

結果.....

そして、正常にsvn MPlayerのインストールが完了! 以下のコマンドで利用可能なオプションを確認できます:

  1. mplayer -vo help : mplayerで利用可能なビデオ出力
  2. mplayer -ao help : mplayerで利用可能なオーディオ出力
  3. mplayer -vc help : 利用可能なビデオコーデック
  4. mplayer -ac help : 利用可能なオーディオコーデック
  5. mencoder -ovc help : 利用可能なビデオコーデック
  6. mencoder-oac help : 利用可能なオーディオコーデック

The commandline player is started with the command 'mplayer' in a Terminal window, the encoder with the command 'mencoder' while the gui SMPlayer should appear on your menu. And remember: "Have fun!".

Andrew Strong
March 31st, 2009

UbuntuJapaneseWiki: UbuntuTips/Application/HowToInstallTheVeryLatestMPlayerUnderJauntyJackalope (最終更新日時 2012-01-10 11:49:09 更新者 匿名)