{"record":{"id":"248a53291dc1f078","repo":"SubtitleEdit/subtitleedit","slug":"vobsub-mkv-track-track-tracknumber-is-compresse","errorCode":null,"errorMessage":"VobSub MKV track #{track.TrackNumber} is compressed (content encoding 1), which isn't supported.","messagePattern":"VobSub MKV track #(.+?) is compressed \\(content encoding 1\\), which isn't supported\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/seconv/Core/BitmapSubtitleLoader.cs","lineNumber":183,"sourceCode":"        catch\n        {\n            // I/O race / permissions — let the text loader try rather than hard-failing here.\n            return false;\n        }\n    }\n\n    /// <summary>\n    /// VobSub track inside an MKV (<c>S_VOBSUB</c>) → bitmap events. The subpicture packets\n    /// live in the Matroska blocks; the per-pack timing comes from the block Start/End (not\n    /// the SubPicture's own delay, which only applies to standalone <c>.sub</c>+<c>.idx</c>).\n    /// Mirrors the desktop batch converter's <c>LoadVobSubFromMatroska</c>; the palette is\n    /// left to <see cref=\"SubPicture\"/>'s default, matching the GUI's OCR path.\n    /// </summary>\n    public static IReadOnlyList<BitmapSubtitleItem> LoadMatroskaVobSub(MatroskaFile matroska, MatroskaTrackInfo track)\n    {\n        if (track.ContentEncodingType == 1)\n        {\n            throw new InvalidOperationException(\n                $\"VobSub MKV track #{track.TrackNumber} is compressed (content encoding 1), which isn't supported.\");\n        }\n\n        // The track's CodecPrivate holds the .idx text, including the CLUT palette. Without\n        // it SubPicture.GetBitmap skips SetColor/SetContrast and renders normally-transparent\n        // planes opaque (issue #12772) — same fix as LoadVobSub; mirrors the GUI MKV path.\n        var codecPrivate = track.GetCodecPrivate();\n        var palette = GetVobSubIdxPalette(codecPrivate);\n        var (screenWidth, screenHeight) = GetVobSubIdxScreenSize(codecPrivate);\n\n        var sub = matroska.GetSubtitle(track.TrackNumber, null);\n        var packs = new List<VobSubMergedPack>(sub.Count);\n        foreach (var p in sub)\n        {\n            packs.Add(new VobSubMergedPack(p.GetData(track), TimeSpan.FromMilliseconds(p.Start), 32, null)\n            {\n                EndTime = TimeSpan.FromMilliseconds(p.End),\n                Palette = palette,","sourceCodeStart":165,"sourceCodeEnd":201,"githubUrl":"https://github.com/SubtitleEdit/subtitleedit/blob/17a9f0748781032255db3526b7215d2fb891e3af/src/seconv/Core/BitmapSubtitleLoader.cs#L165-L201","documentation":"InvalidOperationException from LoadMatroskaVobSub: the selected MKV S_VOBSUB track has ContentEncodingType == 1, meaning its subpicture packets are compressed (typically zlib header-stripped, the MKV 'content compression' flag) and the loader does not decompress them. This is a hard unsupported-format rejection, not a transient error.","triggerScenarios":"An MKV whose VobSub track was authored with content encoding 1 (compressed payloads). mkvtoolnix can set this; some rippers do. The loader reads raw blocks and would feed compressed bytes to SubPicture, so it refuses instead of producing garbage.","commonSituations":"Ripping a DVD to MKV with compression enabled; re-muxing tools that preserve the compression flag; legacy MKVs from older mkvtoolnix defaults.","solutions":["Re-mux the MKV without content compression: mkvmerge --no-subtitles ... then re-add, or mkvmerge with --compression track:n:none.","Extract the VobSub track to .sub/.idx with mkvextract and use LoadVobSub on the extracted files (mkvextract writes them uncompressed).","Use a different source that does not compress the VobSub track."],"exampleFix":"// before\nif (track.ContentEncodingType == 1)\n    throw new InvalidOperationException($\"VobSub MKV track #{track.TrackNumber} is compressed (content encoding 1), which isn't supported.\");\n\n// after — decompress zlib blocks inline so compressed tracks work\nvar sub = track.ContentEncodingType == 1\n    ? matroska.GetSubtitle(track.TrackNumber, null).Select(ZlibDecompress).ToList()\n    : matroska.GetSubtitle(track.TrackNumber, null);","handlingStrategy":"validation","validationCode":"if (track.ContentEncodingType == 1)\n    throw new InvalidOperationException($\"VobSub track #{track.TrackNumber} is compressed. Re-mux with mkvmerge --compression {track.TrackNumber}:none, or extract via mkvextract.\");","typeGuard":"static bool IsUncompressedVobSub(MatroskaTrackInfo t) =>\n    string.Equals(t.CodecID, \"S_VOBSUB\", StringComparison.OrdinalIgnoreCase) && t.ContentEncodingType != 1;","tryCatchPattern":"null","preventionTips":["Enumerate MKV track content encoding before calling LoadMatroskaVobSub.","Standardize on uncompressed VobSub tracks when authoring MKVs."],"tags":["subtitles","vobsub","mkv","unsupported-format","compression"],"backgroundTag":null,"analyzedSha":"17a9f0748781032255db3526b7215d2fb891e3af","analyzedAt":"2026-08-13T18:11:43.374Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}