[PR #1919] feat(matroska): Add VOBSUB subtitle extraction support for MKV files #2715

Closed
opened 2026-01-29 17:23:33 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/CCExtractor/ccextractor/pull/1919

State: closed
Merged: Yes


Summary

  • Adds full VOBSUB (S_VOBSUB) subtitle extraction support for Matroska files
  • Previously CCExtractor would just print "Error: VOBSUB not supported" and produce empty files
  • Now generates proper .idx and .sub file pairs that work with VLC, FFmpeg, and other players
  • Includes documentation and Docker tooling for OCR conversion to SRT

Changes

Core VOBSUB extraction (src/lib_ccx/matroska.c):

  • Added PS Pack header generation with SCR derived from timestamps
  • Added PES header generation with PTS for subtitle timing
  • Added save_vobsub_track() function to write both .idx and .sub files
  • Added hex format specifier (LLX_M) for cross-platform file position formatting
  • Standard 2048-byte block alignment for proper VOBSUB format

Documentation and tooling:

  • Added docs/VOBSUB.md - comprehensive guide for VOBSUB extraction and OCR conversion
  • Added tools/vobsubocr/Dockerfile - Docker image for subtile-ocr (VOBSUB to SRT conversion)

Usage

# Extract VOBSUB from MKV
ccextractor movie.mkv
# Output: movie_eng.idx + movie_eng.sub

# Convert to SRT (using Docker)
docker build -t subtile-ocr tools/vobsubocr/
docker run --rm -v $(pwd):/data subtile-ocr -l eng -o /data/movie.srt /data/movie_eng.idx

Test plan

  • Tested with sample #178 from issue (bugs.mkv with VOBSUB tracks)
  • Output validates with FFprobe as dvd_subtitle codec
  • Timestamps match reference extraction (mkvextract)
  • File positions match reference extraction
  • SPU data is identical to reference extraction
  • OCR with subtile-ocr produces identical SRT to mkvextract reference

Fixes #1371

🤖 Generated with Claude Code

**Original Pull Request:** https://github.com/CCExtractor/ccextractor/pull/1919 **State:** closed **Merged:** Yes --- ## Summary - Adds full VOBSUB (S_VOBSUB) subtitle extraction support for Matroska files - Previously CCExtractor would just print "Error: VOBSUB not supported" and produce empty files - Now generates proper .idx and .sub file pairs that work with VLC, FFmpeg, and other players - Includes documentation and Docker tooling for OCR conversion to SRT ## Changes **Core VOBSUB extraction (`src/lib_ccx/matroska.c`):** - Added PS Pack header generation with SCR derived from timestamps - Added PES header generation with PTS for subtitle timing - Added `save_vobsub_track()` function to write both .idx and .sub files - Added hex format specifier (`LLX_M`) for cross-platform file position formatting - Standard 2048-byte block alignment for proper VOBSUB format **Documentation and tooling:** - Added `docs/VOBSUB.md` - comprehensive guide for VOBSUB extraction and OCR conversion - Added `tools/vobsubocr/Dockerfile` - Docker image for subtile-ocr (VOBSUB to SRT conversion) ## Usage ```bash # Extract VOBSUB from MKV ccextractor movie.mkv # Output: movie_eng.idx + movie_eng.sub # Convert to SRT (using Docker) docker build -t subtile-ocr tools/vobsubocr/ docker run --rm -v $(pwd):/data subtile-ocr -l eng -o /data/movie.srt /data/movie_eng.idx ``` ## Test plan - [x] Tested with sample #178 from issue (bugs.mkv with VOBSUB tracks) - [x] Output validates with FFprobe as `dvd_subtitle` codec - [x] Timestamps match reference extraction (mkvextract) - [x] File positions match reference extraction - [x] SPU data is identical to reference extraction - [x] OCR with subtile-ocr produces identical SRT to mkvextract reference Fixes #1371 🤖 Generated with [Claude Code](https://claude.com/claude-code)
claunia added the pull-request label 2026-01-29 17:23:33 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#2715