tonhowtf/omniget · error
o arquivo não tem trilha de áudio
Error message
o arquivo não tem trilha de áudio
What it means
Silence cutting operates on audio; after probing, cut_one checks whether any stream has codec_type == "audio". If none does, it throws 'o arquivo não tem trilha de áudio' (the file has no audio track). Silence detection without an audio stream is meaningless, so the operation is refused early.
Solutions
- Ensure the input contains an audio track; re-record with an audio source enabled.
- Check with ffprobe -show_streams that an audio stream exists before calling run.
- If the source legitimately has no audio, skip silence cutting rather than calling the API.
Example fix
// before
cut_silences("screen-no-audio.mp4").await?;
// after
let probe = ffmpeg_probe("screen-no-audio.mp4").await?;
if probe.streams.iter().any(|s| s.codec_type == "audio") {
cut_silences("screen-no-audio.mp4").await?;
} Defensive patterns
Strategy: validation
Validate before calling
// Rust
let probe = ffmpeg_probe(input).await?;
anyhow::ensure!(
probe.streams.iter().any(|s| s.codec_type == "audio"),
"entrada sem audio"
); Type guard
fn has_audio(p: &Probe) -> bool {
p.streams.iter().any(|s| s.codec_type == "audio")
} Try / catch
match run(&opts, input).await {
Err(e) if e.to_string().contains("trilha de áudio") => {
eprintln!("pule o corte de silencio: entrada sem audio");
}
r => r?,
} Prevention
- Check audio stream presence with ffprobe before silence cutting
- Record with an audio source enabled when silence cutting is planned
- Treat audio-less files as no-op for this feature instead of errors
When it happens
Trigger: Calling run/cut_one on a video file with video-only streams (muted capture, screen recording without audio device), or an images-only/animation file.
Common situations: OBS or OS capture configured without a microphone/desktop-audio source; stripped audio track after prior processing; passing a GIF or image sequence.
Understand the failure class
Background: "is not a compatible type" / "cannot merge" errors: when a value's type doesn't match what the library requires — this error's family across 65 libraries.
Related errors
- o arquivo não tem trilha de áudio
- ffmpeg nao iniciou
- não consegui medir o loudness
- nenhuma operação escolhida
- {}
AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12).
Data as JSON: /api/errors/4bd585d3c9a92b07.
Report an issue: GitHub.
Appendix: source
Thrown at src-tauri/omniget-core/src/core/tools/silence_cut.rs:228
"null",
"-",
])
.output()
.await
.map_err(|e| anyhow!("ffmpeg nao iniciou: {}", e))?;
Ok(String::from_utf8_lossy(&out.stderr).to_string())
}
async fn cut_one(ffmpeg: &Path, opts: &SilenceOptions, input: &str) -> anyhow::Result<SilenceItem> {
let inp = Path::new(input);
let probe = crate::core::ffmpeg::probe(inp).await?;
let total = probe.duration_seconds;
if total <= 0.0 {
return Err(anyhow!("não consegui medir a duração"));
}
let has_audio = probe.streams.iter().any(|s| s.codec_type == "audio");
if !has_audio {
return Err(anyhow!("o arquivo não tem trilha de áudio"));
}
let stderr = detect(ffmpeg, inp, opts.threshold_db, opts.min_silence).await?;
let spans = parse_spans(&stderr, total);
let (spans, skipped) = cap_spans(spans, MAX_SEGMENTS);
let keeps = keep_ranges(&spans, total, opts.padding.max(0.0));
let kept: f64 = keeps.iter().map(|k| k.duration()).sum();
let mut item = SilenceItem {
input: input.to_string(),
output: None,
duration_before: total,
duration_after: kept,
seconds_removed: (total - kept).max(0.0),
cuts: spans.len(),
skipped_short: skipped,
ok: true,
error: None,View on GitHub (pinned to 8600b91f42)