LinuxSir.Org  
| 网站首页 | 论坛帮助 |

欢迎来到LinuxSir.Org!
您还未登录,请登录后查看论坛,或者点击论坛上方的注册链接注册新账号。


发表新主题 回复
精华主题  
主题工具
旧 09-11-23, 21:43 第 1 帖
lolilolicon
 
lolilolicon 的头像
 
 
注册会员  
  注册日期: Mar 2009
  帖子: 660
  精华: 1
 

标题: ffcast: 巨小巧的屏幕录制工具


论坛帖子 :: AUR页面

功能简介:
引用:
*调用ffmpeg录制所选屏幕区域
*支持ffmpeg所支持的所有编码格式
*选择录制区域的方式有多种:
>a) 全屏(-a选项)
>b) 鼠标点选; 支持选择多个窗口(-n选项)
>c) 命令行指定窗口ID; 支持选择多个窗口(-i选项)
>d) 鼠标拖拽选择, 就如同`scrot -s'(-s选项)
>e) 命令行自由指定选区 (-j选项)
*对于选区方式b)和c), 可选择考虑或者忽略窗口边框(-B/-b选项)
*默认采用无损x264编码,输出视频体积相当小巧
*可选所有ffmpeg预置的x264 presets, 使得视频质量控制更简便
*CLI
我在Michal Witkowski原来的小脚本的基础上, 增加/调整了相当数量的代码
另外从scrot的main.c中提取/修改了xrectsel.c, 以实现鼠标拖拽选择矩形区域的功能

安装后在/usr/bin/下会增加两个文件: ffcast 和 xrectsel

欢迎使用, 试验, 报错, 索要新功能
欢迎提供patch以及money

编辑:
____重要更新: xrectsel.c代码重写, 修正了-s选项高CPU使用的现象 (如果你还没发现的话, 不妨htop一下)
编辑:
____更新: xrectsel现在采用十字形鼠标(XC_crosshair), 既有提示作用, 选择也更加准确.

编辑(11.29)
感谢糊涂同学对ffcast几次更新的汇总! 请跳转浏览器至:
我在这里简单介绍一下最近的一些更新:
首先, 以下是现在 ffcast 会安装的几个文件
引用:
/usr/bin/ffcast
/usr/bin/xrectsel
/usr/share/ffcast/doc/ffcast.conf
/usr/share/man/man1/ffcast.1.gz
其中 ffcast.conf 是一个示例配置文件 -- 也就是说 ffcast 现在支持使用配置文件了,
如何使用和编辑配置文件:
引用:
mkdir "${XDG_CONFIG_HOME:-$HOME/.config}/ffcast"
cp /usr/share/ffcast/doc/ffcast.conf "${XDG_CONFIG_HOME:-$HOME/.config}/ffcast/ffcast.conf"
vim "${XDG_CONFIG_HOME:-$HOME/.config}/ffcast/ffcast.conf"
注意读一下文件开头的注释

另外 ffcast 现在有 man page 了, 不过不是非常完整. easycat还说读不懂 555。。

其余更新我懒得写了, 使用 --help 和 man page 应该足够了
如果你想详细了解更新的进度, 可以在 $srcdir/ffcast 使用 git log 查看

还有, 如果你有什么疑问, 请把问题描述出来, 不然我会满脑子都是问号的

此帖于 09-11-29 12:57 被 lolilolicon 编辑.
  lolilolicon 当前离线   回复时引用此帖
旧 09-11-23, 22:08 第 2 帖
adam8157
 
adam8157 的头像
 
 
注册会员  
  注册日期: Mar 2009
  帖子: 1,024
  精华: 0
 

厉害....







__________________
我的博客
http://adam8157.info/

我的配置文件, 脚本和开源项目
http://adam8157.info/projects/
  adam8157 当前离线   回复时引用此帖
旧 09-11-23, 22:56 第 3 帖
Havanna
 
 
 
注册会员  
  注册日期: Apr 2008
  我的住址: 上海
  帖子: 923
  精华: 0
 

thanks,非常不错,用上了
  Havanna 当前离线   回复时引用此帖
旧 09-11-24, 00:03 第 4 帖
Havanna
 
 
 
注册会员  
  注册日期: Apr 2008
  我的住址: 上海
  帖子: 923
  精华: 0
 

有配置文件就好了
  Havanna 当前离线   回复时引用此帖
旧 09-11-24, 00:54 第 5 帖
lolilolicon
 
lolilolicon 的头像
 
 
注册会员  
  注册日期: Mar 2009
  帖子: 660
  精华: 1
 

ffcast是一个bash脚本, 需要修改默认行为最简单的就是直接编辑ffcast的{{{defaults}}}区域.
但这样的坏处是升级必然会取代这些设定.
如果要使用配置文件我能想到的最方便的方法就是source ~/$FFCASTCONF, 然而...我认为 source 比较容易带来安全上的问题...

我想听听大家的意见如何

新消息:
刚刚加了新选项, -t,--duration : 用来限制录制的最大时长. 这样就不必每次都按[q]才可以结束了.
  lolilolicon 当前离线   回复时引用此帖
旧 09-11-24, 09:11 第 6 帖
Havanna
 
 
 
注册会员  
  注册日期: Apr 2008
  我的住址: 上海
  帖子: 923
  精华: 0
 

请问,输出到图片gif为何不行呢?
需要libgif?
  Havanna 当前离线   回复时引用此帖
旧 09-11-24, 10:54 第 7 帖
carbonjiao
 
carbonjiao 的头像
 
 
注册会员  
  注册日期: Mar 2004
  我的住址: 广州番禺
  帖子: 915
  精华: 5
 

很好 很强大







__________________
Archlive <http://archlive.googlecode.com>
Archlive-pkg <http://archlive-pkg.googlecode.com>
Acer TravelMate 3282WXMI
Asus A8Tc
ntldr (Win2003) --> Grub4dos --> bootmgr (Win7 U32 VHD + Win7 U64 VHD)
--> Arch x86_64
--> Arch i686
--> ...
  carbonjiao 当前离线   回复时引用此帖
旧 09-11-24, 11:55 第 8 帖
lolilolicon
 
lolilolicon 的头像
 
 
注册会员  
  注册日期: Mar 2009
  帖子: 660
  精华: 1
 

引用:
作者: Havanna
请问,输出到图片gif为何不行呢?
需要libgif?
我在#ffmpeg问了这个问题:
引用:
11:36 < canti> hi there. why this fails? http://dpaste.com/124352/
11:41 < theholydu> canti, i think it sorta
11:41 < theholyduck> prints out why it fails
11:41 < theholyduck> and what to do about it
11:41 < theholyduck> oh wait, you tried that
11:41 < canti> yah..
11:42 < theholyduck> gif output sucks though :P
11:42 < canti> i also tried putting elsewhere in the commandline -pix_fmt rgb24 ...
11:43 < canti> i agree gif sucks, but somebody wants it xD
11:43 <@Dark_Shikari> ffmpeg's gif output sucks more
11:43 <@Dark_Shikari> try imagemagick maybe
11:44 <@bcoudurier> what's wrong with it ?
11:44 <@Dark_Shikari> I recall that it isn't very optimized iirc...
11:44 <@Dark_Shikari> I don't think it does global palettes
11:44 <@Dark_Shikari> optimized global palettes that is
11:44 <@Dark_Shikari> wait, it doesn't even do optimized palettes period
11:44 < canti> Dark_Shikari: possible to fix my command line?
11:44 <@Dark_Shikari> there's even a great comment that says
11:45 <@Dark_Shikari> "better than nothing gif encoder"
11:45 <@bcoudurier> ah
11:46 < canti> Does it do gif from x11grab? the import command? <-- <@Dark_Shikari> try imagemagick
maybe
11:46 <@Dark_Shikari> why not record the video once
11:46 <@Dark_Shikari> and then convert it to gif later?
11:46 <@Dark_Shikari> or use ffmpeg to write a series of, say, pngs
11:47 <@Dark_Shikari> and then convert those to an animated gif with imagemagick later
11:49 < canti> Dark_Shikari: but that will be huge with pngs, and takes one more extra step with
converting later. i'm using this in a screencast script, gif is just an output
option i thought it/ffmpeg should support.
... ...
11:56 <@bcoudurie> canti, -vcodec rawvideo -pix_fmt rgb24
11:56 < canti> bcoudurier: let me try
11:58 < canti> bcoudurier: it works. but it's HUGE!!! 26M for 5 sec
11:59 <@bcoudurier> yes, lzw compression is missing
11:59 <@bcoudurier> it's "better than nothing"
11:59 < Haxar> or you could just pipe it
11:59 <@bcoudurier> anyway I'm off
12:00 < canti> Haxar: i was thinking about this, but well...
看来目前找不到比较好的解决办法 ..

下面的命令使用ImageMagick的convert把ffmpeg编码的raw格式转成压缩格式的gif
代码:
$ ffmpeg -r 15 -s 640x480 -an -f x11grab -i ${DISPLAY}+0+0 -vcodec rawvideo -pix_fmt rgb24 -f gif -t 5 - | convert gif:- cast.gif
不过rbg24格式录制出来的效果颜色失真是很严重的... 即使上面的办法可行, 我个人也不会采用gif输出...

编辑:
最新的脚本支持使用-c gif或-f gif输出gif文件, 但由于ffmpeg貌似只支持未压缩的gif输出, 文件会很大. 参看git log:
引用:
fixed :: gif output now is supported, but is uncompressed, which \
means it will be HUGE, possible solutions:
* pipe it to convert gif:- output.gif; this requires ImageMagick;
* find a way to tell ffmpeg how to do compressed gif;
* do not use gif format;
formatting :: rearranged, overall formatting looks clearer.
:: 如果必须用gif输出, 目前比较令人满意的解决方法是使用 -o - 管道传送给convert进行gif压缩
引用:
ffcast -s -t 5 -c gif -f gif -o - --debug | convert gif:- cast.gif

此帖于 09-11-24 15:09 被 lolilolicon 编辑.
  lolilolicon 当前离线   回复时引用此帖
旧 09-11-24, 16:27 第 9 帖
omegao
 
omegao 的头像
 
 
注册会员  
  注册日期: May 2003
  帖子: 767
  精华: 0
 

强大…………………………
  omegao 当前离线   回复时引用此帖
旧 09-11-24, 18:43 第 10 帖
Havanna
 
 
 
注册会员  
  注册日期: Apr 2008
  我的住址: 上海
  帖子: 923
  精华: 0
 

代码:
ffcast -s -r 3 -f gif -o - --debug | convert gif:- 1.gif
用了下,感觉非常完美
就是颜色失真还是真厉害。。。:(
thanks
  Havanna 当前离线   回复时引用此帖
旧 09-11-24, 19:02 第 11 帖
sfbi
 
sfbi 的头像
 
 
注册会员  
  注册日期: May 2004
  帖子: 249
  精华: 0
 

太牛鼻了,抛弃recordmydesktop,嗯嗯
  sfbi 当前离线   回复时引用此帖
旧 09-11-24, 19:11 第 12 帖
lolilolicon
 
lolilolicon 的头像
 
 
注册会员  
  注册日期: Mar 2009
  帖子: 660
  精华: 1
 

大家有没有注意到 -s 选项引起高CPU使用的现象? 没发现的拿htop瞄一眼然后拍大腿~

好消息是, 这个问题已经修正. 请看首贴~

另外对于大家的支持和鼓励, 在下非常感谢.
Havanna: nice catch.

编辑:
代码:
gif output now loops forever :: ffmpeg :: -loop_output 0
如何?

此帖于 09-11-24 20:04 被 lolilolicon 编辑.
  lolilolicon 当前离线   回复时引用此帖
旧 09-11-24, 20:18 第 13 帖
jqxl0205 帅哥
 
 
 
注册会员  
  注册日期: Dec 2007
  帖子: 526
  精华: 0
 

我这边安装的版本号怎么比aur上面的大呀!

本机是ffcast 20091124-1,aur上面的是ffcast 20091123-1。







__________________
K.I.S.S

ArchLinux 2.6.37
  jqxl0205 当前离线   回复时引用此帖
旧 09-11-24, 21:17 第 14 帖
hurricanek
 
 
 
注册会员  
  注册日期: Jun 2008
  帖子: 530
  精华: 0
 

从git上抓的源码会自动更新版本号,类似的还有cvs的,svn的。
你明天用aur编译就变成1125喽
  hurricanek 当前离线   回复时引用此帖
旧 09-11-24, 21:50 第 15 帖
lolilolicon
 
lolilolicon 的头像
 
 
注册会员  
  注册日期: Mar 2009
  帖子: 660
  精华: 1
 

引用:
作者: jqxl0205
我这边安装的版本号怎么比aur上面的大呀!

本机是ffcast 20091124-1,aur上面的是ffcast 20091123-1。
呵呵, 你可以看看 /usr/bin/makepkg 的 devel_check()
引用:
作者: /usr/bin/makepkg
... ...
(1242行) newpkgver=$(date +%Y%m%d)
... ...
(1290行) sed -i "s/^pkgver=[^ ]*/pkgver=$newpkgver/" "$BUILDFILE"
(1291行) sed -i "s/^pkgrel=[^ ]*/pkgrel=1/" "$BUILDFILE"
  lolilolicon 当前离线   回复时引用此帖
发表新主题 回复


主题工具

发帖规则
您 [不可以] 发表新主题
您 [不可以] 回复主题
您 [不可以] 上传附件
您 [不可以] 编辑您的帖子

已 [启用] BB 代码
已 [启用] 表情符号
已 [启用] IMG 代码
已 [禁用] HTML 代码
[论坛跳转…]


所有时间均为[北京时间]。现在的时间是 06:59


Powered by vBulletin 版本 3.6.8
版权所有 ©2000 - 2012, Jelsoft Enterprises Ltd.
官方中文技术支持: vBulletin 中文
版权所有 ©2002 - 2011, LinuxSir.Org