zoukankan      html  css  js  c++  java
  • Linux—asciinema 命令详解(终端录制工具)

    录制终端视频

    [root@localhost ~]# asciinema rec first.cast               
    [root@localhost ~]# asciinema rec /www/wwwroot/first.cast            # rec后面跟录制文件的保存位置
    [root@localhost ~]# asciinema rec /www/wwwroot/first.cast --append   # 追加录制

    播放终端视频

    [root@localhost ~]# asciinema play first.cast           # 正常速度播放
    [root@localhost ~]# asciinema play -s 2 first.cast      # 以2倍速重播
    [root@localhost ~]# asciinema play -i 2 first.cast      # 正常速度播放,但空闲时间限制为2秒
    

    上传录制到asciinema.org

    这是一个默认的asciinema-server 实例,并打印一个秘密链接,您可以使用它来在Web浏览器中观看您的录制内容。输入exit,结束录制后,就会弹出视频保存的地址。

    [root@localhost ~]# asciinema upload first.cast   # 方式1:将录制好的放上去
    [root@localhost ~]# asciinema rec                 # 方式2:直接在录制的时候,不加文件名,就会直接上传了
    

    https://mp.weixin.qq.com/s/oqZqGiQ3uNrNuT-nGrh9lg

    https://www.cnblogs.com/dggsec/p/9216112.html

    三、浏览器播放

    asciinema录制文件在web端(浏览器)播放是通过asciinema-player组件来实现的,还需要借助两个库文件 asciinema-player.css 和 asciinema-player.js 。首先分别引入css和js文件,添加一个asciinema-player的标签即可播放标签内文件的录像。

    下载 asciinema-player.js 文件: wget -q https://github.com/asciinema/asciinema-player/releases/download/v2.4.0/asciinema-player.js

    下载 asciinema-player.css文件:wget -q https://github.com/asciinema/asciinema-player/releases/download/v2.4.0/asciinema-player.css

    示例 HTML 代码(注意新增的 asciinema-player 标签)如下:

    <html>
    <head>
        <link rel="stylesheet" type="text/css" href="asciinema-player.css" />
    </head>
    <body>
        <asciinema-player src="demo.cast"></asciinema-player>
        <script src="asciinema-player.js"></script>
    </body>
    </html>
    

    四、另一种终端录制(script 命令)

    script 命令是 Linux 系统自带一个的终端录制工具,功能与 asciinema 类似,可以将终端交互内容保存在本地的文本文件中,再使用 scriptreplay 命令进行播放。

    [root@localhost ~]# script -t 2>time.file -a output.file   # 录制
    [root@localhost ~]# scriptreplay time.file output.file     # 播放

    其中 time.file 用于保存时间信息,output.file 则用于记录终端输出的内容及光标的移动等。录制完成时使用 exit 命令或者 Ctrl+D 终止录制。

    https://ops-coffee.cn/s/pcstabodjds8d15arwafza

    https://www.cnblogs.com/37Y37/p/11909685.html

    https://www.h3399.cn/201911/734487.html

  • 相关阅读:
    vue 传参动态
    a href="tel" 拨打电话
    vue中rem的转换
    请求接口的封装
    http request 请求拦截器,有token值则配置上token值
    node溢出
    vue菜单切换
    vue的table切换
    vue页面初始化
    [论文笔记] Legacy Application Migration to the Cloud: Practicability and Methodology (SERVICES, 2012)
  • 原文地址:https://www.cnblogs.com/liuhaidon/p/12678602.html
Copyright © 2011-2022 走看看