Skip to main content
To build a scalable video transcription product, you need to handle large file uploads, manage socket connections for real-time progress, integrate speech-to-text and language models, wrangle rate-limits, etc. As you scale to many users, infrastructure becomes the hardest art: you must orchestrate jobs, scale horizontally, balance load across model providers, pool connections, and handle failures gracefully. Most teams spend more time building infrastructure than focusing on their product. This guide walks through building a highly scalable agentic product that automatically transcribes videos and translates transcripts to English.
The complete source code is available in Autonomy examples.
The Autonomy Computer provides all of this infrastructure. You get access to speech-to-text models like gpt-4o-transcribe-diarize for transcription with speaker identification, language models for translation agents, built-in HTTP and WebSocket servers for uploads with streaming progress, and a runtime that handles deployment and scaling automatically.

How it works

When a video is uploaded (via the web UI or Box webhook), the service:
  1. Extracts audio - Uses ffmpeg to extract audio chunks from the video.
  2. Transcribes with diarization - Uses gpt-4o-transcribe-diarize to identify different speakers.
  3. Matches speakers - For long videos, an agent analyzes context to unify speaker labels across chunks.
  4. Translates - A translator agent converts the transcript to English while preserving speaker labels.
  5. Returns results - Provides both the original transcript and English translation.

Quick start

1

Sign up and install the autonomy command

Complete the steps to get started with Autonomy.
2

Get the example code

/dev/null/terminal.sh
This creates the following structure:
File Structure:
3

Deploy

/dev/null/terminal.sh
Once deployed, open your zone URL in a browser to access the upload interface.

Configure Box integration (optional)

The service can automatically process videos uploaded to a Box folder.
1

Get Box API credentials

Create a Box application at app.box.com/developers/console:
  1. Create a new Custom App with Server Authentication (Client Credentials Grant).
  2. Note your Client ID, Client Secret, and Enterprise ID.
  3. Authorize the application in your Box admin console.
2

Create secrets.yaml

Copy secrets.yaml.example and fill in your credentials:
secrets.yaml
Find the folder ID in the Box web UI — it’s the ID in the URL when viewing a folder.
3

Redeploy

/dev/null/terminal.sh
The service automatically creates a Box webhook when it starts. Videos uploaded to the configured folder are processed and results are uploaded back as markdown files.

Learn how it works

Transcription with speaker diarization

The service uses gpt-4o-transcribe-diarize for transcription with automatic speaker identification:
images/main/transcribe.py
The diarization model returns segments with speaker labels:

Chunked processing for long videos

For videos longer than 5 minutes, the service processes audio in chunks to stay within API limits:
images/main/transcribe.py

Speaker matching across chunks

When a video is split into chunks, the same speaker may get different labels in each chunk. An agent analyzes the transcript to unify speaker labels:
images/main/speakers.py
The mapping is applied programmatically for efficiency:
images/main/speakers.py

Translation agent

The translator agent converts transcripts to English while preserving speaker labels:
images/main/translate.py
For long transcripts, the translator processes chunks at speaker boundaries:
images/main/translate.py

Box webhook integration

The service registers a webhook with Box to automatically process uploaded videos:
images/main/main.py
Results are uploaded back to Box as markdown files alongside the original video.

WebSocket uploads with progress

The web interface uses WebSocket for chunked uploads with real-time progress:
images/main/upload.py

Processing queue

The service queues videos to process one at a time, preventing resource exhaustion:
images/main/jobs.py
Clients waiting in the queue receive position updates:
images/main/upload.py

API reference

POST /webhook/box

Receives Box webhook notifications. Automatically registered when Box credentials are configured.

WebSocket /ws/upload

Upload videos via WebSocket with progress updates. Messages from client:
  • {"type": "start", "filename": "video.mp4", "size": 12345, "total_chunks": 10}
  • Binary chunk data
  • {"type": "end"}
Messages from server:
  • {"type": "ready"} - Ready to receive chunks
  • {"type": "chunk_ack"} - Chunk received
  • {"type": "status", "message": "Processing...", "percent": 50}
  • {"type": "result", "success": true, "original_transcript": "...", "english_translation": "..."}

GET /queue/status

Returns current processing queue status.

GET /health

Health check endpoint.
Learn more

Models

Available models for transcription and translation.

Agents

Build agents with custom instructions and tools.

Programming Interfaces

Create APIs for Autonomy applications.

Box Integration

Build voice agents for Box documents.
Troubleshoot
  • Reduce MAX_CHUNK_DURATION to process smaller audio segments.
  • Use size: big in your pod configuration for more resources.
  • Ensure the video file isn’t corrupted.
  • The speaker matcher works best with clear speaker introductions.
  • For videos with many speakers, results may vary.
  • Check the matcher’s confidence level in the logs.
  • Verify the webhook URL is publicly accessible.
  • Check Box admin console for webhook status.
  • Ensure the Box app has proper permissions.
  • Translation is chunked at ~15,000 characters per request.
  • Consider using a faster model for initial testing.
  • Check your zone logs for timeout errors.