A simple tool to automatically transcribe audio and video files using Deepgram's AI.
- Transcribes all audio/video files in a folder
- Saves transcriptions as text files in the same folder
- Can identify different speakers (diarization)
- Supports: MP4, MP3, WAV, M4A, FLAC, OGG, WEBM
- Go to console.deepgram.com
- Create a free account (includes $200 free credit)
- Go to "API Keys" and create a new key
- Copy the key somewhere safe
Mac: Open Terminal and run:
brew install python
Windows: Download from python.org and install.
Open Terminal (Mac) or Command Prompt (Windows), then:
cd /path/to/this/folder
python3 -m venv venv
source venv/bin/activate
pip install requests
Open Terminal, navigate to this folder, then:
source venv/bin/activate
python3 transcribe.py /path/to/your/videos --api-key YOUR_API_KEY
Replace:
/path/to/your/videoswith the folder containing your filesYOUR_API_KEYwith your Deepgram API key
If your audio has multiple speakers:
python3 transcribe.py /path/to/your/videos --api-key YOUR_API_KEY --diarization
For better accuracy, specify the language:
python3 transcribe.py /path/to/your/videos --api-key YOUR_API_KEY --lang es
Common language codes:
en= Englishes= Spanishfr= Frenchde= Germanpt= Portugueseit= Italian
Transcribe Spanish videos with speaker identification:
python3 transcribe.py ~/Desktop/my-recordings --api-key abc123 --diarization --lang es
For each file like interview.mp4, you'll get interview.txt containing:
[Speaker 0]: Hello, welcome to the show.
[Speaker 1]: Thank you for having me.
[Speaker 0]: Let's start with your background.
| Option | What it does |
|---|---|
--diarization or -d |
Identify different speakers |
--lang XX or -l XX |
Set language (e.g., en, es, fr) |
--ext XX or -e XX |
Change output extension (default: txt) |
--api-key XX or -k XX |
Your Deepgram API key |
"No module named requests"
→ Run: source venv/bin/activate && pip install requests
"command not found: python3" → Install Python (see Setup Step 2)
"API Error: 401" → Check your API key is correct
"No supported audio/video files found" → Make sure your files end in .mp4, .mp3, .wav, etc.
To avoid typing your API key every time:
- Create a file called
.envin this folder - Add this line:
DEEPGRAM_API_KEY=your_key_here - Now you can run without
--api-key:source venv/bin/activate source .env python3 transcribe.py /path/to/videos --diarization