A Go application for transcribing video files using AssemblyAI API.
- Video to text transcription
- Audio extraction from video files
- Translation capabilities
- Clone the repository
- Set up your AssemblyAI API key in
.env
file - Run
go build ./...
# Transcribe video file to database
./bin/savetodb -input video.mp4
# Translate text
./bin/translate -text "text to translate"
- Go 1.24+
- FFmpeg
- AssemblyAI API key
# Run all tests
go test ./...
# Run linter
golangci-lint run ./...
# Format code
gofmt -s -w .
# Run with coverage
go test -cover ./...
git clone https://github.com/eshesh/assemblyai-transcriber.git
cd assemblyai-transcriber
- Install dependencies:
go mod download
- Build the application (options):
# Main application
go build -o assemblyai-transcriber cmd/main.go
# Or build specific components:
go build -o checkdb cmd/checkdb/main.go
go build -o translate cmd/translate/main.go
The application supports multiple configuration methods:
- Environment variables - Highest priority
- .env file - Recommended for local development
- Command-line flags - Override specific settings
Create .env
file from template:
# Required
ASSEMBLYAI_API_KEY=your_assemblyai_key
OPENROUTER_API_KEY=your_openrouter_key
# Optional
DATABASE_PATH=./transcriptions.db # SQLite database path
LOG_LEVEL=info # debug/info/warn/error
AUDIO_CACHE_DIR=./audio_cache # Temporary audio files
Usage ▶️
Usage:
./assemblyai-transcriber [flags] <input-file>
Flags:
-db string
Path to SQLite database file (default "./transcriptions.db")
-openrouter-key string
OpenRouter API key
-save-transcript string
Save transcript to file
-save-translation string
Save translation to file
-translate
Enable translation after transcription
-v Enable verbose logging
Options:
-db string
Path to SQLite database file
-openrouter-key string
OpenRouter API key
-save-transcript string
Save transcript to file (specify filename)
-save-translation string
Save translation to file (specify filename)
-translate
Enable translation after transcription
Examples ↑
# Basic transcription
./assemblyai-transcriber input.mp4
# With translation
./assemblyai-transcriber -translate input.mp4
# Save outputs to files
./assemblyai-transcriber -translate \
-save-transcript transcript.txt \
-save-translation translation.txt \
input.mp4
# Use specific database
./assemblyai-transcriber -db ./custom.db input.mp4
- Audio Extraction - FFmpeg converts video to audio
- Transcription - AssemblyAI processes audio to text
- Term Analysis - Identifies specialized terms
- Term Management - Interactive term review:
- Accept all terms
- Reject all terms
- Review terms individually
- Edit terms manually
- Translation - Llama 4 Maverick translates to Russian
- Storage - Results saved to SQLite database
Found 5 specialized terms:
1. API (Application Programming Interface)
2. SQLite (Embedded database)
...
Choose action:
[1] Accept all terms
[2] Reject all terms
[3] Review terms
[4] Edit terms
Database schema is managed using goose and migration files in the migrations/
directory.
make migrate-up
make migrate-down
make migrate-status
By default, migrations are applied to the data.db
file in the project root (you can change the path in the Makefile).
Project structure:
.
├── cmd/ # CLI commands
│ ├── main.go # Main app
│ ├── checkdb/ # DB validation
│ └── translate/ # Translation module
├── internal/ # Core packages
│ ├── config/ # Configuration
│ ├── database/ # DB operations
│ └── ... # Other components
├── go.mod # Dependencies
└── go.sum
Key packages:
internal/config
- Configuration loadinginternal/database
- SQLite operationsinternal/openrouter
- Translation API clientinternal/terms
- Term analysis logic
Build and test:
# Run tests
go test ./...
# Build with debug symbols
go build -gcflags="all=-N -l" -o assemblyai-transcriber cmd/main.go
MIT License - See LICENSE for details.
Issue | Solution |
---|---|
FFmpeg not found | Install FFmpeg and add to PATH |
API errors | Verify keys in .env file |
Database locked | Close other instances using DB |
Translation fails | Check OpenRouter quota |
- Fork the repository
- Create your feature branch (
git checkout -b feature/foo
) - Commit your changes (
git commit -am 'Add some foo'
) - Push to the branch (
git push origin feature/foo
) - Create a new Pull Request
Please follow the code conventions.