Service: Subtitle Generator - EyevinnOSC/community GitHub Wiki

Getting Started

The Subtitle Generator is an open web service that uses Open AI Whisper to generate subtitles for a video or audio file. A compressed audio file is created and split into smaller chunks with time code information preserved. This makes it possible to combine all subtitle segments into one subtitle file with correct timing information. It attempts to produce more professional-looking subtitles that are easier to read and follow industry standards for broadcast and streaming platforms. This tutorial walks you through how you quickly can get started with automatic subtitling in Eyevinn Open Source Cloud.

Prerequisites

  • If you have not already done so, sign up for free for an Eyevinn OSC account.
  • An OpenAI account and API key.

Step 1: Create secrets

Navigate to the Subtitle Generator service in the Eyevinn Open Source Cloud web console. Click on the tab Service Secrets and create a service secret for the Open AI API key.

Skärmavbild 2025-02-20 kl  23 57 09

Step 2: Create a storage bucket

Follow this guide to create a storage bucket for the video files and another bucket for the generated subtitle files.

% mc ls vodsvcinput/
[2025-02-20 22:02:02 CET]     0B autosubs/
[2025-02-20 21:00:16 CET]     0B subs/

Step 3: Create a Subtitle Generator

Go to the tab "My generators" and click on the button "Create generator". Enter the following in the create instance dialog:

Skärmavbild 2025-02-21 kl  00 01 59

  • Name: the name of your generator
  • Openaikey: the OpenAI API key
  • AwsAccessKeyId: access key id for the S3 buckets
  • AwsSecretAccessKey: secret access key for the S3 buckets
  • AwsRegion: for AWS S3 buckets provide in which region the buckets are
  • S3Endpoint: for non AWS S3 buckets provide the server endpoint (for example a MinIO instance)

Now press the button create.

Step 4: Generate subtitles

Click on the three dots on the instance card and open the menu. Click on the menu item "Open API Docs".

Skärmavbild 2025-02-21 kl  00 04 25

Now you are presented with the API documentation that you can use to try this out. Select the accordion /transcribe/s3 and as an example enter the following values.

Skärmavbild 2025-02-21 kl  00 05 39

{
  "url": "s3://autosubs/osc-sprint-27.mp4",
  "language": "en",
  "format": "srt",
  "bucket": "subs",
  "key": "osc-sprint-27_en1"
}

This will create subtitles for the file osc-scprint-27.mp4 available on the S3 bucket autosubs. It will transcribe and translate to English (if spoken language is not English). The subtitles will be written to a file on a bucket called subs and in the SubRip format (SRT). The file will be called osc-sprint-27_en1.srt.

Press the button "Execute" and wait a few minutes. When the job has finished the subtitle file will be placed in the S3 bucket that you specified.

% mc ls guide/subs/
[2025-02-20 23:26:54 CET]  17KiB STANDARD osc-sprint-27_en1.srt

We can open the video file and the generated subtitle file in VLC to check the result.

Skärmavbild 2025-02-21 kl  00 13 01

In the above example the language spoken in the video was Swedish and as we specified we wanted subtitles in English it has not only transcribed but also translated the subtitles.