Local web tool that transcribes the speech in a video (or audio) file to text, optimized for speed using Azure AI Speech Fast Transcription (transcribes much faster than real time, in one synchronous request).
browser ──upload──▶ FastAPI ──ffmpeg──▶ 16kHz mono WAV ──REST──▶ Azure Fast Transcription ──▶ text
ffmpegis provided by theimageio-ffmpegpip package — no system install / sudo.- Language is chosen in the page: English, Japanese, or Auto-detect (both).
cd /home/devx/Documents/audio-extracting
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt.env must contain (already set):
AZURE_SPEECH_KEY=<your key>
AZURE_SPEECH_REGION=eastus
OPENAI_API_KEY=<your key> # for the "Analyze" feature
OPENAI_MODEL=gpt-4o-mini # optional, defaults to gpt-4o-mini
Below the transcript there's an Analyze the transcript with AI panel: type a
prompt (e.g. "Summarize in 5 bullets", "Extract action items", "Translate to
English") and the current transcript + your prompt are sent to OpenAI
(POST /analyze); the answer shows in a copyable box.
python app.pyOpen http://127.0.0.1:8765 — pick the language, choose a file, click Transcribe.
GET /health confirms the key/region are loaded.
The image bundles ffmpeg + the app. Your .env is not baked into the image —
it's loaded at runtime, so secrets stay out of the image layers.
# build + start (reads .env for the Azure key/region)
docker compose up -d --build
# open http://127.0.0.1:8765
docker compose logs -f # view logs
docker compose down # stopOr with plain Docker:
docker build -t video-to-text .
docker run --rm -p 8765:8765 --env-file .env video-to-textNotes:
- The container binds to
0.0.0.0:8765internally; the host reaches it onhttp://127.0.0.1:8765via the published port. .envis in.dockerignore, so it's never copied into the image — pass it withenv_file:(compose) or--env-file(docker run) instead.
- Fast Transcription handles files up to ~2 hours / 300 MB per request. For longer videos you'd split the audio into chunks (not yet implemented).
- The
.envkey is a secret — it's gitignored here. Rotate it in the Azure portal if it has been exposed. - Region must be
eastus(or wherever your Speech resource lives); it sets the endpoint.