Skip to content

Audio Conversion Configuration

Configuration section: [runtime.audio_conversion]

Overview

When a transcription model cannot read a recording's format, or a speech model cannot write the format a step asks for, Pipelex can convert the recording. This section says whether it does, and with which converter. Conversion is off by default. What converting changes for a run, which steps convert, how a recording's length is measured and where a conversion is kept are described in Audio Conversion.

[runtime.audio_conversion]
backend = "none"
max_source_bytes = 50_000_000

[runtime.audio_conversion.ffmpeg]
binary = "ffmpeg"
timeout_seconds = 300
max_output_bytes = 500_000_000

The values above are the defaults.

[runtime.audio_conversion]

Key Default Meaning
backend "none" Which converter converts: "none" converts nothing, "ffmpeg" runs FFmpeg on this machine, and any other name is a backend a plugin registers with PluginRegistrar.add_audio_converter, such as the hosted platform's converter service. With "none", every check and every step behaves as if conversion did not exist. A name neither the runtime nor a plugin provides stops Pipelex at startup with runtime.misconfigured, listing the backends there are.
max_source_bytes 50_000_000 The largest recording, in bytes, handed to the converter. A larger recording fails the step with input.too_large: one in storage, a local file or a data URL is sized and refused without being read, and one at an http(s) URL is downloaded under this limit, or under [runtime.network] max_fetch_bytes when that is smaller. A recording a step only measures, because its model limits the length, is not refused for it: the model reads it as it is, of unknown length. It must be at least 1.

[runtime.audio_conversion.ffmpeg]

Read only when backend = "ffmpeg". This backend is for a developer's machine and for tests, never for a server converting other people's recordings: FFmpeg runs with the rights of the process running Pipelex and isolates nothing.

Key Default Meaning
binary "ffmpeg" The ffmpeg executable: a name looked up on the PATH, or a path to it. One that is not found stops Pipelex at startup with runtime.misconfigured. Its build needs the encoders of the formats your models read: libopus for Ogg Opus, libmp3lame for MP3.
timeout_seconds 300 How long one conversion or measurement may run before its whole process group is killed, which fails the step with input.too_large. It must be greater than 0.
max_output_bytes 500_000_000 The largest file, in bytes, one conversion writes (-fs). It is its own bound rather than max_source_bytes, since a lossless target writes many times the bytes of the compressed recording it converts: an hour of WAV at 16 kHz mono is about 115 MB. A conversion that passes it fails the step with input.too_large rather than being kept truncated, or with runtime.unexpected for speech a model wrote. It must be at least 1.

Examples

A developer's machine with FFmpeg installed:

[runtime.audio_conversion]
backend = "ffmpeg"

On a distributed deployment, set the same values in every process: the process running a step decides whether it converts, and the process running the step's leaves converts.