Home → Blog → Preparing audio for transcription: ffmpeg recipes
Preparing audio for transcription: ffmpeg recipes
Half of all transcription problems are solved before the request is ever sent — while preparing the file. Below is a set of ffmpeg commands that covers nearly every case: video instead of audio, stereo instead of mono, an hour of silence at the end, and files that will not fit the limit.
Extract audio from video
Meeting recordings, webinars and screen captures usually arrive as mp4. The video track is dead weight for recognition:
ffmpeg -i meeting.mp4 -vn -ac 1 -ar 16000 -c:a libopus -b:a 24k meeting.ogg
A ninety-minute recording drops from about 1.5 GB to roughly 15 MB and uploads in seconds.
Split speakers by channel
If your telephony records agent and customer into separate stereo channels, that is a free path to perfect speaker attribution without any diarisation:
ffmpeg -i call.wav -map_channel 0.0.0 agent.ogg -map_channel 0.0.1 customer.ogg
Transcribe both files separately and interleave the utterances by timestamp — you get a dialogue with exact attribution.
Trim edges and silence
Recorder files often start ten minutes before anyone speaks. Cut by time:
ffmpeg -i raw.ogg -ss 00:09:30 -to 01:12:00 -c copy trimmed.ogg
Remove long pauses inside the recording:
ffmpeg -i raw.ogg -af silenceremove=stop_periods=-1:stop_duration=2:stop_threshold=-40dB clean.ogg
Know the price of that last one: timestamps in the result no longer match the original recording. If you plan to jump back into the video, leave the pauses alone.
Split a long recording
Fixed 15-minute chunks:
ffmpeg -i long.ogg -f segment -segment_time 900 -c copy part%03d.ogg
Simple, but it will eventually cut a word in half. To cut on pauses, find the silence first:
ffmpeg -i long.ogg -af silencedetect=noise=-35dB:d=1 -f null - 2>&1 | grep silence_end
Use those marks as chunk boundaries and no sentence is ever torn apart, so the merged transcript reads as one piece.
Try it on your own recordings. Sign-up takes a minute, and the free minutes are enough to judge the quality.
Get a free API keyFrequently asked questions
Do I have to downmix to mono?
Not required, but it halves the file with no effect on the result. Keep stereo only when speakers sit in separate channels.
Why 16 kHz specifically?
That is the sample rate the model works at; anything higher is resampled internally. Sending 48 kHz just spends bandwidth on data that gets discarded.
Does opus compression hurt accuracy?
At 24 kbps mono the transcript is effectively identical — the codec is built for voice. Losses become visible below 16 kbps.
How do I merge transcripts of split parts?
Sort parts by the number in the filename and concatenate in that order. For continuous timestamps, add each chunk's start offset to its segment times.
Related reading
- Which audio format to use for speech recognition — mp3, wav, ogg, opus, m4a and webm for speech recognition: what bitrate changes, why mono at 16 kHz is enough and how to stay under the size limit.
- How to transcribe a recording that does not fit one request — What to do with multi-hour audio: compression, splitting on pauses, processing chunks in parallel and merging one transcript with continuous timestamps.
- Who said what: separating speakers in a transcript — Why a single mixed recording does not come back labelled by speaker, and four practical ways to get the split anyway — from multitrack recording to channel separation.