ubuntu 下中文字幕问题

Posted 9 months, 2 weeks ago at 11:32 am. 0 comments

ad 468x60

totem 中文字幕问题

感谢 Huang Jiahua在源里做好的 xine-fonts-cn,直接在新立得中搜索安装 xine-fonts-cn 即可。甚至都不用配置 ~/.gnome2/totem_config 文件。这样即可解决 totem 支持 .srt 中文字幕的问题。

源里没有的话,直接用 xine-fonts-cn_0.1.2_all.deb 地址下载

注:srt 与 avi 同名,totem 会自动加载字幕;或者,把两个文件一起拖到 totem 窗口中;或者命令行

totem file:///home/ubuntu/av/[地狱神探].Constantine.DVDRip.XviD.CD1-DoNE.avi#subtitle:file:///home/ubuntu/av/[地狱神探].Constantine.DVDRip.XviD.CD1-DoNE.chs.srt

原理如下:

totem 使用的字体在 /usr/share/xine/libxin/fonts 中,而这里没有中文字体,所以字幕乱码或干脆不显示。需要 xine-fontconv 这个软件来制作所需的中文字体。

以下为引用内容:

一:添加源代码源:
sudo gedit /etc/apt/sources.list
增加
deb-src http://archive.ubuntu.com/ubuntu/ breezy main restricted universe multiverse

二:下载源代码,编译出 xine-fontconv :
sudo apt-get update
sudo apt-get source libxine1c2
cd xine-lib-1.0.1/misc/
sudo gcc -o /usr/local/bin/xine-fontconv xine-fontconv.c `freetype-config –cflags –libs`

三:生成中文字体
cd /usr/share/xine/libxine1/fonts
sudo xine-fontconv /usr/share/fonts/zh_CN/TrueType/SIMSUN.TTF simsun gb18030

四:修改totem的配置:
gedit ~/.gnome2/totem_config
找到中间的项目修改为:
subtitles.separate.font:simsun
subtitles.separate.src_encoding:gb18030

五:播放:
totem file:///home/ubuntu/av/[地狱神探].Constantine.DVDRip.XviD.CD1-DoNE.avi#subtitle:file:///home/ubuntu/av/[地狱神探].Constantine.DVDRip.XviD.CD1-DoNE.chs.srt


via http://forum.ubuntu.org.cn/about2760.html

Mplayer 中文字幕

大约这样的命令格式

mplayer 影片名 -sub 字幕名 -subcp cp936 -font 中文字体名

中文字体名,就是类似 /media/hda1/WINDOWS/Fonts/simsun.ttc 这样(我的 windows 在 hda1)。我试验了

-font /usr/share/fonts/X11/misc/wenquanyi_12pt.pcf.gz

但是很卡。所以还是推荐 windows 的那些字体。下面是比较完整的例子

mplayer [肥皂].A.Soap.2006.LIMITED.DVDRip.XviD-MESS.avi -sub [肥皂].A.Soap.2006.LIMITED.DVDRip.XviD-MESS.srt -subcp cp936 -font /media/hda1/WINDOWS/Fonts/simsun.ttc

简写

mplayer *.avi -subcp cp936 -font /media/hda1/WINDOWS/Fonts/simsun.ttc

即可。但还avi和字幕要同名。

以下为引用内容:

mplayer 如果希望默认字体就支持中文

1、修改~/.mplayer/config文件中间的项目为:
font=/usr/share/fonts/zh_CN/TrueType/SIMSUN.TTF
subcp=cp936

2、修改`/.mplayer/gui.conf文件中间的项目为:
sub_auto_load = “yes”
sub_unicode = “yes”
sub_pos = “99″
sub_overlap = “no”
sub_cp = “cp936″
font_factor = “0.750000″
font_name = “/usr/share/fonts/zh_CN/TrueType/SIMSUN.TTF”
font_encoding = “unicode”


参考资料:

totem 观看 avi+src 中文字幕方法

guoshuang2007-11-06+把电影和字幕拖进 Kaffeine 窗口,在设置中 subtiltle 选择编码,中文一般是 gb18030。

Popularity: 27% [?]

Tags: , , , , ,
ad 468x60

No Replies

Feel free to leave a reply using the form below!


Leave a Reply