Spaces:
Running
A newer version of the Gradio SDK is available: 6.20.0
title: Deepgram SRT Generator
emoji: 🎙️
colorFrom: indigo
colorTo: purple
sdk: gradio
sdk_version: 6.18.0
app_file: app.py
pinned: false
license: mit
Deepgram SRT Generation
This project extracts audio from a video file, sends it to Deepgram for transcription, and generates an SRT file with captions.
Setup
Clone the repository:
git clone https://github.com/bradcypert/deepgram-srt-generation.git cd deepgram-srt-generationInstall the required dependencies:
pip install -r requirements.txtSet your Deepgram API key as an environment variable:
export DEEPGRAM_API_KEY=your_deepgram_api_key
Usage
Run the script with the path to your video or audio file as an argument:
python main.py path/to/your/file.mp4
This will generate an SRT file with captions in the same directory as your media file.
CLI Options
You can customize the transcription with the following flags:
-m/--model: Deepgram model to use (default:nova-3).-l/--language: Set the language tag (e.g.ko,en,es).--no-diarize: Disable speaker diarization.-t/--translate-to: Translate the generated subtitles using DeepL.
Example transcribing Korean audio and translating it to English:
export DEEPL_API_KEY=your_deepl_api_key
python main.py path/to/your/korean_audio.mp3 -l ko -t en
Translate-Only Mode
If you already have an SRT file and want to translate it to another language without transcribing again, simply pass the .srt file and target language:
python main.py path/to/your/subtitles.srt -t ja
Dependencies
httpxmoviepydeepgramdeepgram_captionsdeeplpython-dotenv
Make sure to install these dependencies using pip if they are not already installed.
License
This project is licensed under the MIT License.