Skip to main content

ffmpeg notes

ubuntu下录屏的软件很多,recordmydesktop、istanbul、wink啊什么的。

不过好像很多geek录制tutorial时都是用ffmpeg的,于是我也想折腾一下。

之前apt-get的ffmpeg貌似是不能x11grab的。

按照网上的教程complie,也是从来没有成功过=。=!

还好在网上发现个script,可以安装ffmpeg和x264.下载地址如下:

http://code.google.com/p/x264-ffmpeg-up-to-date/downloads/detail?name=ffmpeginv1.4.sh

运行scrip,一路yes,大概5-10分钟就可以装好了。

>录制视频:

$ffmpeg -r 30 -s 1280x1024 -f x11grab -i :0.0 -vcodec mpeg4 -qscale 1 ~/output.avi

-r 是rate,应该是帧率的意思。30就是每秒30帧。
-s 是size,1208x1024是我的显示屏分辨率大小,也就是录制全屏了。
-f x11grab 是开启录制功能。ps:需要的编译时enable,用脚本安装的就自动有了。
-vcodec mpeg4视频编码。
-qscale 1 是视频质量,数字越小质量越好。
~/output.avi是输出文件名。

>录制窗口

先要获取窗口大小和位置。

$xwininfo
提示选择要获取的窗口,点击完成。
运行结果如图:
xwininfo

-geometry 902x587+143+99 就是所选窗口的大小及位置。

ffmepg命令就这样写:

$ffmpeg -r 30 -s 902x588 -f x11grab -i :0.0+143,99 -vcodec mpeg4 -qscale 1 ~/output.avi
录制video+audio(via micophone):

ffmpeg -f oss -ac 2 -i /dev/dsp -f x11grab -r 30 -s 900x554 -i :0.0+199,249 -vcodec mpeg4 -qscale 1 ~/output.avi


q键退出录制。


Comments

Popular posts from this blog

aes,gpg,encrypt, man etc

-Who is the most controversial man in the world recently? -Definitely it's Julia Assange . WikiLeaks had released a package of file encrypted with AES. What shall we do right now? yeah! download it and wait for the passphrase! So let's have a little try at encrypting in Ubuntu. GPG  here is sample file another_file. 1.gpg -c filename enter a passphrase.Now the file is encrypted. 2.gpg filename.gpg AES     Download AESCrypt here.     extract the package with         tar xzvf filename     then         make         sudo make install     I haven't tried aescrypt yet. But you can make it with a simple command. Just go to their home page. Others things: Chinese man page. while downloading source file of aescrypt, i found that they provide a manpage file. So making 'man aescrypt' working in terminal became a problem. After goo...

BACK HERE!

it has been a long time Since 2006 i set my blog at blogspot.com. i have tried other services such as wordpress, typecho, hexo, hugo etc because google had been blocked in 2008. Just tired of buying vps,install database and install blog applications. Get back here to stay simple.

考试

公考成绩出了...发挥很稳定,和大四第一次考的成绩一样。排名23,还不错,今年有好好复习的动力了。 本周考职称外语,四月份考会计从业资格证,五月的计算机中级不知道要不要报名.. 今年肯定是考试的一年。