A set of dead-simple FFmpeg helper scripts for recording high-quality, synchronized video + audio streams directly into a clean, editable .mkv
master file on macOS. Designed for screen walkthroughs, project documentation, and clean archival capture using built-in or external hardware.
This project is built around a "clean master capture" philosophy:
All video and audio sources are recorded simultaneously and muxed into a single .mkv
container. This guarantees perfect sync and makes file management easierβno need to juggle loose video and audio files later.
Recording each input (screen, webcam, mics) as independent streams gives you full control during editing:
- Switch feeds dynamically (e.g., show webcam only when you're speaking).
- Mix audio streams later, or discard noisy ones.
- Choose which mic sounds best after the fact.
- Apply effects, compression, and cuts per stream, not globally.
Youβre not locked into decisions made during the recordingβeverything can be reprocessed non-destructively.
Different mics capture different characteristics:
- A USB mic may sound richer, but pick up more room noise.
- A headset mic might be clearer, but have occasional artifacts.
- Your MacBook mic may be the fallbackβgood enough to recover a segment if others fail.
By recording them all, you get:
- Redundancy against failure or interference.
- Options for voice blending, denoising, or segment replacement.
- A way to analyze or compare mic performance over time.
The master .mkv
is raw in layout but clean in compression:
- No overlays (e.g., webcam-in-corner)
- No burned-in effects or crops
- No baked audio mixing
This ensures:
- Maximum editing flexibility
- Re-usable base for different publishing formats (e.g., full walkthrough vs short clip)
The master recording is your source of truth: a compact, hardware-encoded, timestamp-aligned archive of everything you captured. You can cut, convert, compress, remix, or reframe as neededβwithout re-recording or losing fidelity.
Checks whether your FFmpeg installation supports hardware acceleration for:
hevc_videotoolbox
(GPU-accelerated H.265)aac_at
(hardware-accelerated AAC audio)
Run this once to confirm support:
./check-hardware.sh
Lists all available video and audio input devices recognized by FFmpeg via AVFoundation (macOS only).
./list-capture-devices.sh
You'll see output like:
AVFoundation video devices:
[0] FaceTime HD Camera
[1] iPhone Camera
[2] Capture screen 0
AVFoundation audio devices:
[0] Corsair Wireless Headset
[1] USB Mic
[2] MacBook Pro Microphone
Use these indices to configure your recording script.
Records:
- β Full desktop screen capture
- β Webcam (FaceTime or external)
- β Multiple audio sources (up to 3 mics shown, easily extensible)
- β Cursor + mouse click highlights
- β Timestamped filename for archival
- β Per-stream metadata (for easier inspection/editing later)
./record-video.sh
This script muxes all video + audio inputs into a single .mkv
master file, with semi-lossless quality (HEVC video + high bitrate AAC). You'll see something like:
master_2025-06-24_15-32-12.mkv
You can later process this into overlays, cropped exports, etc.
The .mkv
file will contain multiple labeled streams:
Track | Description |
---|---|
v:0 | Screen capture |
v:1 | Webcam (FaceTime HD) |
a:0 | Corsair wireless mic |
a:1 | USB mic (device 100009002) |
a:2 | MacBook Pro microphone |
Inspect the result with:
ffprobe -show_streams -pretty master_*.mkv
Or view in VLC > βI > Codec Details.
- macOS (tested on 2019 MacBook Pro)
- FFmpeg with
--enable-videotoolbox --enable-audiotoolbox
- Install via Homebrew:
brew install ffmpeg
- Supports multiple streams cleanly (more than MP4)
- Doesnβt finalize the file until recording ends (safe on crash)
- Easy to remux to MP4 later:
ffmpeg -i master.mkv -c copy output.mp4
- You can toggle
-capture_cursor
or-capture_mouse_clicks
if you want a clean screen. - Add more audio streams with more
-map
lines and-metadata
titles. - Sync is guaranteed as long as streams are captured live and muxed together.
This has been a total nightmare