Ubuntu下怎么录制gif动态图?安装使用byzanz。
1.下载安装byzanz录制工具
sudo apt-get install byzanz
byzanz-record --help
2.录制格式(byzanz-record -x(X坐标) -y(Y坐标) -w(宽) -h(高) -d时间(秒) )
byzanz-record -x 165 -y 124 -w 440 -h 915 ~/Pictures/录制gif图2.gif
wangyetao@linux_u1604:~$ byzanz-record -x 992 -y 52 -w 928 -h 1028 -d 1000 ~/Pictures/gif录制_.gif
辅助工具 "xwininfo",查看你当前需要定位的窗口位置信息,x坐标、y坐标、宽、高与byzanz 命令参数一一对应。
wangyetao@wangyetao-Lenovo-G510:~$ xwininfo
xwininfo: Please select the window about which you
would like information by clicking the
mouse in that window.
xwininfo: Window id: 0x2200001 "写文章-CSDN博客 - Google Chrome"
Absolute upper-left X: 72
Absolute upper-left Y: 27
Relative upper-left X: 72
Relative upper-left Y: 27
Width: 1294
Height: 741
Depth: 24
Visual: 0x21
Visual Class: TrueColor
Border width: 0
Class: InputOutput
Colormap: 0x20 (installed)
Bit Gravity State: NorthWestGravity
Window Gravity State: NorthWestGravity
Backing Store State: NotUseful
Save Under State: no
Map State: IsViewable
Override Redirect State: no
Corners: +72+27 -0+27 -0-0 +72-0
-geometry 1294x741-0-0
wangyetao@wangyetao-Lenovo-G510:~$
下面是一些效果图:
wangyetao@linux_u1604:~$ sudo apt-get install byzanz
[sudo] wangyetao 的密码:
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
下列【新】软件包将被安装:
byzanz
升级了 0 个软件包,新安装了 1 个软件包,要卸载 0 个软件包,有 19 个软件包未被升级。
需要下载 85.1 kB 的归档。
解压缩后会消耗 499 kB 的额外空间。
获取:1 http://cn.archive.ubuntu.com/ubuntu xenial/universe amd64 byzanz amd64 0.3.0+git20160107-1 [85.1 kB]
已下载 85.1 kB,耗时 1秒 (44.8 kB/s)
正在选中未选择的软件包 byzanz。
(正在读取数据库 ... 系统当前共安装有 343134 个文件和目录。)
正准备解包 .../byzanz_0.3.0+git20160107-1_amd64.deb ...
正在解包 byzanz (0.3.0+git20160107-1) ...
正在处理用于 hicolor-icon-theme (0.15-0ubuntu1) 的触发器 ...
正在处理用于 man-db (2.7.5-1) 的触发器 ...
正在设置 byzanz (0.3.0+git20160107-1) ...
wangyetao@linux_u1604:~$ byzanz --help
byzanz:未找到命令
wangyetao@linux_u1604:~$ byzanz-record --help
用法:
byzanz-record [选项...] 录制您的当前桌面会话
帮助选项:
-?, --help 显示帮助选项
--help-all 显示全部帮助选项
--help-gtk 显示 GTK+ 选项
应用程序选项:
-d, --duration=SECS 动画的时间 (默认:10 秒)
-e, --exec=COMMAND Command to execute and time
--delay=SECS 开始之前的延时(默认:1 秒)
-c, --cursor 录制鼠标光标
-a, --audio 录音
-x, --x=像素 要录制矩形的 X 坐标
-y, --y=像素 要录制矩形的 Y 坐标
-w, --width=像素 录制矩形的宽度
-h, --height=像素 录制矩形的高度
-v, --verbose 详细
--display=显示 要使用的 X 显示
wangyetao@linux_u1604:~$ byzanz-record -x 65 -y 24 -w 400 -h 715 ~/Pictures/录制gif图.gif
wangyetao@linux_u1604:~$ byzanz-record -x 165 -y 124 -w 440 -h 915 ~/Pictures/录制gif图2.gif
wangyetao@linux_u1604:~$
wangyetao@linux_u1604:~$ byzanz-record -x 0 -y 0 -w 1920 -h 1080 -d 30 ~/Pictures/录制gif图10.gif