记录在此,备忘。
$ cat compress.sh
#!/bin/sh
# mplayer播放flv声音视频不同步的解决方法:
# http://www.oceanboo.cn/read.php/133.htm
# -lavfopts i_certify_that_my_video_stream_does_not_use_b_frames \
# -ofps 12 \
for i in *.mpg ; do \
echo 压缩 $i ... ; \
mencoder "$i" \
-o "$i.flv" \
-of lavf \
-oac mp3lame \
-lameopts abr:br=56:vol=10 \
-ovc lavc \
-lavcopts vcodec=flv:vbitrate=500:mbd=2:mv0:trell:v4mv:cbp:last_pred=3:dia=4:cmp=6:vb_strategy=1 \
-vf scale -zoom -xy 512 \
-srate 22050 \
-noskip \
; echo 压缩 $i 完毕! ; \
done