tonhowtf/omniget · error
a legenda nao tem falas
Error message
a legenda nao tem falas
What it means
dub() reads the SRT subtitle file, parses it into cues, and filters out cues whose text is empty or whitespace-only. If no non-empty cues remain, it refuses to proceed and throws the Portuguese message 'a legenda nao tem falas' ('the subtitle has no lines'). The library throws this because dubbing audio for zero spoken lines is a no-op and would produce a broken/empty output pipeline.
Solutions
- Check the SRT file before dubbing: ensure it is a valid, non-empty SubRip file with at least one cue containing dialogue text.
- Verify opts.srt_path points to the correct subtitle file for the target media.
- If the file is VTT or another format, convert it to SRT (e.g. ffmpeg -i subs.vtt subs.srt) before calling dub.
- Strip HTML/formatting tags or fix the encoding (UTF-8 without BOM) so cues parse with non-empty text.
Defensive patterns
Strategy: validation
Validate before calling
let srt = tokio::fs::read_to_string(&opts.srt_path).await?;
let has_dialogue = parse_cues(&srt).iter().any(|c| !c.text.trim().is_empty());
if !has_dialogue {
anyhow::bail!("SRT at {} has no non-empty cues; refusing to dub", opts.srt_path.display());
} Try / catch
match dub(opts).await {
Err(e) if e.to_string().contains("nao tem falas") => {
// prompt user to select a dialogue-bearing subtitle file
}
other => other?,
} Prevention
- Validate SRT files (parse cue count) before offering the dub action in the UI.
- Ensure subtitle files are genuine SubRip format (numbered cues, '-->' timestamps), not VTT or stub files.
- Strip HTML tags and re-encode to UTF-8 so text survives the empty-text filter.
- Log the cue count after parsing so empty parses are caught at ingest time.
When it happens
Trigger: Calling dub with opts.srt_path pointing at an SRT file that is empty, contains only sequence/timestamp lines with blank text, contains only whitespace cues, or does not parse into any Cue at all (malformed SRT yielding zero cues).
Common situations: Passing a subtitle file downloaded as an empty stub or ads/notes-only file; passing the wrong file path so a placeholder/empty SRT is read; using an SRT format (e.g. WebVTT or with BOM/HTML tags) the parser cannot read, so parse_cues returns nothing; subtitles that contain only formatting tags stripped to whitespace.
Understand the failure class
Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.
Related errors
- informe um appid, um link da loja ou marque a biblioteca int
- texto vazio
- escolha ao menos uma imagem
- nenhuma imagem
- marque pelo menos um trecho antes de enviar
AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12).
Data as JSON: /api/errors/4745ca741e4e468a.
Report an issue: GitHub.
Appendix: source
Thrown at src-tauri/omniget-core/src/core/tools/dub.rs:72
s /= 2.0;
}
while s < 0.5 {
parts.push("atempo=0.5".to_string());
s /= 0.5;
}
parts.push(format!("atempo={:.4}", s));
parts.join(",")
}
pub async fn dub(opts: DubOptions, progress: super::ProgressFn) -> anyhow::Result<DubResult> {
let id = "dub";
let srt = tokio::fs::read_to_string(&opts.srt_path).await?;
let cues: Vec<Cue> = parse_cues(&srt)
.into_iter()
.filter(|c| !c.text.trim().is_empty())
.collect();
if cues.is_empty() {
return Err(anyhow!("a legenda nao tem falas"));
}
let ffmpeg = crate::core::dependencies::ensure_ffmpeg().await?;
let work = super::temp_dir().join(format!("dub-{}", uuid::Uuid::new_v4()));
std::fs::create_dir_all(&work)?;
let out_dir = if opts.output_dir.trim().is_empty() {
Path::new(&opts.srt_path)
.parent()
.map(|p| p.to_path_buf())
.unwrap_or_else(|| PathBuf::from("."))
} else {
PathBuf::from(opts.output_dir.trim())
};
std::fs::create_dir_all(&out_dir)?;
let stem = Path::new(&opts.srt_path)
.file_stem()
.map(|s| s.to_string_lossy().to_string())
.unwrap_or_else(|| "dublagem".into());
View on GitHub (pinned to 8600b91f42)