Per-platform devices
FFmpeg can capture the screen via OS-specific input devices:
- macOS —
avfoundation. List devices withffmpeg -f avfoundation -list_devices true -i "". Index 1 is typically the main display; index 2 a second display. - Linux —
x11grabfor X11 (:0.0). Wayland useskmsgrab+ intermediate layers. - Windows —
gdigraborddagrab(DXGI Desktop Duplication; faster).
The macOS pattern
On macOS, system audio capture requires a virtual audio device (BlackHole, Loopback). FFmpeg can capture mic audio directly — pair the screen device with the mic device in one ffmpeg invocation.