在Ubuntu下看各种格式的电影──包括RMVB
ubuntu默认有一个movie player,但是那个基本上播放不了什么东东,每次打开多媒体文件总是说寻找什么解码器,找了半天也安装了就是没用。所以还是搞了别的播放器吧。
ubuntu下有很多播放器,但是这里我只推荐两个我认为最好的:
1. MPlayer + SMPlay前端 + 解码器(如果有必要的话)
1.1 首先安装一个mplayer播放器内核
$sudo apt-get install mplayer
如果用新立得安装的话,有时候会顺便安装gmplayer(mplayer-gui)前端,不过这个前端没有smplayer好用,所以推荐还是再安装smplayer。 |
1.2 然后安装一个mplayer前端,这里推荐使用SMPlayer(Install Smplayer (Mplayer Front-end))
Qt Mplayer front-end, with basic features like playing videos, DVDs, and VCDs to more advanced features like support for MPlayer filters and more. One of the most interesting features of SMPlayer: it remembers the settings of all files you play. So you start to watch a movie but you have to leave... don't worry, when you open that movie again it will resume at the same point you left it, and with the same settings: audio track, subtitles, volume...
$sudo apt-get install smplayer
Install smplayer themes using the following command(可选)
$sudo apt-get install smplayer-themes
1.3 安装相应的解码器(一些常用的媒体格式其实已经支持,如果有不支持的格式,请自己下载安装相应的解码器)
下载一个all-20071007.tar.bz2包,他包含所有的解码器。
记得解压,解压后放在/usr/lib/codecs目录下(似乎8.10以前是放在/usr/lib/win32目录下)。
注意将权限设置为普通用户权限。
应该就可以播放了。
如果出现缺少某个dll库文件的,使用ldd查看依赖关系,我的运行后有图像没声音,提示这样的错误:
环境: Ubuntu 8.10
报错信息: could not open required directshow codec drvc.dll
解决步骤:
forrest@forrest:/usr/lib/codecs$ find /usr/lib -name drvc* /usr/lib/codecs/drvc.so forrest@forrest:/usr/lib/codecs$ ldd /usr/lib/codecs/drvc.so linux-gate.so.1 => (0xb7ef7000) libstdc++.so.5 => not found libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7d33000) /lib/ld-linux.so.2 (0xb7ef8000)
这样可以看出, libstdc++.so.5需要安装
# apt-get install libstdc++5
forrest@forrest:/usr/lib/codecs$ sudo apt-get install libstdc++6
Reading package lists... Done
Building state information...Done
libstdc++5 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
可见,版本很重要。
常见问题:
1. 有图像没有声音,报错:could not open/initialize audio device ->no sound
原因:声卡驱动是否选对。首先要知道你本机支持的声卡驱动,然后在MPlayer的Preference->audio中选对相应的驱动即可。
1.1. 查看本机支持的声卡驱动:
点击System-》Preferences-》Sound,弹出Sound Preferences对话框,在Devices选项卡中对所有选项逐一测试支持的声卡。注意默认是autodetect,但是你既然要确定哪个声卡,就必须逐个测速。在我的机器上是如下配置:
Sound Events Sound playback: HDA NVidia AD198x Analog(ALSA) Music and Movies: Sound playback: HDA NVidia AD198x Analog(ALSA) Audio Conferencing: Sound playback: HDA NVidia AD198x Analog(OSS) Sound capture: Test Sound Default Mixer Tracks Device: Analog Devices AD1986A(OSS Mixer) 或HDA NVidia(Alsa mixer)
说明:
ALSA:Advance Linux Sound Architecture
OSS:Open Sound System
2. 有声音没图像
根据错误信息网上查找,一般是某些DLL依赖关系没有安装,还有就是相应的显卡没有选对。多试几次就可以了。
2 使用VLC
VLC多媒体播放器是世界上用户数目第三的的多媒体播放软件。使用Qt4图形库(0.8.6之前的版本使用wxWidgets)。这是一个界面非常简单,功能非常强大的播放器,而且还支持网络视频(IPTV)。而且几乎是零配置。
forrest@ubuntu:~/Desktop$ sudo apt-get install vlc