Skip to content
View riantosandi's full-sized avatar

Block or report riantosandi

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. Markdown is supported. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
riantosandi/README.md

Auto Subtitle

Offline AI subtitle generation for macOS Apple Silicon.

Transcribes video audio using faster-whisper and burns subtitles using a bundled static ffmpeg with libass.


Features

  • πŸ”’ Fully offline β€” no internet required after first model download
  • 🍎 Apple Silicon native β€” arm64 binary, optimized for M1/M2/M3
  • 🎬 Subtitle burn-in β€” permanent subtitles via ffmpeg + libass
  • 🎨 Customizable β€” font, size, color, outline, position
  • πŸ“¦ Self-contained β€” no Homebrew, no system dependencies

Build Requirements

System

  • macOS 12.0+ (Monterey or later)
  • Apple Silicon (M1/M2/M3)
  • Python 3.10+ (arm64) β€” from python.org

Assets (must be provided before building)

1. Static ffmpeg (MANDATORY)

Download from https://evermeet.cx/ffmpeg/:

  • ffmpeg β†’ place at assets/bin/ffmpeg
  • ffprobe β†’ place at assets/bin/ffprobe
chmod +x assets/bin/ffmpeg assets/bin/ffprobe

Verify:

# Must be arm64
file assets/bin/ffmpeg

# Must show ONLY /usr/lib/* β€” NO /opt/homebrew
otool -L assets/bin/ffmpeg

# Must show 'ass' filter
assets/bin/ffmpeg -filters 2>&1 | grep ass

2. Fonts

Place TTF/OTF fonts in assets/fonts/:

cd assets/fonts
curl -fsSL -o NotoSans-Regular.ttf \
    "https://github.com/notofonts/noto-fonts/raw/main/hinted/ttf/NotoSans/NotoSans-Regular.ttf"
curl -fsSL -o NotoSans-Bold.ttf \
    "https://github.com/notofonts/noto-fonts/raw/main/hinted/ttf/NotoSans/NotoSans-Bold.ttf"

3. App Icon (optional)

Place assets/icons/app_icon.icns for a custom icon. See assets/icons/README.md for creation instructions.


Build Instructions

Step 1: Install Python dependencies

pip install -r requirements.txt

Step 2: Build the .app

chmod +x build_app.sh
./build_app.sh

Output: dist/AutoSubtitle.app

Step 3: Create the DMG

chmod +x build_dmg.sh
./build_dmg.sh

Output: dist/AutoSubtitle-1.0.0-arm64.dmg


Manual Build Commands

# Build .app
pyinstaller auto_subtitle.spec --clean --noconfirm

# Create DMG
codesign --force --deep --sign - dist/AutoSubtitle.app
mkdir -p dist/dmg_staging
cp -R dist/AutoSubtitle.app dist/dmg_staging/
ln -s /Applications dist/dmg_staging/Applications
hdiutil create \
    -volname "Auto Subtitle" \
    -srcfolder dist/dmg_staging \
    -ov -format UDZO \
    dist/AutoSubtitle-1.0.0-arm64.dmg
rm -rf dist/dmg_staging

Expected .app Layout

dist/AutoSubtitle.app/
└── Contents/
    β”œβ”€β”€ Info.plist
    β”œβ”€β”€ MacOS/
    β”‚   β”œβ”€β”€ AutoSubtitle              ← main executable (arm64)
    β”‚   β”œβ”€β”€ bin/
    β”‚   β”‚   β”œβ”€β”€ ffmpeg                ← static arm64 ffmpeg (libass included)
    β”‚   β”‚   └── ffprobe               ← static arm64 ffprobe
    β”‚   β”œβ”€β”€ assets/
    β”‚   β”‚   └── fonts/
    β”‚   β”‚       β”œβ”€β”€ NotoSans-Regular.ttf
    β”‚   β”‚       └── NotoSans-Bold.ttf
    β”‚   β”œβ”€β”€ faster_whisper/
    β”‚   β”‚   └── assets/
    β”‚   β”‚       └── silero_vad_v6.onnx
    β”‚   β”œβ”€β”€ PySide6/                  ← Qt frameworks
    β”‚   β”œβ”€β”€ ctranslate2/              ← CTranslate2 inference engine
    β”‚   └── *.so / *.dylib            ← Python extensions
    β”œβ”€β”€ Resources/
    β”‚   └── app_icon.icns
    └── Frameworks/

Verification Checklist

Check Command Expected
No Homebrew dylibs in ffmpeg otool -L assets/bin/ffmpeg Only /usr/lib/*
libass support assets/bin/ffmpeg -filters | grep ass ass, subtitles
arm64 binary file dist/AutoSubtitle.app/Contents/MacOS/AutoSubtitle arm64
No console window Launch app No terminal opens
Fonts bundled ls dist/AutoSubtitle.app/Contents/MacOS/assets/fonts/ TTF files
VAD model bundled ls dist/AutoSubtitle.app/Contents/MacOS/faster_whisper/assets/ silero_vad_v6.onnx
ffmpeg executable ls -la dist/AutoSubtitle.app/Contents/MacOS/bin/ffmpeg -rwxr-xr-x
Settings no crash First launch on clean machine No crash
Offline operation Disconnect network, run app Works

Whisper Model Notes

Whisper models are downloaded to ~/.cache/huggingface/hub/ on first use. This requires internet on first run per model size.

After the model is cached, the app works fully offline.

Model sizes:

Size VRAM Speed Accuracy
tiny ~75MB Fastest Lower
base ~145MB Fast Good
small ~465MB Medium Better
medium ~1.5GB Slow High
large-v3 ~3GB Slowest Best

Installation (End User)

  1. Open AutoSubtitle-1.0.0-arm64.dmg
  2. Drag AutoSubtitle.app to Applications
  3. Right-click β†’ Open (first launch only, to bypass Gatekeeper)
  4. Select a video file and click Start

Troubleshooting

"App is damaged and can't be opened"

xattr -dr com.apple.quarantine /Applications/AutoSubtitle.app

ffmpeg not found

Ensure assets/bin/ffmpeg exists and is executable before building.

No subtitles / libass error

Verify ffmpeg has libass: assets/bin/ffmpeg -filters 2>&1 | grep ass

Transcription fails

Check ~/Library/Logs/AutoSubtitle/app.log for details.

Popular repositories Loading

  1. riantosandi riantosandi Public

    Config files for my GitHub profile.

    Python