Skip to content

Instantly share code, notes, and snippets.

@BirkhoffLee
Created December 7, 2025 22:26
Show Gist options
  • Select an option

  • Save BirkhoffLee/f5ad61b8c73d706ee4e695d34e9d5315 to your computer and use it in GitHub Desktop.

Select an option

Save BirkhoffLee/f5ad61b8c73d706ee4e695d34e9d5315 to your computer and use it in GitHub Desktop.
macOS workflow to burn subtitles from MP4 recordings with Superwhisper (Useful for long lectures)

Prerequisites

This guide is for power users: requires usage of terminal.

  1. Superwhisper
  2. Nix
  3. ffmpeg

Steps

Transcribe the MP4 video

I use Superwhisper to transcribe the videos for me. On average, the videos I process has length around 1.5 hours. Takes around 3 minutes for it to process (using the Ultra cloud model).

Optionally, if you use Raycast, you can use this script command to send the video file selected in Finder to Superwhisper. If not, just use Superwhisper's UI to do it. It's the same.

After it finishes processing, find the meta.json for the task in Superwhisper's UI.

Transforming Superwhisper metadata to .SRT subtitles

With Nix installed, simply run:

nix run github:BirkhoffLee/swsrt -- /path/to/meta.json > ./output.srt

Burning .SRT subtitles into the video

With ffmpeg installed, simply run:

ffmpeg -i /path/to/input.mp4 -f srt -i ./output.srt -map 0:0 -map 0:1 -map 1:0 -c:v copy \
    -c:a copy -c:s mov_text /path/to/output.mp4

or put this function in your .zshrc for repeated usage:

function burnsrt {
  if [[ $# -ne 3 || ! -f "$1" || "${1##*.}" != "mp4" || ! -f "$2" || "${2##*.}" != "srt" || "${3##*.}" != "mp4" ]]; then
    echo "Usage: burnsrt <input.mp4> <input.srt> <output.mp4>" >&2
    echo "  - <input.mp4>: Path to a valid MP4 video file." >&2
    echo "  - <input.srt>: Path to a valid SRT subtitle file." >&2
    echo "  - <output.mp4>: Path for the output MP4 file." >&2
    return 1
  fi

  ffmpeg -i "$1" -f srt -i "$2" -map 0:0 -map 0:1 -map 1:0 -c:v copy \
    -c:a copy -c:s mov_text "$3"
}

Now you have the MP4 video with subtitles burned-in.

To learn more about this step and how to use it with MKV videos, check out this gist.

Credits

  1. https://gist.github.com/spirillen/af307651c4261383a6d651038a82565d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment