Chinaunix首页 | 论坛 | 博客
  • 博客访问: 103683271
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类: LINUX

2008-04-07 16:20:56

作者: Completely 出自:
mplayer 是linux下非常出名的多媒体播放软件,支持非常广泛的影音格式,当然也可以下载更多解码器。

mplayer 的使用也很容易,在终端里运行“mplayer <电影或歌曲文件>”就开始播放了,然后可以用左/右方向箭头后退/前进十秒,上/下方向后退/前进一分钟,PgUp/PgDn后退/前进10分钟,“<”和“>”控制播放列表上一个/下一个,p或空格暂停/任意键继续播放,q或ESC停止退出,+/-小调整音量,o循环模式,*或者/增加或减小PCM音量,x/z调整延时,r/t调整标题位置……

记不住也没关系,可以安装mplayer-gui,这样就能通过窗口对播放进行控制了。

安装mplayer(使用root帐户)
# yum install mplayer

再安装mplayer-gui
# yum install mplayer

MPlayer 官方网站:

下面是终端演示:

[Bob@localhost ~]$ su
口令:
[root@localhost Bob]# yum install mplayer
livna 100% |=========================| 2.1 kB 00:00
primary.sqlite.bz2 100% |=========================| 301 kB 00:14
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
–> Running transaction check
—> Package mplayer.i386 0:1.0-0.90.rc2.lvn8 set to be updated
[root@localhost Bob]# yum install mplayer
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
–> Running transaction check
—> Package mplayer.i386 0:1.0-0.90.rc2.lvn8 set to be updated
–> Processing Dependency: libcucul.so.0 for package: mplayer
–> Processing Dependency: liblzo2.so.2 for package: mplayer
–> Processing Dependency: libfribidi.so.0 for package: mplayer
–> Processing Dependency: liblirc_client.so.0 for package: mplayer
–> Processing Dependency: libdvdread.so.3 for package: mplayer
–> Processing Dependency: libdvdnavmini.so.4 for package: mplayer
–> Processing Dependency: libpulse.so.0(PULSE_0) for package: mplayer
–> Processing Dependency: libmpcdec.so.5 for package: mplayer
–> Processing Dependency: libenca.so.0 for package: mplayer
–> Processing Dependency: libcaca.so.0 for package: mplayer
–> Processing Dependency: libfaad.so.0 for package: mplayer
–> Processing Dependency: libxvidcore.so.4 for package: mplayer
–> Processing Dependency: libdca.so.0 for package: mplayer
–> Processing Dependency: libaa.so.1 for package: mplayer
–> Running transaction check
–> Processing Dependency: pulseaudio-libs = 0.9.7-0.17.svn20071017.fc8 for package: pulseaudio-utils
—> Package faad2.i386 1:2.0-21.20050131.lvn8 set to be updated
—> Package libmpcdec.i386 0:1.2.6-3.fc8 set to be updated
—> Package libcaca.i386 0:0.99-0.3.beta11.fc8 set to be updated
—> Package aalib.i386 0:1.4.0-0.13.rc5.fc8 set to be updated
—> Package fribidi.i386 0:0.10.9-2.fc8 set to be updated
—> Package xvidcore.i386 0:1.1.3-1.lvn8 set to be updated
—> Package enca.i386 0:1.9-3.fc6 set to be updated
—> Package pulseaudio-libs.i386 0:0.9.8-5.fc8 set to be updated
—> Package lzo.i386 0:2.02-3.fc8 set to be updated
—> Package libdvdnav.i386 0:4.1.1-3.fc8 set to be updated
—> Package libdvdread.i386 0:0.9.7-4.fc8 set to be updated
—> Package libdca.i386 0:0.0.5-2.lvn8 set to be updated
—> Package lirc.i386 0:0.8.2-2.fc8 set to be updated
–> Running transaction check
—> Package pulseaudio-utils.i386 0:0.9.8-5.fc8 set to be updated
–> Finished Dependency Resolution

Dependencies Resolved

==============
Package Arch Version Repository Size
====================
Installing:
mplayer i386 1.0-0.90.rc2.lvn8 livna 4.2 M
Installing for dependencies:
aalib i386 1.4.0-0.13.rc5.fc8 fedora 75 k
enca i386 1.9-3.fc6 fedora 118 k
faad2 i386 1:2.0-21.20050131.lvn8 livna 210 k
fribidi i386 0.10.9-2.fc8 fedora 54 k
libcaca i386 0.99-0.3.beta11.fc8 fedora 160 k
libdca i386 0.0.5-2.lvn8 livna 108 k
libdvdnav i386 4.1.1-3.fc8 updates 84 k
libdvdread i386 0.9.7-4.fc8 updates 66 k
libmpcdec i386 1.2.6-3.fc8 fedora 27 k
lirc i386 0.8.2-2.fc8 fedora 254 k
lzo i386 2.02-3.fc8 fedora 62 k
xvidcore i386 1.1.3-1.lvn8 livna 240 k
Updating for dependencies:
pulseaudio-libs i386 0.9.8-5.fc8 updates 134 k
pulseaudio-utils i386 0.9.8-5.fc8 updates 112 k

Transaction Summary
=========================
Install 13 Package(s)
Update 2 Package(s)
Remove 0 Package(s)

Total download size: 5.8 M
Is this ok [y/N]: y
Downloading Packages:
(1/15): lirc-0.8.2-2.fc8. 100% |=========================| 254 kB 00:01
(2/15): libdca-0.0.5-2.lv 100% |=========================| 108 kB 00:03
(3/15): libdvdread-0.9.7- 100% |=========================| 66 kB 00:02
(4/15): libdvdnav-4.1.1-3 100% |=========================| 84 kB 00:07
(5/15): lzo-2.02-3.fc8.i3 100% |=========================| 62 kB 00:00
(6/15): pulseaudio-libs-0 100% |=========================| 134 kB 00:11
(7/15): enca-1.9-3.fc6.i3 100% |=========================| 118 kB 00:01
(8/15): mplayer-1.0-0.90. 100% |=========================| 4.2 MB 03:52
(9/15): xvidcore-1.1.3-1. 100% |=========================| 240 kB 00:15
(10/15): fribidi-0.10.9-2 100% |=========================| 54 kB 00:00
(11/15): aalib-1.4.0-0.13 100% |=========================| 75 kB 00:01
(12/15): libcaca-0.99-0.3 100% |=========================| 160 kB 00:01
(13/15): libmpcdec-1.2.6- 100% |=========================| 27 kB 00:00
(14/15): pulseaudio-utils 100% |=========================| 112 kB 00:03
(15/15): faad2-2.0-21.200 100% |=========================| 210 kB 00:04
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID a109b1ec
Importing GPG key 0xA109B1EC “Livna.org rpms <>” from /etc/pki/rpm-gpg/RPM-GPG-KEY-livna
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Updating : pulseaudio-libs ####################### [ 1/17]
Installing: libdvdread ####################### [ 2/17]
Installing: libdvdnav ####################### [ 3/17]
Installing: lirc ####################### [ 4/17]
Installing: libdca ####################### [ 5/17]
Installing: lzo ####################### [ 6/17]
Installing: enca ####################### [ 7/17]
Installing: xvidcore ####################### [ 8/17]
Installing: fribidi ####################### [ 9/17]
Installing: aalib ####################### [10/17]
Installing: libcaca ####################### [11/17]
Installing: libmpcdec ####################### [12/17]
Installing: faad2 ####################### [13/17]
Updating : pulseaudio-utils ####################### [14/17]
Installing: mplayer ####################### [15/17]
Cleanup : pulseaudio-utils ####################### [16/17]
Cleanup : pulseaudio-libs ####################### [17/17]

Installed: mplayer.i386 0:1.0-0.90.rc2.lvn8
Dependency Installed: aalib.i386 0:1.4.0-0.13.rc5.fc8 enca.i386 0:1.9-3.fc6 faad2.i386 1:2.0-21.20050131.lvn8 fribidi.i386 0:0.10.9-2.fc8 libcaca.i386 0:0.99-0.3.beta11.fc8 libdca.i386 0:0.0.5-2.lvn8 libdvdnav.i386 0:4.1.1-3.fc8 libdvdread.i386 0:0.9.7-4.fc8 libmpcdec.i386 0:1.2.6-3.fc8 lirc.i386 0:0.8.2-2.fc8 lzo.i386 0:2.02-3.fc8 xvidcore.i386 0:1.1.3-1.lvn8
Dependency Updated: pulseaudio-libs.i386 0:0.9.8-5.fc8 pulseaudio-utils.i386 0:0.9.8-5.fc8
Complete!
[root@localhost Bob]# yum install mplayer-gui
updates 100% |=========================| 2.3 kB 00:00
fedora 100% |=========================| 2.1 kB 00:00
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
–> Running transaction check
—> Package mplayer-gui.i386 0:1.0-0.90.rc2.lvn8 set to be updated
–> Finished Dependency Resolution

Dependencies Resolved

=====================
Package Arch Version Repository Size
=====================
Installing:
mplayer-gui i386 1.0-0.90.rc2.lvn8 livna 3.5 M

Transaction Summary
=================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Total download size: 3.5 M
Is this ok [y/N]: y
Downloading Packages:
(1/1): mplayer-gui-1.0-0. 100% |=========================| 3.5 MB 03:26
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: mplayer-gui ######################### [1/1]

Installed: mplayer-gui.i386 0:1.0-0.90.rc2.lvn8
Complete!
[root@localhost Bob]#

安装完成,执行GNOME的“应用程序” ->“影音”->“MPlayer”

安装解码器:

解码器是播放软件的核心,首先从官方下载到最新的解码包(注意选择与你系统相应的,点这里查看所有解码包)。

有很多,挑最新的下载(下面是我需要的):





参考:解码器对照表

将上面的三个包解压出来,放入对应的目录即可。
放在哪里呢,很简单,你用MPlayer播放一个没有解码器的影音文件,如RMVB格式的。

[root@localhost ~]# mplayer ‘/media/P_FREE/影片/1.rmvb’
MPlayer SVN-r24056 (C) 2000-2007 MPlayer Team
CPU: Intel(R) Celeron(R) CPU 2.40GHz (Family: 15, Model: 4, Stepping: 1)
CPUflags: MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 SSE SSE2

Playing /media/P_FREE/影片/1.rmvb.
REAL file format detected.
Stream description: Video Stream
Stream mimetype: video/x-pn-realvideo
[real] Video stream found, -vid 0
Stream description: Audio Stream
Stream mimetype: audio/x-pn-realaudio
[real] Audio stream found, -aid 1
Stream mimetype: logical-fileinfo
VIDEO: [RV40] 704×288 24bpp 23.000 fps 0.0 kbps ( 0.0 kbyte/s)
Clip info:
name: pmcg-tw-cd1
comment:
================
Opening video decoder: [realvid] RealVideo decoder
Error: /usr/local/lib/codecs/drvc.so: cannot open shared object file: No such file or directory
Win32 LoadLibrary failed to load: drvc.so, /usr/local/lib/codecs/drvc.so, /usr/lib/win32/drvc.so, /usr/local/lib/win32/drvc.so
Error loading dll
ERROR: Could not open required DirectShow codec drvc.so.
Read the RealVideo section of the DOCS!
VDecoder init failed
Opening video decoder: [realvid] RealVideo decoder
Win32 LoadLibrary failed to load: drvc.dll, /usr/local/lib/codecs/drvc.dll, /usr/lib/win32/drvc.dll, /usr/local/lib/win32/drvc.dll
Error loading dll
ERROR: Could not open required DirectShow codec drvc.dll.
Read the RealVideo section of the DOCS!
VDecoder init failed
Opening video decoder: [realvid] RealVideo decoder
Error: /usr/local/lib/codecs/drv4.so.6.0: cannot open shared object file: No such file or directory
Win32 LoadLibrary failed to load: drv4.so.6.0, /usr/local/lib/codecs/drv4.so.6.0, /usr/lib/win32/drv4.so.6.0, /usr/local/lib/win32/drv4.so.6.0
Error loading dll
ERROR: Could not open required DirectShow codec drv4.so.6.0.
Read the RealVideo section of the DOCS!
VDecoder init failed
Opening video decoder: [realvid] RealVideo decoder
Win32 LoadLibrary failed to load: drv43260.dll, /usr/local/lib/codecs/drv43260.dll, /usr/lib/win32/drv43260.dll, /usr/local/lib/win32/drv43260.dll
Error loading dll
ERROR: Could not open required DirectShow codec drv43260.dll.
Read the RealVideo section of the DOCS!
VDecoder init failed
Opening video decoder: [realvid] RealVideo decoder
Error: /usr/local/lib/codecs/drvc.bundle/Contents/MacOS/drvc: cannot open shared object file: No such file or directory
Win32 LoadLibrary failed to load: drvc.bundle/Contents/MacOS/drvc, /usr/local/lib/codecs/drvc.bundle/Contents/MacOS/drvc, /usr/lib/win32/drvc.bundle/Contents/MacOS/drvc, /usr/local/lib/win32/drvc.bundle/Contents/MacOS/drvc
Error loading dll
ERROR: Could not open required DirectShow codec drvc.bundle/Contents/MacOS/drvc.
Read the RealVideo section of the DOCS!
VDecoder init failed
Cannot find codec matching selected -vo and video format 0×30345652.
Read DOCS/HTML/en/codecs.html!
=========================
======================
Opening audio decoder: [faad] AAC (MPEG2/4 Advanced Audio Coding)
FAAD: compressed input bitrate missing, assuming 128kbit/s!
AUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)
Selected audio codec: [faad] afm: faad (FAAD AAC (MPEG-2/MPEG-4 Audio) decoder)
=====================
AO: [oss] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback…
A: 87.5 (01:27.5) of 2938.0 (48:58.0) 2.0%
Exiting… (Quit)
[root@localhost ~]#

看看上面被我加粗的文字,就知道你缺少什么解码而且应该放在什么目录里面,很容易的。

看到了吧,我只要把 all-20071007.tar.bz2 全部文件解压到 /usr/local/lib/codecs
把 windows-all-20071007.zip 全部文件解压到 /usr/local/lib/win32 就OK了。

接下来就是调整播放器窗口字体和皮肤,无关紧要,就不写出来了。

在我这里mplayer-gui会出现一些问题,如果你和我一样:

1.unable to find simple control ‘PCM’ ,0
右击MPlayer-GUI的播放控制窗口,选择 Preferences(属性),会看见个提示,告诉你所有的设置更改会在重启后生效。不必管它,OK,选择Audio(音频)页。

在可用的驱动列表里选择正确的音频驱动,网上很多人选择pulse。

OK后,重新启动Mplayer-gui,新问题又出现了,接着往下看。

2.Could not open required directshow codec drvc.dll

这个问题的解决办法是从http://blog.zhangjianfeng.com/article/704找到的。按照他的方法,的确没提示“libstdc++.so.5 => not found”,如下:

[root@localhost ~]# ldd /usr/lib/codecs/drvc.so
linux-gate.so.1 => (0×00110000)
libstdc++.so.5 => not found
libc.so.6 => /lib/libc.so.6 (0×001b2000)
/lib/ld-linux.so.2 (0×00144000)

解决方法很简单,安装它。
网上有教你怎么从FC安装光盘里找出这个安装包,为了方便,你也可从这里下载,这是FC4的RPM安装包,安装后即可解决问题。

compat-libstdc++-33-3.2.3-47.3.i386.rpm

安装后你可以再次用命令瞧瞧:

[root@localhost ~]# ldd /usr/lib/codecs/drvc.so
linux-gate.so.1 => (0×00110000)
libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0×001b2000)
libc.so.6 => /lib/libc.so.6 (0×0026b000)
libm.so.6 => /lib/libm.so.6 (0×00111000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0×003c4000)
/lib/ld-linux.so.2 (0×00144000)
[root@localhost ~]#

现在MPlayer能正常使用了,在你常用的影视文件上点击右键->属性,在“打开方式”里选中“MPlayer”。
阅读(805) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~