|
|
发表于 2005-8-5 23:38:00
|
显示全部楼层
Mplayer Pre7 安装终极教程(最终版)
这是我的mplayer屏幕截图(为什么不能直接显示出来呢?! )
是不是这个,哈哈!
so beautiful,the first time i see a multimedia player so pretty in Linux!
虽然我来晚了,大家都走了,也没人回答我的问题,但还是非常谢谢大家的讨论,给了我很多提示和启发,还有智慧。。。我是看着官方文档干的,我总是觉得没人帮我,怎么搞地。。
我来总结一下好了,毕竟还有兄弟会来看着个老帖子,它的精神不变的,可以让他们少走一些弯路。。。。。。。。。。。。
官方文档的第一步是:Installing FFmpeg libavcodec,但是又说了,If you are using an official (pre)release, skip this step, since official
releases include libavcodec. CVS sources and thus CVS snapshots do not include
libavcodec. To verify if you do have libavcodec or not, check if a subdirectory
named 'libavcodec' exists in the MPlayer source tree.
所以,我们不必要,呵呵,过!
第二步就是Installing Binary Codecs,没问题,复制这种安装方式谁都会。
官方文档这样说
The default directory is /usr/local/lib/codecs/ (it used to be
/usr/local/lib/win32 in the past, this also works) but you can change that to
something else by using the '--with-codecsdir=DIR' option when you run
'./configure'.
楼主说的是/usr/lib/codecs,他走了2nd way,然后configure指定,
this also works!我推荐大家按照官方一样,放到默认位置,ok,没问题,继续。。
第三步,Configuring MPlayer,这步好像冒出了一大堆问题。都是由于不满足官方要求,要求如下,挺吓人,不过别怕:
软件要求:
binutils -- 建议版本2.11.x。这个程序负责生成MMX/3DNow!/etc指令,因此十分重要。
gcc -- 建议版本是:2.95.3(或者2.95.4)和3.2+。永远不要使用2.96或者3.0.x! 他们产生错误的MPlayer的代码。如果你决定更换2.96的gcc,那么不要只是因为新而决定采用3.0.x!3.0.x的早期版本甚至比2.96更buggy。 因此不如降级到2.95.x(也把libstdc++降级,其它程序可能需要它)或者根本不升/降级(但这种情况下请对运行时的问题作好准备)。 如果你一定要使用3.x.x请使用最新的版本,早先的发行版本有各种各样的错误,确信你使用的至少是3.1,它通过测试且工作正常。 关于gcc 2.96的bug(仍然没有修正,他们在MPlayer中被绕过!)的详细信息能在这里和FAQ中找到。
XFree86 -- 建议总使用最新版本(4.2.1)。正常来说,每个人会这样做,因为XFree86从4.0.2开始, 它包含了用来使其能够在它支持的卡片上使用硬件YUV加速(快速的图象显示)的XVideo扩展(在某些地方被称作Xv)。
确保也安装了开发包,否则它将不工作。
对于一些视频卡你不需要XFree86。参见下面的列表。
make -- 建议总使用最新版本(至少3.79.x)。这通常不太重要。
SDL -- 它不是必须的,但是在某些情况下(损坏的音频,在xv驱动模式下奇怪地延迟的显卡)能帮助。总使用最新(1.2.x或以上)的。
libjpeg -- 可选的JPEG解码器,用于-mf参数和一些QT MOV文件。如果你计划做jpeg文件的工作那么MPlayer和MEncoder都需要它。
libpng -- 推荐也是默认的( M)PNG译码器。GUI需要它。对MPlayer和MEncoder也有用。
lame -- 推荐,MEncoder需要用它把音频做MP3编码,建议总使用最新版本(3.90或以上)。
libogg -- 可选,用于播放OGG文件格式。
libvorbis -- 可选,用于播放OGG Vorbis音频。
LIVE.COM Streaming Media -- 可选,用于播放RTSP/RTP流。
directfb -- 可选,从http://www.directfb.org获得
cdparanoia -- 可选,用于CDDA支持
libfreetype -- 可选,用于TTF字体支持。至少需要2.0.9以上版本。
libxmms -- 可选, 用于XMMS输入插件的支持。要求至少1.2.7以上版本。
it's so terrible,but in short, it means YOU NEED A VERY NEW SYSTEM, ok? continue......
我们遇到的问题一般都集中在这三个地方:
Requirements:
- You need a working development environment that can compile programs.
On popular Linux distributions, this means having the glibc development
package(s) installed.
- To compile MPlayer with X11 support, you need to have the XFree86 development
packages installed.
- For the GUI you need the libpng and GTK 1.2 development packages.
按要求把package添加上,glibc,libpng,libpng-dev,zlib,
Q:在'make'时,MPlayer报告没有X11库。我不理解,我确实装了X!?
A:...但是你没有装X的开发包。或者没有正确安装。Red Hat下面它叫XFree86-devel*,Debian下面是xlibs-dev。 也检查是否存在/usr/X11和/usr/include/X11的符号链接(在Mandrake系统上可能有这个问题)。 他们用下列命令创建:
$ ln -sf /usr/X11R6 /usr/X11
$ ln -sf /usr/X11R6/include/X11 /usr/include/X11
很多人都遇到GTK缺少的问题,我也是的,后来我找到了它的名字
It's called XFree86-devel* under Red Hat, and xlibs-dev under Debian Woody, libx11-dev under Debian Sarge.
ok,你吩咐,我照办。。。。一切就绪,开始configure,就用楼主这个命令
./configure --enable-gui --with-codecsdir=/usr/lib/codecs --with-win32libdir=/usr/lib/codecs --with-reallibdir=/usr/lib/codecs --with-xanimlibdir=/usr/lib/codecs --disable-inet6 --language=zh_CN
只是我更改了目录为/usr/local/lib/codecs,为了和官方一致!
STEP4: Compiling MPlayer
我就直接用make;make install命令两步合成一步来的,因为我觉得我已经完全满足了所有要求,不可能出问题,呵呵,勇敢。。。
这步注意两个问题:
1.provided that you have write permission in the installation directory.
2.If you get 'unable to load shared library' or similar errors, run
'ldd ./mplayer' to check which libraries fail and go back to STEP 3 to fix it.
Sometimes running 'ldconfig' is enough to fix the problem.
我作好充分心理准备应付第二个问题,不过上天保佑,它没出现,
接下来楼主的这两步
cd etc/
cp codecs.conf gui.conf input.conf sample.conf ~/.mplayer/
mv ~/.mplayer/sample.conf ~/.mplayer/config
我个人就觉得没有必要了,仅仅为了在自己用户目录添加个人设置而已,而我通读官方文档时能清楚的感觉到他们的一个建议,让我们不要去碰默认位置的东西,而且如果用户主目录有配置文件,那么mplayer就会把系统原来默认位置的配置文件完全忽略!
read this paragragh,maybe you can feel what i said :
Check if you have codecs.conf in your home directory (~/.mplayer/codecs.conf) left from old MPlayer versions, and remove it.
Note that if you have a codecs.conf in ~/.mplayer/, the builtin and system codecs.conf will be ignored completely. Do not do this unless you want to fiddle with MPlayer internals as this can can cause many problems.
好了,let it be may be the best way to let your mplayer work properly!ok?
接下来两步简单:
STEP5: Installing the onscreen display fonts
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unpack the archive and choose one of the available font sizes. Then copy the
font files of the corresponding size into /usr/local/share/mplayer/font/ or
~/.mplayer/font/ (or whatever you set with './configure --datadir=DIR').
字体装完后ln -s /usr/share/fonts/zh_CN/TrueType/gbsn001p.ttf subfont.ttf //设置中文字幕字体,
也许大家开始不知道为什么会有这一步,但是当它出错的时候我明白了,mplayer初始化时需要subfont.ttf,楼主将它
联接到另一个地方了,但是我的系统没有这个位置,出错之后我找到了这个地方:/usr/share/fonts/truetype/arphic,
也许是Dedian不一样吧,大家都自己找找。于是我的命令为:
ln -s /usr/share/fonts/truetype/arphic/gbsn001p.ttf subfont.ttf
这个命令是要在用户主目录下的隐藏文件夹.mplayer里执行的,记住哦。
____________________________
STEP6: Installing a GUI skin
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unpack the archive and put the contents in /usr/local/share/mplayer/Skin/ or
~/.mplayer/Skin/. MPlayer will use the skin in the subdirectory named default
of /usr/local/share/mplayer/Skin/ or ~/.mplayer/Skin/ unless told otherwise via
the '-skin' switch. You should therefore rename your skin subdirectory or make
a suitable symbolic link.
解开之后,只有这一个文件夹neutron,原来只给我们提供了一份skin,名字叫neutron,小气!把它改名成default,放到
/usr/local/share/mplayer/Skin/里去,我们只有这一份皮肤,当然只能把它当默认的啦!
最后一步,FINAL STEP:
STEP7: Let's play!
~~~~~~~~~~~~~~~~~~
That's it for the moment. To start playing movies, open a command line and try
mplayer <moviefile>
or for the GUI
gmplayer <moviefile>
gmplayer is a symbolic link to mplayer created by 'make install'.
Without <moviefile>, MPlayer will come up and you will be able to use the GUI
filepicker.
To play a VCD track or a DVD title, try:
mplayer vcd://2 -cdrom-device /dev/hdc
mplayer dvd://1 -alang en -slang hu -dvd-device /dev/hdd
See 'mplayer -help' and 'man mplayer' for further options.
'mplayer -vo help' will show you the available video output drivers. Experiment
with the '-vo' switch to see which one gives you the best performance.
If you get jerky playback or no sound, experiment with the '-ao' switch (see
'-ao help') to choose between different audio drivers. Note that jerky playback
is caused by buggy audio drivers or a slow processor and video card. With a
good audio and video driver combination, one can play DVDs and 720x576 DivX
files smoothly on a Celeron 366. Slower systems may need the '-framedrop'
option.
mplayer是文本界面播放器,gmplayer打开图形界面
OK,到此结束,希望大家都顺利安装 
一味的复制别人的命令是没有用的,因为它不一定适用于你的系统或你的意愿。
多看看官方文档,世上没有两个完全一样的系统,你得自己解决你自己的问题! |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|