lukemilby / auto-subs

AI Subtitle Generation with custom styling for Davinci Resolve editing software.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Davinci Resolve AI Subtitles

  • Uses AI to generate Text+ subtitles with your own custom style.
  • Works with both the Free and Studio versions of Resolve.
  • Uses OpenAI Whisper and Stable-TS for extremely accurate transcription.
  • This is a Python script that transcribes the current timeline and uses the Davinci Resolve API and Fusion API to add each subtitle to the timeline in Fusion Text+ objects with custom styling.
  • The script is run through the Scripts menu within Resolve.

Run the Script (top menu bar of Resolve): Workspace -> Scripts -> auto-subs

Setup Overview

  1. Install Python 3.10 + OpenAI Whisper (single command using PowerShell script)
  2. Install Stable-TS (single command)
  3. Fix audio backend (single command)
  4. Download + copy auto-subs.py to Fusion Scripts folder.
  5. Navigate to Workspace -> Scripts -> auto-subs in the top menu of Resolve.
UI Preview Subtitle Example
image Subtitle Example

Light Version (standalone - no audio transcription)

  • Simplified version with no audio transcription - no external libraries needed.
  • Generates subtitles on the timeline in your own custom style - given an SRT file.
  • Skip steps 1-3 of the installation guide.
  • Download auto-subs-light.py instead of auto-subs.py.

Important Notes

  • Only compatible with Python 3.8 - 3.11 - verified working on 3.10.11.
  • Make sure to tick set environment variables or Add python.exe to PATH during manual Python installation on Windows so that Davinci Resolve can find the Python interpreter.
  • The included Powershell script will set these environment variables automatically.
  • Verify that Resolve detects the Python installation by opening the Console and clicking py3 at the top.

Installation Guide

Step 1: Install Python + Whisper

Automatic Install only for Windows:

Download this script whisper.ps1 by clicking Download Raw File in the top right. This script will install Python (if not already installed) + OpenAI Whisper and all of its dependencies. To run it, open Powershell in administrator mode and run the following command. About Script

iex (irm whisper.tc.ht)

Manual Install for Mac, Linux and Windows:

Install Python version 3.10 or less - make sure to tick set environment variables or Add python.exe to PATH during installation on Windows. Then you need to follow this installation guide to install Whisper and its dependencies.

Step 2: Install Stable-TS

Stable-TS modifies Whisper for more accurate timestamps.

pip install -U git+https://github.com/jianfch/stable-ts.git

Step 3: Fix audio backend (may not be needed)

# on Windows
pip install soundfile 

# on Linux
pip install sox

Step 4: Download the Script

Download auto-subs.py (top right), and drag it into the Utility folder within the Fusion Scripts folder. The directory should look like this:

...\Blackmagic Design\DaVinci Resolve\Fusion\Scripts\Utility

Step 5: Run the Script

Click Workspace in the top menu bar of Davinci Resolve, then click Scripts, and there you should see auto-subs in the list.

Workspace -> Scripts -> auto-subs

Help

If you encounter issues installing OpenAI Whisper, this video may help you (Only the first 6 minutes are necessary).

If you want to make your own Python script for Davinci Resolve, DON'T. It's not worth it, the documentation is literally hell.

About

AI Subtitle Generation with custom styling for Davinci Resolve editing software.

License:MIT License


Languages

Language:Python 77.7%Language:PowerShell 22.3%