方法:
首先确定你安装了以下软件包
代码: 全选
mencoder, mplayer, lame, ffmpeg, and w32codecs
代码: 全选
#!/bin/bash
#convert Video to avi format for Nokia playing with DVDPlayer
FName=$1
# extract the movie, scale and resample with 15 fps
mencoder -nosound -ovc lavc -lavcopts vcodec=xvid -vop expand=320:200,scale=-2:200 -o movie.avi -ofps 15 "$FName"
#extract the audio from the movie, resample with 16 kHz and store it to audiodump.wav
mplayer -vo null -ao pcm -af resample=16000 "$FName"
#encode audiofile with 16KHz / 16 kbit/sec to mp3
lame -m m -b 16 -B 16 -F audiodump.wav audiodump.mp3
#mix audio and Video into an avi - audio mp3, video xvid
ffmpeg -i movie.avi -i audiodump.mp3 -b 120 -ac 1 -ab 16 -acodec mp3 -vcodec xvid -map 0.0 -map 1.0 "$FName.avi"
rm movie.avi
rm audiodump.wav
rm audiodump.mp3