tonhowtf/omniget · error

o arquivo nao tem faixa de video

Error message

o arquivo nao tem faixa de video

What it means

probe_video inspects a media file via ffmpeg probe and requires at least one stream with codec_type == 'video'. If no video stream exists it throws 'o arquivo nao tem faixa de video' (the file has no video track).

Solutions

  1. Verify the file has a video stream before publishing (ffprobe should show codec_type=video)
  2. Use a real video file (H.264/AAC MP4 is safest for Instagram)
  3. If the intent is audio, use the appropriate publish kind instead of video

Example fix

// before
.ok_or_else(|| anyhow!("o arquivo nao tem faixa de video"))?
// after (caller-side guard)
// if ffprobe streams has no codec_type=="video", reject the file in the UI before calling publish_web
Defensive patterns

Strategy: validation

Validate before calling

let has_video = ffprobe_streams(path).await?.iter().any(|s| s.codec_type == "video");
if !has_video { return Err(anyhow!("o arquivo nao tem faixa de video")); }

Try / catch

match probe_video(path).await { Err(e) if e.to_string().contains("faixa de video") => { eprintln!("not a video file"); None }, r => r.ok() }

Prevention

When it happens

Trigger: publish_web -> probe_video with an audio-only file (MP3, M4A), a cover image, or a container ffmpeg fails to attribute a video codec_type to.

Common situations: User selects an audio file for a video post, a container with only cover art (codec_type 'attached_pic' aside), or a corrupted file where streams are missing.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12). Data as JSON: /api/errors/6b85c571d0b37f41. Report an issue: GitHub.

Appendix: source

Thrown at src-tauri/omniget-core/src/core/tools/instagram/publish.rs:213

        .post_raw(
            &format!("{}/rupload_igvideo/{}", super::BASE, name),
            hd,
            bytes,
        )
        .await?;
    if s(&json, "status") != "ok" {
        return Err(IgError::Other(format!("upload do video: {}", json)));
    }
    Ok(())
}

async fn probe_video(path: &Path) -> anyhow::Result<(u32, u32, u64)> {
    let info = crate::core::ffmpeg::probe(path).await?;
    let stream = info
        .streams
        .iter()
        .find(|s| s.codec_type == "video")
        .ok_or_else(|| anyhow!("o arquivo nao tem faixa de video"))?;
    let duration = if info.duration_seconds > 0.0 {
        info.duration_seconds
    } else {
        stream.duration_seconds.unwrap_or(0.0)
    };
    Ok((
        stream.width.unwrap_or(1080),
        stream.height.unwrap_or(1920),
        (duration * 1000.0) as u64,
    ))
}

/// Extrai um frame como capa do vídeo.
async fn cover_frame(path: &Path) -> anyhow::Result<(Vec<u8>, u32, u32)> {
    let ffmpeg = crate::core::dependencies::ensure_ffmpeg().await?;
    let out = super::super::temp_dir().join(format!("ig-cover-{}.jpg", upload_id()));
    let status = crate::core::process::command(&ffmpeg)
        .args([

View on GitHub (pinned to 8600b91f42)