Whisper Integration
Transcribe Pixeltable Audio columns with OpenAI Whisper running locally. No API key. Split long files, then cache text per segment.
Challenge
Whisper runs locally and needs no API key. Production still needs the audio on a row, a split for long files, and a place to keep the transcript with timestamps. A script that loads each file, calls whisper.transcribe, and writes a .txt next to it will re-run completed files unless you add a cache. Hosted openai.transcriptions is a different UDF and a different bill. Pixeltable already has pxt.Audio. The integration is pixeltable.functions.whisper.transcribe plus audio_splitter when the file is longer than a single Whisper window.
Solution
pip install pixeltable openai-whisper. Assign transcribe(audio, model=base.en) on the class, then text = result.text. Models ending in .en are English-only and faster; drop .en for multilingual. For long files, declare a view with audio_splitter(duration=30.0) and transcribe audio_segment on that view. Inserting a video extracts the audio track. There is no OpenAI API key on this path. ffmpeg must be on PATH. The documented how-to for searchable transcripts also embeds the text; this page is the Whisper UDF itself. Hosted Whisper-1 is pixeltable.functions.openai.transcriptions, a different import.
Integration Steps
Step 1 of 4A path string is not enough. Splitting and Whisper need a typed column.
import pixeltable as pxtfrom pixeltable.functions.audio import audio_splitterfrom pixeltable.functions.whisper import transcribeTableModel = pxt.model_base()class Recordings(TableModel, name='recordings'):title: pxt.Stringaudio: pxt.Audio# pxt schema update app.py whisper_lib -f
💡 Insert local paths, https://, or s3:// URIs. A video file is valid: Pixeltable extracts the audio track. openai-whisper and ffmpeg are required.
Key Benefits
Use Cases
Technical Requirements
Learn More
Related articles
Ready to Integrate Whisper?
Get started with Pixeltable and Whisper in minutes.
pip install pixeltable