|
发表于 2010-4-29 16:49:32
|
显示全部楼层
Post by sightok;2086522
求教如何折腾。谢谢!
在源代码的shot()函数前加上这段:
[php]
mplayer () {
option=""
for file in "$@"; do
[ -f "$file" ] && break
done
if [ -f "$file" ]; then # 匹配字幕
option="-ass -vf ass,expand=osd=1"
name=${file%.*}
# 检测srt字幕
sub=$(find *.srt 2>/dev/null | grep -F "$name" | head -n1)
[ -f "${name}.chs.srt" ] && sub="${name}.chs.srt"
if [ "$sub" != "" ]; then
option="$option -sub "$sub" -subcp enca:zh:cp936"
else
# 检测idx/sub字幕
sub=$(find *.idx 2>/dev/null | grep -F "$name" | head -n1)
[ -f "${name}.chs.idx" ] && sub="${name}.chs.idx"
[ "$sub" != "" ] && option="$option -vobsub "${sub%.idx}" "
fi
fi
$(which mplayer) $option "$@"
}
[/php]
重点在于设置mplayer的选项:
- -ass -vf ass,expand=osd=1
复制代码 |
|