--- 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 1. Clone the repository: ```sh git clone https://github.com/bradcypert/deepgram-srt-generation.git cd deepgram-srt-generation ``` 2. Install the required dependencies: ```sh pip install -r requirements.txt ``` 3. Set your Deepgram API key as an environment variable: ```sh export DEEPGRAM_API_KEY=your_deepgram_api_key ``` ## Usage Run the script with the path to your video or audio file as an argument: ```sh 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: ```sh 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: ```sh python main.py path/to/your/subtitles.srt -t ja ``` ## Dependencies - `httpx` - `moviepy` - `deepgram` - `deepgram_captions` - `deepl` - `python-dotenv` Make sure to install these dependencies using `pip` if they are not already installed. ## License This project is licensed under the MIT License.