更好的转换数码相机(canon)中的录像

佳能相机中的录像格式为动态JPG的AVI影像,没有压缩,导致文件很大,因此需要转换为压缩格式,此处我们选择xvid格式。
首先要安装所需的软件,也可参考此
sudo aptitude install mencoder
注意:录像从相机中拷贝出来后最好立即进行转换操作,若进行了二次拷贝操作,录像中的时间信息有可能会丢失,而录像的元数据中又没有时间信息(这点很奇怪,为何video metadata中不包含创建时间信息?)。

1 转换所有的后缀为avi,因为我得到的文件中有大写的,也有小写的。

for i in *.AVI; do mv $i ${i%.AVI}.avi;done

2 转换格式,我在转换的时候没有改变大小,音频质量设置为6,视频质量设置为8,然后文件按照拍摄时间(精确到秒)进行重命名。

for i in M*.avi; do
mencoder -oac mp3lame -lameopts aq=7:vbr=2:q=6 -srate 32000 -vf harddup -ovc xvid -xvidencopts fixed_quant=8 $i -o test.avi
touch -m -r $i test.avi
mv test.avi `stat -c %y test.avi | awk ‘{print $1 $2 $3}’|cut -d”.” -f1|sed -e ‘s/-//g’ -e ‘s/://g’ `.avi
done

3 若你的totem不能播放此AVI,则说明你没有安装相应的插件,根据提示安装即可。安装完成后在nautilus有可能看不到video的thumbnail,可以进行此操作:

rm ~/.thumbnails/fail/gnome-thumbnail-factory/*

This entry was posted in Linux and tagged , , , , , , . Bookmark the permalink.

3 Responses to 更好的转换数码相机(canon)中的录像

  1. Less says:

    您好!我的ixus拍的视频巨大无比,人肉到你这边发现是在linux上面转换的软件,我后来用转换工厂转换成功了基本就是原来的10-20%左右。

  2. wlx [微博 ] says:

    mencoder也有对应的WINDOWS版本,还有人专门作了图形界面。
    不过没有UBUNTU下用的方便。

  3. Less says:

    呵呵,我只有用suse

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Please copy the string VFshYT to the field below:

以新浪微博帐号登录