Red Hat Linux9.0下的MPlayer媒体播放器

要播放视频和音频必须安装相应的编码器,解压才能播放视频和音频。

Red Hat Linux下安装播放器是怎么样的呢??

一、Red Hat Linux 9.0系统内核版本

二、所需的源码包

(下载的相关包

下载所需的源码包:

一:主应用程序包:在旧版本入口点击,然后选择下载Mplayer-1.0rc2.tar.bz2

Red Hat Linux9.0下的MPlayer媒体播放器
下载二进制编解码器包之二:essential-20071007.tar.bz2

Red Hat Linux9.0下的MPlayer媒体播放器

win32_codes_all二进制编解码器包之三:windows-essential-20071007.zip

Red Hat Linux9.0下的MPlayer媒体播放器

播放器皮肤源码包四:standard-1.9.tar.bz2,把standard(皮肤),把它设置成默认皮肤,可以添加其他的皮肤。

Red Hat Linux9.0下的MPlayer媒体播放器

字体安装包五:gb2312-ming.tar.bz2

[[email protected] root]# cp /mnt/hgfs/linux/MPlayer-1.0rc2.tar.bz2 ./

[[email protected] root]# cp /mnt/hgfs/linux/essential-20071007.tar.bz2 ./

[[email protected] root]# cp /mnt/hgfs/linux/windows-essential-20071007.zip ./

[[email protected] root]# cp /mnt/hgfs/linux/standard-1.9.tar.bz2 ./

[[email protected] root]# cp /mnt/hgfs/linux/gb2312-ming.tar.bz2 ./

 (安装MPlayer

1.安装主程序

[[email protected] root]# tar -xjvf MPlayer-1.0rc2.tar.bz2

[[email protected] root]# cd MPlayer-1.0rc2

[[email protected] MPlayer-1.0rc2]# ./configure --prefix=/usr/local/mplayer/ --enable-gui --enable-freetype --codecsdir=/usr/lib/codecs/ --win32codecsdir=/usr/lib/wincodecs/ --language=zh_CN

[[email protected] MPlayer-1.0rc2]# make

[[email protected] MPlayer-1.0rc2]# make install

说明:
   --prefix=/usr/local/mplayer 
是安装路径
   --enable-gui 
安装图形界面
   --enable-freetype 
校正字体
   --codecsdir=/usr/lib/codecs 
指定编码位置
   --win32codecsdir=/usr/lib/wincodecs 
指定编码位置
   --language=zh_CN 
中文界面

()安装codec

[[email protected] root]# tar -xjvf essential-20071007.tar.bz2

[[email protected] root]# mv essential-20071007 /usr/lib/codecs

[[email protected] root]# unzip windows-essential-20071007.zip

[[email protected] root]# mv windows-essential-20071007 /usr/lib/wincodecs

(安装字体、皮肤等用于美化界面

安装字体:

[[email protected] root]# mkdir /usr/local/mplayer/share/mplayer/font/

[[email protected] root]# tar -xjvf gb2312-ming.tar.bz2

[[email protected] root]# cd gb2312-ming/gbsn00lp16/

[[email protected] gbsn00lp16]# cp * /usr/local/mplayer/share/mplayer/font/

安装皮肤:

[[email protected] root]# tar -xjvf standard-1.9.tar.bz2

[[email protected] root]# mv standard /usr/local/mplayer/share/mplayer/skins/default

 

()桌面启动/创建启动器

名称: MPlayer

命令:  /usr/local/mplayer/bin/gmplayer

然后选择一个你喜欢的图标.

也可以在终端用/usr/local/mplayer/bin/gmplayer 启动.

Red Hat Linux9.0下的MPlayer媒体播放器
 (故障分析及其解决

安装MPlayer,执行make是出现下面的错误:

In file included from /usr/include/netdb.h:28,

                 from network.h:16,

                 from stream.h:65,

                 from stream_dvd.c:32:

/usr/include/netinet/in.h:259: parse error before '(' token

/usr/include/netinet/in.h:259: parse error before "__u32"

/usr/include/netinet/in.h:260: parse error before '(' token

/usr/include/netinet/in.h:260: parse error before "__u16"

/usr/include/netinet/in.h:262: parse error before '(' token

/usr/include/netinet/in.h:262: parse error before "__u32"

/usr/include/netinet/in.h:264: parse error before '(' token

/usr/include/netinet/in.h:264: parse error before "__u16"

stream_dvd.c: In function `dvd_parse_chapter_range':

stream_dvd.c:168: warning: passing arg 2 of `strtol' from incompatible pointer type

make[1]: *** [stream_dvd.o] Error 1

make[1]: Leaving directory `/root/MPlayer-1.0rc2/stream'

make: *** [stream/stream.a] Error 2

Red Hat Linux9.0下的MPlayer媒体播放器
编辑/usr/include/netinet/in.h文件

[[email protected] MPlayer-1.0rc2]# vi /usr/include/netinet/in.h

__BEGIN_DECLS下面添加如下代码:                                                                            

#undef ntohl

#undef ntohs

#undef htonl

#undef htons

执行make clean,再执行make,就可以了

二:解决字体问题

[GUI] 导入字幕: /mnt/hgfs/linux/91.wmv7%

SUB: Detected subtitle file format: rt

SUB: Read 0 subtitles.

不能加载字幕: /mnt/hgfs/linux/91.wmv

1: 打开字体文件

[[email protected] TrueType]#cd /usr/share/fonts/zh_CN/TrueType

[[email protected] TrueType]# pwd

/usr/share/fonts/zh_CN/TrueType

fonts.cache-1  fonts.dir  fonts.scale  gbsn00lp.ttf  gkai00mp.ttf  zysong.ttf

2: 打开主目录下的隐藏目录

[[email protected] root]# cd .mplayer/

[[email protected] .mplayer]# pwd

/root/.mplayer

config  gui.conf  gui.history  gui.pl  gui.url

3: 将任意一种字体cp./mplayer目录下即可

[[email protected] .mplayer]# cp /usr/share/fonts/zh_CN/TrueType/gbsn00lp.ttf ./subfont.ttf (改成这样的字体文件)

三.打开/初始化(ro)所选的视频输出设备出错

修复:左健点击播放器左下方板手形状的按钮,进入首选项对话框:
将可用驱动:
xv             X11/V
x11            X11(XImage/Shm)
默认是选择第一项,修改为选择第二项就可以了,即红色的一行。
点击超酷看,成功进入播放画面,见默认播放画面截图。
注意:在选择播放文件时候,要选择All file.
五。:上述显示还未能全屏播放电影。只需做个小小的改动就可以全屏看电影了。
如下:
   vi ~./mplayer/config
   zoom=yes
加上这一行即可。
Red Hat Linux9.0下的MPlayer媒体播放器









本文转自 chen138 51CTO博客,原文链接:http://blog.51cto.com/chenboqiang/484936,如需转载请自行联系原作者