Created
June 24, 2025 16:30
-
-
Save colbyn/a330f615615c1bbf2957feb15cb51479 to your computer and use it in GitHub Desktop.
FFMPEG Video Recording Automation Scripts — 2025-6-24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| # ffmpeg -encoders | grep -E 'hevc_videotoolbox|aac_at' | |
| ffmpeg -encoders | grep -E 'hevc_videotoolbox|aac_at' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| ffmpeg -f avfoundation -list_devices true -i "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| # ── Device indices ─────────────────────────────────────────────── | |
| SCREEN_IDX="2:none" # Capture screen 0 | |
| WEBCAM_IDX="0" # FaceTime HD Camera (Built-in) | |
| INT_MIC_IDX=":1" # MacBook Pro Microphone | |
| OUT="master_$(date +%Y-%m-%d_%H-%M-%S).mkv" | |
| ffmpeg \ | |
| -capture_cursor 1 -capture_mouse_clicks 1 \ | |
| -f avfoundation -framerate 30 -video_size 1920x1080 -i "$SCREEN_IDX" \ | |
| -f avfoundation -framerate 30 -i "$WEBCAM_IDX" \ | |
| -f avfoundation -i "$INT_MIC_IDX" \ | |
| \ | |
| # ── Video streams ────────────────────────────────────────────── | |
| -map 0:v -c:v:0 hevc_videotoolbox -pix_fmt yuv420p10le -b:v:0 20M \ | |
| -metadata:s:v:0 title="Screen Capture" \ | |
| -map 1:v -c:v:1 hevc_videotoolbox -pix_fmt yuv420p10le -b:v:1 8M \ | |
| -metadata:s:v:1 title="Webcam (FaceTime HD)" \ | |
| \ | |
| # ── Audio stream ─────────────────────────────────────────────── | |
| -map 2:a -c:a:0 aac_at -b:a:0 256k \ | |
| -metadata:s:a:0 title="MacBook Pro Microphone" \ | |
| \ | |
| # ── Container ───────────────────────────────────────────────── | |
| -metadata title="Pilot Recording $(date +%Y-%m-%d)" \ | |
| -f matroska "$OUT" |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Workflow:
Example:
Therefore my options are:
Notes:
.mkv) which works best for the master copy, this will store the original A/V streams. This allows you to then decide how to use such streams in post-processing without burning a predefined configuration into the master copy.