{"record":{"id":"1159574f8f0326f7","repo":"remotion-dev/remotion","slug":"could-not-find-audio-stream-in-src","errorCode":null,"errorMessage":"Could not find audio stream in ${src}","messagePattern":"Could not find audio stream in (.+?)","errorType":"error_code","errorClass":"ErrorWithBacktrace","httpStatus":null,"severity":"error","filePath":"packages/compositor/rust/get_silent_parts.rs","lineNumber":52,"sourceCode":"    Ok(filter)\n}\n\nstruct Transcoder {\n    stream: usize,\n    filter: filter::Graph,\n    decoder: codec::decoder::Audio,\n    in_time_base: ffmpeg::Rational,\n}\n\nfn transcoder(\n    ictx: &mut format::context::Input,\n    src: &str,\n    filter_spec: &str,\n) -> Result<Transcoder, ErrorWithBacktrace> {\n    let input = match ictx.streams().best(media::Type::Audio) {\n        Some(stream) => stream,\n        None => {\n            return Err(ErrorWithBacktrace::from(std::io::Error::new(\n                ErrorKind::Other,\n                format!(\"Could not find audio stream in {}\", src),\n            )));\n        }\n    };\n\n    let context = ffmpeg::codec::context::Context::from_parameters(input.parameters())?;\n    let mut decoder = context.decoder().audio()?;\n\n    decoder.set_parameters(input.parameters())?;\n\n    let filter = filter(filter_spec, &decoder)?;\n\n    let in_time_base = decoder.time_base();\n\n    Ok(Transcoder {\n        stream: input.index(),\n        filter,","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/compositor/rust/get_silent_parts.rs#L34-L70","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Confirm the source actually has an audio track using `ffprobe -i <src>` before invoking the API.","Provide a file that includes audio, or skip silent-parts detection when no audio stream is present.","If audio is expected, rebuild/reinstall ffmpeg with the required audio demuxer and decoder support."],"exampleFix":"// before\nlet transcoder = transcoder(&mut ictx, src, filter_spec)?;\n\n// after\nlet has_audio = ictx.streams().best(media::Type::Audio).is_some();\nif !has_audio {\n    return Ok(/* empty silent parts */ Default::default());\n}\nlet transcoder = transcoder(&mut ictx, src, filter_spec)?;","handlingStrategy":"validation","validationCode":"let has_audio = ictx.streams().best(media::Type::Audio).is_some();\nif !has_audio {\n    return Ok(Default::default()); // no audio => no silent parts\n}","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Probe with ffprobe to confirm an audio stream exists before calling silent-parts APIs.","Surface a clear 'no audio track' message to the user instead of crashing.","Gate silent-detection UI on whether the source has audio."],"tags":["rust","ffmpeg","audio","missing-stream","silent-detection"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}