cytopia/ffscreencast

ffmpeg屏幕录制,支持视频叠加和多显示器。

v0.6.4 2017-03-18 12:26 UTC

This package is auto-updated.

Last update: 2024-09-12 03:45:11 UTC


README

功能 | 安装 | 使用 | 截图 | 常见问题 | 待办事项 | 贡献 | 许可 | 版本 | 精选

Build Status Latest Stable Version Total Downloads Latest Unstable Version License Type

关于

ffscreencast 是一个用于 ffmpeg 的shell包装器,它允许通过命令行进行傻瓜式屏幕录制。它将自动检测所有可用的显示器、摄像头和麦克风,并能够交互式或手动选择所需的录制设备。此外,ffscreencast 还可以让您在桌面会话上叠加摄像头流。

除此之外,ffscreencast 还可以作为ffmpeg命令生成器。每个可用选项也可以仅显示相应的ffmpeg命令而不是执行它。非ffmpeg命令,例如如何拉取摄像头分辨率等,也可以显示而不是执行。

Screencast

支持的平台

要求

1. 功能

  • 默认配置的配置文件
  • 屏幕录制
  • 摄像头叠加
  • 音频支持
  • 允许手动(参数)或交互式选择显示器
  • 允许手动(参数)或交互式选择摄像头
  • 允许手动(参数)或交互式选择声音设备
  • ffmpeg命令生成

2. 安装

2.1 MacOSX

brew install cytopia/tap/ffscreencast

2.2 Linux/BSD

git clone https://github.com/cytopia/ffscreencast
cd ffscreencast
sudo cp bin/ffscreencast /usr/local/bin

3. 使用

3.1 概述

要简单地开始桌面录制屏幕,请调用程序而不带任何参数 ffscreencast,它将使用默认屏幕,没有摄像头叠加和声音。

$ ffscreencast

Usage: ffscreencast [-s[num]] [--sargs=] [-a[num]] [--aargs=] [-c[num] [--cargs=] [--oargs=] [-e<ext>] [--dry]
       ffscreencast --slist [--dry]
       ffscreencast --alist [--dry]
       ffscreencast --clist [--dry]
       ffscreencast --help
       ffscreencast --version
       ffscreencast --test

When invoked without any arguments, it will start screen recording
on the default screen without sound and without camera overlay.

Input options:
-s[num]           (Default) Enable screen capturing [with device number X].
                  If no device number is specified it will use the default, if only
                  one device is present, otherwise it will ask you to choose one
                  Use: -s or -s1

--sargs=          Additional screen arguments.
                  Specify additional ffmpeg arguments for the screen input device.
                  Use: --sargs="-framerate 30"
                  Default: ''

-a[num]           Enable audio capturing [with device number X]
                  If no device number is specified it will use the default, if only
                  one device is present, otherwise it will ask you to choose one
                  Use: -a or -a1

--aargs=          Additional audio arguments.
                  Specify additional ffmpeg arguments for the audio input device.
                  Use: --aargs="-ac 1"
                  Default: '-ac 2'

-c[num]           Add camera overlay [with device number X]
                  If no device number is specified it will use the default, if only
                  one device is present, otherwise it will ask you to choose one
                  Use: -c or -c1

--cargs=          Additional camera arguments
                  Specify additional ffmpeg arguments for the camera input device.
                  Use: --cargs="-video_size 1280x720"
                  Default: ''


Output options:
-e<ext>           Output video format extension (Default: mkv)
                  E.g.: -emkv, or -eavi, or -emp4

-oargs=           Additional output arguments
                  Specify additional ffmpeg arguments for the output encoding.
                  Use: --oargs="-crf 0"
                  Default: '-crf 0 -preset ultrafast'


Behavior options:
--dry             Show the command (without executing)


List options:
--list            List all devices
--slist           Only list screen capturing devices (monitors)
--alist           Only list audio capturing devices (microphones)
--clist           Only list camera capturing devices (cams)


System information:
--help            Show this help screen
--version         Show version information
--test            Test requirements

可以省略 num(设备编号)。如果只有一个类型的设备可用,ffscreencast 将自动默认为此设备,否则它将交互式地询问要使用的设备。

3.2 例子

在默认屏幕上进行屏幕录制(未显式选择显示器)

$ ffscreencast

列出显示器并记录在显示器2上(捕获屏幕0

$ ffscreencast --slist
Available screen recording devices (monitors):

[2] Capture screen 0    Color LCD: Resolution: 2880 x 1800 Retina
[3] Capture screen 1    S2431W: Resolution: 1920 x 1200
[4] Capture screen 2    Thunderbolt Display: Resolution: 2560 x 1440


$ ffscreencast -s2

列出摄像头

$ ffscreencast --clist
Available camera recording devices:

[0] FaceTime HD Camera (Display) (160x120@29.97 160x120@25 160x120@23.999981 160x120@14.999993 176x144@29.97 176x144@25 176x144@23.999981 176x144@14.999993 320x240@29.97 320x240@25 320x240@23.999981 320x240@14.999993 352x288@29.97 352x288@25 352x288@23.999981 352x288@14.999993 640x480@29.97 640x480@25 640x480@23.999981 640x480@14.999993 960x540@29.97 960x540@25 960x540@23.999981 960x540@14.999993 1024x576@29.97 1024x576@25 1024x576@23.999981 1024x576@14.999993 1280x720@29.97 1280x720@25 1280x720@23.999981 1280x720@14.999993)

[1] FaceTime HD Camera (1280x720@30 640x480@30 320x240@30)

开始带有摄像头叠加的屏幕录制(只有一个摄像头存在)

$ ffscreencast -c

或选择摄像头设备

$ ffscreencast -c0

显示摄像头录制的ffmpeg命令

$ ffscreencast -c --dry

ffmpeg -hide_banner -loglevel info -f avfoundation   -i "1" -f avfoundation  -i "0" -c:v libx264 -crf 0 -preset ultrafast -filter_complex 'overlay=main_w-overlay_w-10:main_h-overlay_h-10' "/Users/cytopia/Desktop/Screencast 2015-10-06 at 21.28.01.mkv"

4. 截图

显示带有和没有摄像头叠加的屏幕录制。

Screencast Screencast

5. 常见问题

当出现值得在此处提及的问题时,本节将进行更新

5.1 如何转换为其他格式?

目前没有内置的GIF支持,主要是因为它不会产生这么好的质量。建议首先以最佳可能的质量和最少的资源(显然你将要进行一些操作,不希望所有CPU都用于编码)创建你的屏幕录制,然后再将其转换为高质量GIF或其他格式。

请参阅贡献部分以获取转换器,并请随意添加更多。

5.2 如何在OSX上启用鼠标捕获?

默认情况下,OSX上的ffmpeg(使用AVFoundation)不捕获鼠标(在Linux上会捕获)。然而,你可以将此作为自定义选项传递给ffscreencast

为了捕获鼠标指针本身,请添加以下--sargs

ffscreencast --sargs="-capture_cursor 1"

如果你还想看到你实际点击鼠标的情况,可以这样做

ffscreencast --sargs="-capture_cursor 1 -capture_mouse_clicks 1"

5.3 如何在Linux/BSD上隐藏鼠标?

默认情况下,Linux/BSD上的ffmpeg(使用x11grab)默认显示鼠标指针(OSX不显示)。然而,你可以将此作为自定义选项传递给ffscreencast以隐藏鼠标指针

ffscreencast --sargs="-draw_mouse 0"

5.4 如何修改默认选项(配置文件)?

当你第一次运行ffscreencast时,它将在~/.config/ffscreencast/ffscreencastrc中创建一个配置文件。在此文件中指定的所有内容将在没有任何参数运行ffscreencast时应用。所以,如果你有自己的默认设置要始终输入,你可以简单地将它们添加到配置文件中。

6. 待办事项

6.1 缺陷

  • 通用:在使用相机叠加时,声音仍落后一秒
  • OSX: USB显示器(见#1

6.2 增强

  • BSD: 支持[Free]BSD(需要测试)
  • Windows: 通过cygwin和dshow支持Windows
  • Linux: 通过命令设置声音选项(alsa vs pulse)
  • Linux: 获取摄像头的默认分辨率/帧率
  • OSX: 获取摄像头的默认分辨率/帧率
  • 通用: 通过命令设置摄像头分辨率 使用--cargs
  • 通用: 通过命令设置摄像头位置
  • 通用: 能够记录一个或多个屏幕(显示器)

7. 贡献

欢迎贡献者。

8. 许可证

license

9. 版本

有关完整版本列表,请参阅变更日志

10. 优秀

以下Awesome列表添加