LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1100|回复: 5

Mplayer如何挂载字幕, 播放时有时无声以及mplayer稳定性的困惑[已基本解决,谢谢大家

[复制链接]
发表于 2007-4-16 13:21:11 | 显示全部楼层 |阅读模式
我的系统是Debian 4 r0 ,内核2.6.18-4-686,我按照http://www.princessleia.com/MPlayer.php
的方法安装的Mplayer,但我下载的包是MPlayer-1.0rc1.tar.bz2, 具体操作如下:

Files to download
Source:

MPlayer v1.0pre8 source - 7.8M - You may download directly from the Mplayer HQ Download)
(unless you have a src file of your own you wish to use)
Codecs:

essential-YYYYMMDD.tar.bz2 - Grab the latest version "essential codecs package" from Mplayer HQ Download

live555-latest.tar.gz - about 400 K (live555.com download)
User Conf:

mplayer-user-conf.tar - 690 k ( mirror2)

Since I don't know where you are downloading these to, you will just need to move them to the proper place when I ask you to unpack them.
Uninstalling Old Version

If you have an older version of mplayer on your system remove all traces of it (if you used a deb do dpkg -P mplayer then go through your system and make sure EVERYTHING for mplayer is gone, some things will not be removed with dpkg -P). This step is VERY important.
Things from apt

as root:

apt-get install libogg0 libogg-dev libvorbis0a libvorbis-dev vorbis-tools libpng12-0 libpng12-dev liblogfile-rotate-perl libconfhelper-perl debhelper fakeroot g++ libgtk1.2 libgtk1.2-dev svgalibg1 svgalibg1-dev libsdl1.2-dev libaa1 libaa1-dev x11proto-gl-dev

NOTE: Make sure your gcc and g++ versions match!
Installing the Codecs

as root:

rm -r /usr/lib/win32

(If it exists. These are the w32 codecs, don't worry, we will replace these later, you can pack them up and move them if you are really concerned about losing them)

tar -jxvf essential-YYYYMMDD.tar.bz2

mv essential-YYYYMMDD/ /usr/lib/win32

Live.com Codecs (for streaming realplayer)

cd /usr/local/lib/

rm -r live/

(If it exists. These are the old live.com codecs, don't worry, we will replace these later, you can pack them up and move them if you are really concerned about losing them)

tar -xvvzf live555-latest.tar.gz

cd live/

./genMakefiles linux

make
Setting up the ~/.mplayer directory

(you can skip this if you have your own configs and settings, and/or don't want to use gmplayer)

become your user

cd

tar -xvvf mplayer-user-conf.tar

this will create the ~/.mplayer directory including a skin (neutron), arial size 18 font, and config file

in line 27 of the ~/.mplayer/gui.conf file, change: font_name = "/home/lyz/.mplayer/font/font.desc" to reflect your username (I havent found a way around this step, ~ doesn't work).
Creating the .deb and installing mplayer

as root:

cd /usr/src/mplayer/

tar -jxvvf MPlayerVersion.tar.bz2 (where 'Version' is your version, ie -1.0pre7)

cd MPlayerVersion

DEB_BUILD_OPTIONS="--disable-runtime-cpudetection --disable-rtc --enable-live --with-livelibdir=/usr/local/lib/live" fakeroot debian/rules binary

Make sure there aren't spaces between -- and any-of-the-options

when it's finished compiling, it will create an mplayerVersion.deb file in /usr/src/mplayer

cd /usr/src/mplayer/

dpkg -i mplayerVersion.deb

when it asks about video output choose which is right for you, if unsure just use xv

昨天晚上11点多我刚装好,我试着播放了一下,但打不开而且提示一大堆的错误,由于错误太多,我准备有时间在一个个解决,但今天早上我再次打开时,我发现竟然可以用了,mplayer不会这么不稳定吧?只是提示找不到声卡或是声卡忙(我装了xmms能正常播放音乐),但没有声音,于是我用mplayer -ao help列出所有的声音模式,然后逐个尝试,但都不行,我的声卡是Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) High Definition Audio Controller,(电脑是华硕A3H),所以我准备先查查资料再来处理这个问题。
刚才我又试着用Mplayer 播放一下,竟然avi,rmvb格式的文件都能播放了,我今天并没对系统作什么修改,上边的问题请问是什么原因呢?






还有就是对于avi格式的文件如何挂载字幕文件呢?我用上边提到的方式装的mplayer虽然能挂载字幕文件,视频和字幕文件分别为nedivx-cr-cd1.chs.avi和nedivx-cr-cd1.chs.srt,但全部是乱码,终端输出的信息如下:

MPlayer 1.0rc1-4.1.2 (C) 2000-2006 MPlayer Team
CPU: Intel(R) Celeron(R) M processor         1.50GHz (Family: 6, Model: 13, Stepping: 8)
CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 SSE SSE2
/usr/share/fonts/truetype/ttf-bitstream-vera/VeraMoBI.ttf doesn't look like a bitmap font description, ignoring.
Cannot load bitmap font: /usr/share/fonts/truetype/ttf-bitstream-vera/VeraMoBI.ttf

Playing nedivx-cr-cd1.chs.avi.
AVI file format detected.
VIDEO:  [XVID]  640x320  24bpp  25.000 fps  1438.2 kbps (175.6 kbyte/s)
SUB: Detected subtitle file format: subviewer
SUB: Read 419 subtitles.
SUB: Added subtitle file (1): ./nedivx-cr-cd1.chs.srt
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
==========================================================================
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
AUDIO: 48000 Hz, 2 ch, s16le, 128.0 kbit/8.33% (ratio: 16000->192000)
Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================
AO: [oss] 48000Hz 2ch s16le (2 bytes per sample)
Starting playback...
VDec: vo config request - 640 x 320 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 2.00:1 - prescaling to correct movie aspect.
VO: [x11] 640x320 => 640x320 Planar YV12
SwScaler: using unscaled yuv420p -> rgb32 special converter
Selected font is fixed-width. ct:  0.000   1/  1 ??% ??% ??,?% 0 0
A:   1.4 V:   1.3 A-V:  0.034 ct:  0.015  34/ 34 10% 28%  0.7% 0 0
Subtitle word '本字幕仅供学习交流,严禁用于商业用途' too long!
A:   2.8 V:   2.8 A-V: -0.009 ct:  0.015  70/ 70  8% 27%  0.6% 0 0

我的locale是这样的:

LANG=zh_CN
LC_CTYPE="zh_CN"
LC_NUMERIC="zh_CN"
LC_TIME="zh_CN"
LC_COLLATE="zh_CN"
LC_MONETARY="zh_CN"
LC_MESSAGES="zh_CN"
LC_PAPER="zh_CN"
LC_NAME="zh_CN"
LC_ADDRESS="zh_CN"
LC_TELEPHONE="zh_CN"
LC_MEASUREMENT="zh_CN"
LC_IDENTIFICATION="zh_CN"
LC_ALL=
我的~/.mplayer/gui.conf文件中font_name= "/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf"但出错提示的是
/usr/share/fonts/truetype/ttf-bitstream-vera/VeraMoBI.ttf doesn't look like a bitmap font description, ignoring.
Cannot load bitmap font: /usr/share/fonts/truetype/ttf-bitstream-vera/VeraMoBI.ttf
如果~/.mplayer/gui.conf不是启动的配置文件,那么启动mplayer时的配置文件在哪儿呢?
这是我以前用apt-get install mplayer时残留的文件吗?但我已经用apt-get remove --purge mplayer移除了呀.
这个字体的问题与挂载字幕有关吗?




最后一个问题比较奇怪,就是我的声卡能发声,但我接上耳塞就听不到声音,我在xp下接上耳塞是可以的,我的耳塞是SONY MDR-Q55。麻烦大家帮我看看这几个问题,谢谢。
 楼主| 发表于 2007-4-16 14:16:00 | 显示全部楼层
麻烦大家帮忙看看啊,我曾经安装过xine,但界面总是只闪一下就不见了,现在好不容易装上mplayer,但还差这最后一个问题没解决了。
回复 支持 反对

使用道具 举报

发表于 2007-4-16 14:24:02 | 显示全部楼层
耳塞的问题,你可以运行alsamixer看看耳机音量打开了没有
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-4-16 14:58:57 | 显示全部楼层
谢谢zealoghu,我刚才运行alsamixer看了,声音都打开了,但还是没声音。
回复 支持 反对

使用道具 举报

发表于 2007-4-16 19:19:19 | 显示全部楼层
字体不行,换个中文字体
声音还和是否运行esd等有关
发个我用的config参考一下,因为很少用gmplayer,gui.conf就不贴了

  1. # Write your default config options here!
  2. vo=gl
  3. unicode=yes
  4. ao=alsa
  5. subcp=cp936
  6. font=/usr/share/fonts/truetype/simyou.ttf
  7. subfont-text-scale=3
  8. stop-xscreensaver=yes
  9. subfont-autoscale = 3
  10. vf=expand=0:60:0:0
  11. vf=screenshot
复制代码

% ls -l ~/.mplayer/subfont.ttf
lrwxrwxrwx 1 nix nix 36 2004-12-01 /home/nix/.mplayer/subfont.ttf -> /usr/share/fonts/truetype/simyou.ttf
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-4-16 20:00:12 | 显示全部楼层
Post by completist
字体不行,换个中文字体
声音还和是否运行esd等有关
发个我用的config参考一下,因为很少用gmplayer,gui.conf就不贴了

  1. # Write your default config options here!
  2. vo=gl
  3. unicode=yes
  4. ao=alsa
  5. subcp=cp936
  6. font=/usr/share/fonts/truetype/simyou.ttf
  7. subfont-text-scale=3
  8. stop-xscreensaver=yes
  9. subfont-autoscale = 3
  10. vf=expand=0:60:0:0
  11. vf=screenshot
复制代码

% ls -l ~/.mplayer/subfont.ttf
lrwxrwxrwx 1 nix nix 36 2004-12-01 /home/nix/.mplayer/subfont.ttf -> /usr/share/fonts/truetype/simyou.ttf
谢谢completist的帮助,现在终于把问题解决了,感觉Debian真的不错。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表