macos - 如何使用 ffmpeg 录制在我的 Mac 上运行的特定应用程序?

标签 macos video ffmpeg macos-high-sierra

我刚刚在 Mac HighSierra 上使用 home-brew 安装了 ffmpeg。我想记录在我的机器上运行的应用程序的内容(只有视频很好)(而不是我的整个桌面)。所以我尝试运行以下

davea$ ffmpeg -f gdigrab -framerate 25 -i title=DOSBox
ffmpeg version 3.4.1 Copyright (c) 2000-2017 the FFmpeg developers
  built with Apple LLVM version 9.0.0 (clang-900.0.39.2)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/3.4.1 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-gpl --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libavresample   3.  7.  0 /  3.  7.  0
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
Unknown input format: 'gdigrab'

但正如你所看到的,我得到了这个
Unknown input format: 'gdigrab'

错误。使用ffmpeg仅针对特定应用程序在我的计算机上录制视频的正确方法是什么?

编辑:在评论中使用 hte 建议,我得到了另一个错误......
davea$ ffmpeg -f avfoundation -list_devices true -i ""
ffmpeg version 3.4.1 Copyright (c) 2000-2017 the FFmpeg developers
  built with Apple LLVM version 9.0.0 (clang-900.0.39.2)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/3.4.1 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-gpl --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libavresample   3.  7.  0 /  3.  7.  0
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
[AVFoundation input device @ 0x7fcbc160d0c0] AVFoundation video devices:
[AVFoundation input device @ 0x7fcbc160d0c0] [0] FaceTime HD Camera
[AVFoundation input device @ 0x7fcbc160d0c0] [1] Capture screen 0
[AVFoundation input device @ 0x7fcbc160d0c0] AVFoundation audio devices:
[AVFoundation input device @ 0x7fcbc160d0c0] [0] Built-in Microphone
: Input/output error

最佳答案

虽然你提到了ffmpeg ,我只是想让您知道,您也可以实现“抓取屏幕的一部分”的既定目标,而无需安装任何其他软件,只需使用 macOS 随附的工具 - 即 快速时间 不幸的是,Apple 将其称为“QuickTime 播放器”,这掩盖了它可以录制和播放的事实。

因此,要开始使用,请对 进行“Spotlight 搜索”。快速时间 按 ⌘space 并开始输入“QuickTime”。一旦它猜到您的意思是“QuickTime”,请按 Enter/Return。

否,请转到"file"菜单,然后单击“新建屏幕录制”。按下红色的“录制”按钮,它会让您拖出一个矩形区域来录制您想要录制的内容。完成后,“停止”按钮位于屏幕右上角靠近时钟的位置。

关于macos - 如何使用 ffmpeg 录制在我的 Mac 上运行的特定应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48067313/

相关文章:

javascript - 通过javascript按按钮加载嵌入式MP4视频

node.js - 在 1 :1 user and broadcast to an rtmp url 之间捕获视频 session

ffmpeg - 如何缩放和定位水印以缩放?

git - SSH key 停止在源代码树中的 MAC OS Sierra 10.12.3 上工作

linux - EventSource 登录单声道

HTML <video> 占位符在 ipad 上是黑色的。我们可以改变它吗?

html - 如何使用本地视频而不是 Youtube URL?

ffmpeg - 用FFmpeg yuv编码成H264封装成ts,ts视频发现时长变短了?

macos - MacOSX 上的智能卡 PKCS#11 支持

objective-c - 我正在使用 sdl,如何发送假键盘事件?