remotion-dev/remotion · error · ErrorWithBacktrace

Could not find audio stream in ${src}

Error message

Could not find audio stream in ${src}

What it means

Thrown by the transcoder in get_silent_parts.rs when ffmpeg's input context has no stream of media::Type::Audio. Remotion's silent-parts detection operates exclusively on audio, so a file without an audio track cannot be analyzed.

Source

Thrown at packages/compositor/rust/get_silent_parts.rs:52

    Ok(filter)
}

struct Transcoder {
    stream: usize,
    filter: filter::Graph,
    decoder: codec::decoder::Audio,
    in_time_base: ffmpeg::Rational,
}

fn transcoder(
    ictx: &mut format::context::Input,
    src: &str,
    filter_spec: &str,
) -> Result<Transcoder, ErrorWithBacktrace> {
    let input = match ictx.streams().best(media::Type::Audio) {
        Some(stream) => stream,
        None => {
            return Err(ErrorWithBacktrace::from(std::io::Error::new(
                ErrorKind::Other,
                format!("Could not find audio stream in {}", src),
            )));
        }
    };

    let context = ffmpeg::codec::context::Context::from_parameters(input.parameters())?;
    let mut decoder = context.decoder().audio()?;

    decoder.set_parameters(input.parameters())?;

    let filter = filter(filter_spec, &decoder)?;

    let in_time_base = decoder.time_base();

    Ok(Transcoder {
        stream: input.index(),
        filter,

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Confirm the source actually has an audio track using `ffprobe -i <src>` before invoking the API.
  2. Provide a file that includes audio, or skip silent-parts detection when no audio stream is present.
  3. If audio is expected, rebuild/reinstall ffmpeg with the required audio demuxer and decoder support.

Example fix

// before
let transcoder = transcoder(&mut ictx, src, filter_spec)?;

// after
let has_audio = ictx.streams().best(media::Type::Audio).is_some();
if !has_audio {
    return Ok(/* empty silent parts */ Default::default());
}
let transcoder = transcoder(&mut ictx, src, filter_spec)?;
Defensive patterns

Strategy: validation

Validate before calling

let has_audio = ictx.streams().best(media::Type::Audio).is_some();
if !has_audio {
    return Ok(Default::default()); // no audio => no silent parts
}

Type guard

null

Try / catch

null

Prevention

When it happens

Trigger: Calling get_silent_parts (silent-section detection) on a video file that contains only a video stream, or on a container whose audio stream is not recognized by the ffmpeg build. Also occurs when the input path points to an image sequence or video-only clip.

Common situations: Passing a muted/screen-recording clip to an audio analysis pipeline; using an ffmpeg build compiled without a needed audio demuxer/decoder; pointing at the wrong file path that resolves to a video-only asset.

Related errors


AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12). Data as JSON: /api/errors/1159574f8f0326f7. Report an issue: GitHub.