{"record":{"id":"6b85c571d0b37f41","repo":"tonhowtf/omniget","slug":"o-arquivo-nao-tem-faixa-de-video","errorCode":null,"errorMessage":"o arquivo nao tem faixa de video","messagePattern":"o arquivo nao tem faixa de video","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/instagram/publish.rs","lineNumber":213,"sourceCode":"        .post_raw(\n            &format!(\"{}/rupload_igvideo/{}\", super::BASE, name),\n            hd,\n            bytes,\n        )\n        .await?;\n    if s(&json, \"status\") != \"ok\" {\n        return Err(IgError::Other(format!(\"upload do video: {}\", json)));\n    }\n    Ok(())\n}\n\nasync fn probe_video(path: &Path) -> anyhow::Result<(u32, u32, u64)> {\n    let info = crate::core::ffmpeg::probe(path).await?;\n    let stream = info\n        .streams\n        .iter()\n        .find(|s| s.codec_type == \"video\")\n        .ok_or_else(|| anyhow!(\"o arquivo nao tem faixa de video\"))?;\n    let duration = if info.duration_seconds > 0.0 {\n        info.duration_seconds\n    } else {\n        stream.duration_seconds.unwrap_or(0.0)\n    };\n    Ok((\n        stream.width.unwrap_or(1080),\n        stream.height.unwrap_or(1920),\n        (duration * 1000.0) as u64,\n    ))\n}\n\n/// Extrai um frame como capa do vídeo.\nasync fn cover_frame(path: &Path) -> anyhow::Result<(Vec<u8>, u32, u32)> {\n    let ffmpeg = crate::core::dependencies::ensure_ffmpeg().await?;\n    let out = super::super::temp_dir().join(format!(\"ig-cover-{}.jpg\", upload_id()));\n    let status = crate::core::process::command(&ffmpeg)\n        .args([","sourceCodeStart":195,"sourceCodeEnd":231,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/instagram/publish.rs#L195-L231","documentation":"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).","triggerScenarios":"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.","commonSituations":"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.","solutions":["Verify the file has a video stream before publishing (ffprobe should show codec_type=video)","Use a real video file (H.264/AAC MP4 is safest for Instagram)","If the intent is audio, use the appropriate publish kind instead of video"],"exampleFix":"// before\n.ok_or_else(|| anyhow!(\"o arquivo nao tem faixa de video\"))?\n// after (caller-side guard)\n// if ffprobe streams has no codec_type==\"video\", reject the file in the UI before calling publish_web","handlingStrategy":"validation","validationCode":"let has_video = ffprobe_streams(path).await?.iter().any(|s| s.codec_type == \"video\");\nif !has_video { return Err(anyhow!(\"o arquivo nao tem faixa de video\")); }","typeGuard":null,"tryCatchPattern":"match probe_video(path).await { Err(e) if e.to_string().contains(\"faixa de video\") => { eprintln!(\"not a video file\"); None }, r => r.ok() }","preventionTips":["Check codec_type==video via ffprobe before video publishing","Route audio files to a different publish flow","Validate container/codec against Instagram requirements (MP4 H.264/AAC)"],"tags":["ffmpeg","video","validation","rust"],"backgroundTag":"missing-required-argument","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}