{"record":{"id":"67b543d052e1daff","repo":"tonhowtf/omniget","slug":"switch-album","errorCode":null,"errorMessage":"{}","messagePattern":"\\{\\}","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/games/switch_album.rs","lineNumber":251,"sourceCode":"            \"-c:v\",\n            \"libvpx-vp9\",\n            \"-crf\",\n            \"34\",\n            \"-b:v\",\n            \"0\",\n            \"-row-mt\",\n            \"1\",\n            \"-c:a\",\n            \"libopus\",\n            \"-b:a\",\n            \"96k\",\n        ])\n        .arg(&output)\n        .output()\n        .await\n        .map_err(|e| anyhow::anyhow!(\"ffmpeg nao iniciou: {}\", e))?;\n    if !out.status.success() {\n        anyhow::bail!(\"{}\", String::from_utf8_lossy(&out.stderr).trim());\n    }\n    Ok(output)\n}\n\npub async fn run(opts: SwitchOptions, progress: ProgressFn) -> anyhow::Result<SwitchResult> {\n    let source = PathBuf::from(opts.source.trim());\n    if !source.is_dir() {\n        anyhow::bail!(\"pasta de origem não encontrada: {}\", source.display());\n    }\n    let dest_root = PathBuf::from(opts.dest.trim());\n    if opts.dest.trim().is_empty() {\n        anyhow::bail!(\"escolha a pasta da biblioteca de destino\");\n    }\n    let move_it = opts.mode == \"move\";\n\n    report(&progress, ID, \"progress\", 0, None, None);\n    let found = collect(&source, &opts.kinds);\n    let total = found.len() as u64;","sourceCodeStart":233,"sourceCodeEnd":269,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/games/switch_album.rs#L233-L269","documentation":"to_webm in switch_album.rs bails with the trimmed stderr of the ffmpeg process when converting a Nintendo Switch capture fails: ffmpeg ran (it started) but exited with a non-zero status. The raw '{}' message is whatever ffmpeg printed to stderr, so diagnostics come directly from ffmpeg.","triggerScenarios":"Calling run -> to_webm on a Switch capture file where the spawned ffmpeg command exits non-zero, e.g. unreadable/corrupt input file, unsupported codec in the capture, invalid output path, or bad ffmpeg arguments.","commonSituations":"Source file is corrupt or truncated (Switch recording stopped by battery loss); ffmpeg not installed or too old to decode the capture's codec; output directory not writable; input file renamed/deleted between selection and conversion.","solutions":["Run the same ffmpeg command manually to read the full stderr and fix the underlying cause","Verify the source capture file is intact and playable (e.g. with ffprobe)","Ensure the output path/directory exists and is writable","Install or update ffmpeg to a version that supports the capture's codec","Note: 'ffmpeg nao iniciou' is a separate error meaning ffmpeg failed to spawn at all (e.g. not installed)"],"exampleFix":"// before\n// output path's directory does not exist\nlet output = PathBuf::from(\"/nonexistent/dir/clip.webm\");\n// after\nstd::fs::create_dir_all(\"/nonexistent/dir\")?;\nlet output = PathBuf::from(\"/nonexistent/dir/clip.webm\");","handlingStrategy":"try-catch","validationCode":"// Before conversion, verify ffmpeg is available and the input is readable\nlet ffmpeg_ok = tokio::process::Command::new(\"ffmpeg\")\n    .arg(\"-version\").output().await.map(|o| o.status.success()).unwrap_or(false);\nlet input_ok = tokio::fs::metadata(&source).await.map(|m| m.len() > 0).unwrap_or(false);","typeGuard":null,"tryCatchPattern":"match run(opts, progress).await {\n    Ok(result) => handle(result),\n    Err(e) => {\n        let msg = e.to_string();\n        if msg.contains(\"Invalid data\") || msg.contains(\"moov atom not found\") {\n            eprintln!(\"capture file is corrupt: {msg}\");\n        } else {\n            eprintln!(\"ffmpeg conversion failed: {msg}\");\n        }\n    }\n}","preventionTips":["Verify the capture file plays (ffprobe) before converting","Ensure ffmpeg is installed and on PATH, with codec support for Switch captures (H.264)","Check output directory write permissions before conversion","Capture ffprobe diagnostics to catch corrupt/truncated recordings early"],"tags":["ffmpeg","video-conversion","external-process","rust"],"backgroundTag":"http-error-response","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"}