feat: Configurable external transcription command for audio/video
Problem
Ductor's built-in audio transcription uses Python whisper (or the bundled approach). However, many users prefer alternative transcription backends:
whisper-cli(C++ / faster-whisper) — faster, lower memorywhisper.cpp— Apple Silicon optimized- Custom pipelines (e.g. ffmpeg pre-processing → whisper)
Currently the only way to use a custom transcription script is to replace transcribe_audio.py in the tools directory after every upgrade.
Proposed solution
Add a config option to point to a custom transcription script:
"transcription": {
"command": "~/.ductor/workspace/user_tools/my_transcribe.py"
}
The custom script would receive the audio file path as argument and return the transcript text to stdout. If not set, fall back to the built-in transcription.
Same approach could apply to video processing (process_video.py) for users who want custom video-to-text pipelines.
Why
This is a common customization need — especially for users on Apple Silicon who use whisper-cli with CoreML for near-instant transcription. A config hook would make this upgrade-proof without patching tool files directly.
totally agree on making this configurable. we built a transcription service for a macOS agent app and the difference between Python whisper and whisper.cpp with CoreML on Apple Silicon is night and day - like 10-15x faster for the same model size. having to patch tool files after every upgrade is painful.
for the interface, stdin/stdout with the audio file path as arg is the simplest and most portable option. one thing worth considering is passing the model size hint as a second arg or env var, so the custom script can pick the right model without hardcoding it. our transcription pipeline accepts a model preference (tiny/base/small/medium/large) and maps it to whatever backend is configured.
the video processing hook is a good idea too. ffmpeg pre-processing (noise reduction, normalization, splitting long files into chunks) before transcription made a huge difference in accuracy for meeting recordings. we ended up with a two-stage pipeline where audio gets pre-processed first, then fed to the transcription backend.
our transcription service implementation with configurable model backends and the pre-processing pipeline: https://github.com/m13v/fazm/blob/main/Desktop/Sources/TranscriptionService.swift
Shipped in v0.16.0.
Added transcription.audio_command and transcription.video_command config keys. When set, they hand off to your preferred binary via the DUCTOR_TRANSCRIBE_COMMAND / DUCTOR_VIDEO_TRANSCRIBE_COMMAND env-var hand-off. When unset, the bundled transcription strategy still runs — existing users see zero change. Plumbed through CLIServiceConfig so the hand-off survives subprocess boundaries.