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

TwitVim: Tweeting in the vim

很久没更新了,因为很久没折腾了。 昨晚火星地发现了一个好东西:twitvim,是个vim script。 试用了下,很不错,该有的功能都有了。这里做个笔记。 1、安装 从 vim script 下载twitvim的vba包。 用vim打开下载到的twitvim.vba,输入 :so % 回车完成安装。 安装curl,twitvim需要curl来fetching。 sudo apt-get install curl 2、配置 在.vimrc里添加 let twitvim_login = " user:pwd " 试用api,则添加 let twivim_api_root = " api_url " 使用代理,添加 let twitvim_proxy = " proxyhost:proxyport " 3、使用 进入vim (via http://www.vim.org/scripts/script.php?script_id=2204 ) :PosttoTwitter - This command will prompt you for a message to send to Twitter. :CPosttoTwitter - This command posts the current line in the current buffer to Twitter. :BPosttoTwitter - This command posts the current buffer to Twitter. Alt-T - In Visual select mode, the Alt-T key posts the selected text to Twitter.   (use Ctrl-T instead if menu bar is enabled) NOTE: The T mapping was changed to Alt-T to avoid overriding the T search command. Alt-R - Starts a @-reply. (from timeline buffer) Alt-D - Starts a direct

bitlbee: twitter in irc

dedicate to @sychopx, without her instruction, this wouldn't be done. from BitlBee Home Page What is BitlBee? BitlBee brings IM (instant messaging) to IRC clients. It's a great solution for people who have an IRC client running all the time and don't want to run an additional MSN/AIM/whatever client. BitlBee currently supports the following IM networks/protocols: XMPP/Jabber (including Google Talk), MSN Messenger, Yahoo! Messenger, AIM and ICQ, and the Twitter microblogging network (plus all other Twitter API compatible services like identi.ca and status.net). 很明显的说了,bitlbee是把IM转成IRC的形式,非常适合整天开着irc而又不想开msn/aim的人。 目前bitlbee支持XMPP/Jabber (包括 Google Talk), MSN Messenger, Yahoo! Messenger, AIM and ICQ, and the Twitter 。 记录一下自己在ubuntu上折腾bitlbee的过程: 要准备的东西:irc客户端(这里用的是irssi) 插曲:因为看错了这个东西的名字,少看了个“l”,以为是“bitbee”,所以在ubuntu apt安装是一直找不到。事实上,bitlbee已经包含在ubuntu源里了。另外,据@sychopx says, in fact you don't have to install it to use it. it's already implemented on the server. all you n