« 2008年12月 | トップページ | 2009年2月 »

2009年1月

MPlayer とGUI

Linuxの動画プレーヤーとしてはXine、Totem、MPlayer等が有名で、中でも人気の高いMPlayerにはGUIが付属したGmplayerとコマンド操作のMPlayerがあります。

MPlayer標準のconfigureファイルは

Optional features:
  --disable-mencoder     disable MEncoder (A/V encoder) compilation [enable]
  --disable-mplayer        disable MPlayer compilation [enable]
  --enable-gui                enable GMPlayer compilation (GTK+ GUI) [disable]
  --enable-gtk1              force using GTK 1.2 for the GUI  [disable]
  --disable-largefiles       disable support for files > 2GB [enable]

このようにGUIがデフォルトでdisableになっているので、Gmplayerをビルドするには --enable-gui をつける必要がありますが、デフォルトは熟慮された理由があり実はGUIなしの方が動画・音楽再生には(操作性/システム負荷等)メリットが多いからです。
操作や設定はmanやhelpにありますので、拡張子とファイルマネージャの関連付けを以下に記載します。

・nautilusの場合
次の内容で /usr/share/applications/mplayer.desktopを作成

[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=MPlayer
GenericName=Multimedia player
Comment=Multimedia player
Icon=mplayer.xpm
TryExec=mplayer -idx
Exec=mplayer -idx
Terminal=true
NoDisplay=false
Categories=GTK;Application;AudioVideo;Audio;Video;Player;TV;
MimeType=application/ogg;application/x-ogg;application/sdp;application/smil;application/x-smil;application/streamingmedia;application/x-streamingmedia;application/vnd.rn-realmedia;application/vnd.rn-realmedia-vbr;audio/aac;audio/x-aac;audio/m4a;audio/x-m4a;audio/mp1;audio/x-mp1;audio/mp2;audio/x-mp2;audio/mp3;audio/x-mp3;audio/mpeg;audio/x-mpeg;audio/mpegurl;audio/x-mpegurl;audio/mpg;audio/x-mpg;audio/rn-mpeg;audio/scpls;audio/x-scpls;audio/vnd.rn-realaudio;audio/wav;audio/x-pn-windows-pcm;audio/x-realaudio;audio/x-pn-realaudio;audio/x-ms-wma;audio/x-pls;audio/x-wav;video/mpeg;video/x-mpeg;video/x-mpeg2;video/msvideo;video/x-msvideo;video/quicktime;video/vnd.rn-realvideo;video/x-ms-afs;video/x-ms-asf;video/x-ms-wmv;video/x-ms-wmx;video/x-ms-wvxvideo;video/x-avi;video/x-fli;video/x-theora;video/x-matroska;
※この設定で、ファイルクリック後システム標準のコンソール経由でmplayerの再生開始

・PCManfmの場合
次の内容で ~/.local/share/applications/xtermを作成

[Desktop Entry]
Encoding=UTF-8
Name=xterm
Exec=xterm -e mplayer -idx %F
MimeType=application/ogg;application/x-ogg;application/sdp;application/smil;application/x-smil;application/streamingmedia;application/x-streamingmedia;application/vnd.rn-realmedia;application/vnd.rn-realmedia-vbr;audio/aac;audio/x-aac;audio/m4a;audio/x-m4a;audio/mp1;audio/x-mp1;audio/mp2;audio/x-mp2;audio/mp3;audio/x-mp3;audio/mpeg;audio/x-mpeg;audio/mpegurl;audio/x-mpegurl;audio/mpg;audio/x-mpg;audio/rn-mpeg;audio/scpls;audio/x-scpls;audio/vnd.rn-realaudio;audio/wav;audio/x-pn-windows-pcm;audio/x-realaudio;audio/x-pn-realaudio;audio/x-ms-wma;audio/x-pls;audio/x-wav;video/mpeg;video/x-mpeg;video/x-mpeg2;video/msvideo;video/x-msvideo;video/quicktime;video/vnd.rn-realvideo;video/x-ms-afs;video/x-ms-asf;video/x-ms-wmv;video/x-ms-wmx;video/x-ms-wvxvideo;video/x-avi;video/x-fli;video/x-theora;video/x-matroska;video/x-ogm+ogg;
Icon=exec
NoDisplay=true
※この設定で、ファイルクリック後xterm経由でmplayerの再生開始

もちろん上記以外にも色々な組合せで動作させることが可能です。

| | コメント (0)

デスクトップ Linuxの軽量化

デスクトップ環境軽量化に興味がある方が多いようですので今回はコレがテーマです。
以下はFedoraやCentOS等のRedhat系に関して記載しています。

1)リモートデスクトップの必要性がない限りxfsを使用しない

2)一般的なデスクトップ用途で最低限必要なサービス(常駐アプリ)は
・hal(haldaemon)
・dbus(messagebus)
・network
の3つだけ
※用途によりさらに停止することも可能

3)ウインドウマネージャはGNOMEやKDEではなく、fluxboxやJWM等の軽いものを使用

4)ipv6やSELinuxは使わない

5)メモリ増設しswapは使わない(詳細は以前の記事

6)3Dを使わなくてもビデオドライバはDRIを有効にしておく(特にintel系)

7)ランレベル5のxdm(gdm、kdm)ではなく、ランレベル3のstartxでデスクトップを起動する

8)使用中のビデオドライバが、16ビットor24ビットのどちらでの描画が高速であるかテストしてみる
※画像をシビアに利用する環境においては24ビット以上にすべきですが

9)HDDが遅い場合
・シリアルATAなのにIDE互換モードになっている時はinitrdを再作成(詳細は以前の記事
・パラレルATAは最低限DMAを有効にする(通常は自動設定されている)
・フォーマットはLVMではなくシンプルなEXT2を推奨します
※必要なければ、mdadm、dmraid、lvm、quotaを削除

10)コンパイル可能な方は
xorg、mesa、ウインドウマネージャ、freetype、gtk2等の各パッケージをCPU最適化リビルドし入替え
※一般的にソースサイズと最適化の恩恵は比例します

如何でしょう、
全部実行すると体感的にも爆速になると思われます。

※この記事はアクセスが多いため加筆修正し再掲したものです。

| | コメント (0)

« 2008年12月 | トップページ | 2009年2月 »