1.0.1 • Published 1 year ago

ai-sub v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

AI Subtitles

image
Translate text subtitles (including embedded subtitles) to any language using OpenAI's API.

Install

  1. Install ffmpeg: sudo apt install ffmpeg
  2. Install node and npm
  3. Install ai-sub: npm i -g ai-sub
  4. Copy .env.example to .env and edit the values

Usage

ai-sub "path/to/movie.mkv"
or for all files in a directory
ai-sub "path/to/movies/**/*"

Parameters

--debug Print debug information
--batch Batch translation requests using Open AI's Batch API (extremely recommended, allows doing double the requests, but takes a lot more time)
--wait Wait until all jobs are finished (only works with --batch, may take a while)

Options

KeyValueExample
TARGET_LANGUAGETarget language with first letter in upper caseSpanish
TARGET_LANGUAGE_ALIASArray of alias of the target language, comma separatedes,spa,spanish
EXTRA_SPECIFICATIONExtra specification for the translationTranslation must be in Latin American Spanish, not Spain Spanish
MAX_TOKENSMax tokens to send to the model1000
OPENAI_API_KEYOpenAI API keysk-XXX
AI_MODELOpenAI model to use (for better translations use gpt-4, but its 10x more expensive)gpt-3.5-turbo

Credits

This project was inspired by yazinsai/srt-ai

1.0.1

1 year ago

1.0.0

1 year ago