{"record":{"id":"445a3c5311ba0660","repo":"SubtitleEdit/subtitleedit","slug":"no-subtitles-found-in-file-inputfile","errorCode":null,"errorMessage":"No subtitles found in file: {inputFile}","messagePattern":"No subtitles found in file: (.+?)","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/seconv/Core/SubtitleConverter.cs","lineNumber":645,"sourceCode":"            await Task.Run(async () =>\n            {\n                // --encoding:source means \"use the input file's detected encoding for both\n                // read and write\". Resolve it per-file before the load so the same encoding\n                // name flows into the save side too.\n                var resolvedOptions = options;\n                if (LibSEIntegration.IsSourceEncodingSentinel(options.Encoding))\n                {\n                    var detected = LibSEIntegration.DetectSourceEncodingName(inputFile, options.InputEncodingFallback);\n                    resolvedOptions = options with { Encoding = detected };\n                }\n\n                // Load subtitle file using LibSE — keep the detected format so the\n                // save side can apply RemoveNativeFormatting when the target differs.\n                var (subtitle, sourceFormat) = LibSEIntegration.LoadSubtitleWithFormat(inputFile, resolvedOptions.Encoding, resolvedOptions.InputEncodingFallback, warnings);\n\n                if (subtitle == null || subtitle.Paragraphs.Count == 0)\n                {\n                    throw new InvalidOperationException($\"No subtitles found in file: {inputFile}\");\n                }\n\n                await ApplyTransformsAndSaveAsync(subtitle, sourceFormat, outputFile, resolvedOptions);\n            });\n        }\n        finally\n        {\n            Configuration.Settings.General.CurrentFrameRate = originalFrameRate;\n        }\n    }\n\n    private async Task ConvertTrackAsync(ContainerSubtitleLoader.LoadedTrack track, string outputFile, ConversionOptions options)\n    {\n        var originalFrameRate = Configuration.Settings.General.CurrentFrameRate;\n        try\n        {\n            if (options.Fps.HasValue)\n            {","sourceCodeStart":627,"sourceCodeEnd":663,"githubUrl":"https://github.com/SubtitleEdit/subtitleedit/blob/17a9f0748781032255db3526b7215d2fb891e3af/src/seconv/Core/SubtitleConverter.cs#L627-L663","documentation":"Thrown when LibSEIntegration.LoadSubtitleWithFormat returns a null Subtitle or one with zero paragraphs for a text-subtitle input. LibSE loaded the file but found no recognisable cue lines, so there is nothing to convert or save.","triggerScenarios":"ConvertFileAsync loads inputFile (a text subtitle), and subtitle == null || subtitle.Paragraphs.Count == 0 after format detection and (optional) source-encoding resolution.","commonSituations":"Pointing seconv at an empty .srt, a file with only a header/metadata but no cues, a binary/image file mistaken for text, or a file whose encoding was mis-detected so the parser saw garbage. A genuinely blank subtitle export.","solutions":["Open the file in a text editor and confirm it contains real cue entries (index, timecode, text).","If encoding was misdetected, pass --encoding <codepage> (or --input-encoding-fallback) so the parser reads the bytes correctly.","If the file is image/binary based, use the bitmap/OCR path rather than the text loader.","Verify the file is not truncated/corrupt — re-export from the original source."],"exampleFix":"// before\nseconv blank.srt srt\n// after (force correct encoding)\nseconv windows-1252.srt srt --encoding windows-1252","handlingStrategy":"validation","validationCode":"var (sub, _) = LibSEIntegration.LoadSubtitleWithFormat(inputFile, encoding, fallback, warnings);\nif (sub is null || sub.Paragraphs.Count == 0)\n    throw new ArgException($\"'{inputFile}' has no recognisable subtitle cues (wrong format/encoding?).\");","typeGuard":"static bool HasCues(Subtitle? s) => s is { Paragraphs.Count: > 0 };","tryCatchPattern":"null","preventionTips":["Pre-open suspect files in a text editor to confirm cues exist.","Specify --encoding when the source is a legacy single-byte codepage.","Use seconv info to sanity-check a file before batch conversion."],"tags":["seconv","subtitle-loading","empty-input","encoding","libse"],"backgroundTag":null,"analyzedSha":"17a9f0748781032255db3526b7215d2fb891e3af","analyzedAt":"2026-08-13T18:11:43.374Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}