{"record":{"id":"4299b700fc58b08b","repo":"SubtitleEdit/subtitleedit","slug":"file-declares-the-scenarist-scc-signature-but-no","errorCode":null,"errorMessage":"File declares the Scenarist_SCC signature, but no valid captions could be decoded: {filePath}","messagePattern":"File declares the Scenarist_SCC signature, but no valid captions could be decoded: (.+?)","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/seconv/Core/LibSEIntegration.cs","lineNumber":107,"sourceCode":"        {\n            var csvSubtitle = new UnknownFormatImporterCsv().AutoGuessImport(lines);\n            if (csvSubtitle != null && csvSubtitle.Paragraphs.Count > 0)\n            {\n                return (csvSubtitle, new SubRip());\n            }\n        }\n\n        // 0b. A file that declares the Scenarist SCC signature is SCC, full stop — decode it\n        // with the SCC parsers and never let it fall through to the generic guessers below,\n        // which would digit-scrape the raw source lines into garbage cues (#12582). The SCC\n        // parser is lenient (it skips undecodable rows and counts them), so a partially\n        // damaged file still converts, with a warning; a file where nothing decodes fails.\n        if (HasScenaristSccSignature(lines))\n        {\n            var (sccSubtitle, sccFormat, undecodableRows) = LoadBestScenaristScc(lines, filePath);\n            if (sccSubtitle.Paragraphs.Count == 0)\n            {\n                throw new InvalidOperationException(\n                    $\"File declares the Scenarist_SCC signature, but no valid captions could be decoded\" +\n                    $\"{(undecodableRows > 0 ? $\" ({undecodableRows} undecodable row(s))\" : string.Empty)}: {filePath}\");\n            }\n\n            if (undecodableRows > 0)\n            {\n                warnings?.Add($\"{undecodableRows} SCC caption row(s) could not be decoded and were skipped.\");\n            }\n\n            return (sccSubtitle, sccFormat);\n        }\n\n        // 1. Try text-based formats by content sniffing\n        foreach (var format in SubtitleFormat.AllSubtitleFormats)\n        {\n            if (format.IsMine(lines, filePath))\n            {\n                format.LoadSubtitle(subtitle, lines, filePath);","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/SubtitleEdit/subtitleedit/blob/17a9f0748781032255db3526b7215d2fb891e3af/src/seconv/Core/LibSEIntegration.cs#L89-L125","documentation":"Thrown when a file whose first non-blank line starts with 'Scenarist_SCC' (the SCC signature) was decoded by the SCC parser but produced zero valid caption paragraphs. The SCC parser is intentionally lenient — it skips undecodable rows and counts them — but if NOTHING decodes the file is treated as corrupt rather than silently producing empty output (#12582). The undecodable row count is included in the message when > 0.","triggerScenarios":"An SCC file whose header line is correct ('Scenarist_SCC') but whose caption data rows are all malformed (bad hex pairs, invalid timing, wrong row structure). Both drop-frame and non-drop-frame decode attempts are tried (LoadBestScenaristScc); if both yield zero paragraphs, this throws.","commonSituations":"A truncated or garbled SCC file (e.g. corrupted during transfer); a file that has the SCC header but whose body is in a different dialect the parser cannot handle; a hand-edited SCC with structural errors in every row.","solutions":["Open the SCC file in a text editor and inspect the caption rows — verify the timing format and hex-encoded byte pairs conform to the Scenarist SCC spec.","Try loading the file in the Subtitle Edit GUI OCR/import window to get detailed row-level diagnostics.","If only some rows are corrupt, the parser already skips them — fix the remaining valid rows until at least one decodes; the warning path (undecodableRows > 0 but some success) will then apply instead."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { var (sub, fmt) = LibSEIntegration.LoadSubtitleWithFormat(sccPath); }\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"Scenarist_SCC signature\"))\n{ /* SCC file is corrupt — advise user to inspect/repair the SCC rows */ }","preventionTips":["For SCC files, pre-check the header line starts with 'Scenarist_SCC' so you know you are on the SCC code path.","Test SCC files in the Subtitle Edit GUI first — it gives row-level decode diagnostics.","Catch InvalidOperationException from LoadSubtitleWithFormat and distinguish SCC-decode failures from format-detection failures by message."],"tags":["scc","corrupt-file","parse-failure","subtitles","format-detection"],"backgroundTag":null,"analyzedSha":"17a9f0748781032255db3526b7215d2fb891e3af","analyzedAt":"2026-08-13T18:11:43.374Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}