Skip to content

Instantly share code, notes, and snippets.

@intijk
Created August 21, 2012 18:51
Show Gist options
  • Save intijk/3418297 to your computer and use it in GitHub Desktop.
Save intijk/3418297 to your computer and use it in GitHub Desktop.
将一个视频转换成xbox360上可以播放的格式
#!/bin/bash
#给出一个简体的mp4文件名,给出一个繁体的avi文件名
s2t(){
#把文件名存储进一个文件内
srcf=`mktemp`
destf=`mktemp`
#对文件内容进行转码
echo "$1" > $srcf
cconv -f UTF8-CN -t UTF8-TW $srcf > $destf
#读出文件内容,显示
deststring=`cat $destf`
echo $deststring
#删除创建的临时文件
rm -f $srcf
rm -f $destf
}
destFilename(){
#裁掉$1的扩展名mp4,拼接上avi
srcStr=${1/%mp4/avi}
#s2t 把目标文件名转换成繁体字
destStr=`s2t $srcStr`
echo $destStr
}
while [ ! $# -eq 0 ]
do
mencoder $1 -o `destFilename $1` -oac mp3lame -ovc x264 -of lavf -vf lavcdeint
shift
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment