[PR #1913] feat(input): Add native SCC (Scenarist Closed Caption) input support #2705

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

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

State: closed
Merged: Yes


Summary

Add native support for reading SCC (Scenarist Closed Caption) files directly, eliminating the need for external conversion tools like SCC2RAW.exe or Perl scripts.

  • New Rust parser module with SMPTE timecode parsing and CEA-608 hex pair extraction
  • Auto-detection of SCC format (with UTF-8 BOM handling)
  • New --scc-framerate option supporting 29.97 (default), 24, 25, 30 fps
  • Integration following the McPoodle DVD raw pattern

Closes #1293

Implementation Details

Files Added

  • src/rust/src/demuxer/scc.rs - Core SCC parser with 12 unit tests

Files Modified

  • Stream mode detection (C and Rust)
  • FFI exports (ccxr_is_scc_file, ccxr_process_scc)
  • Command line argument parsing
  • Integration in raw_loop()

Testing

Round-Trip Test

Verified caption preservation through the SCC format:

  1. Extract CEA-608 captions from video to SRT (original)
  2. Extract same video to SCC format
  3. Convert SCC back to SRT (roundtrip)
  4. Compare both SRT files

Result: 118/118 captions matched (100% accuracy)

=== Summary ===
Matching captions: 118/118 (100.0%)

Additional Tests

  • Multiple output formats (SRT, WebVTT, transcript)
  • Frame rate option (--scc-framerate 24)
  • UTF-8 BOM handling
  • All 260 Rust unit tests pass

Usage

# Basic usage
ccextractor input.scc -o output.srt

# With custom frame rate (for 25fps PAL content)
ccextractor input.scc --scc-framerate 25 -o output.srt

Test Plan

  • Round-trip test (video → SCC → SRT matches video → SRT)
  • Verify SRT output format
  • Verify WebVTT output format
  • Verify transcript output format
  • Test --scc-framerate option
  • Test UTF-8 BOM handling
  • Run Rust unit tests
  • Run full regression test suite

🤖 Generated with Claude Code

**Original Pull Request:** https://github.com/CCExtractor/ccextractor/pull/1913 **State:** closed **Merged:** Yes --- ## Summary Add native support for reading SCC (Scenarist Closed Caption) files directly, eliminating the need for external conversion tools like SCC2RAW.exe or Perl scripts. - New Rust parser module with SMPTE timecode parsing and CEA-608 hex pair extraction - Auto-detection of SCC format (with UTF-8 BOM handling) - New `--scc-framerate` option supporting 29.97 (default), 24, 25, 30 fps - Integration following the McPoodle DVD raw pattern Closes #1293 ## Implementation Details ### Files Added - `src/rust/src/demuxer/scc.rs` - Core SCC parser with 12 unit tests ### Files Modified - Stream mode detection (C and Rust) - FFI exports (`ccxr_is_scc_file`, `ccxr_process_scc`) - Command line argument parsing - Integration in `raw_loop()` ## Testing ### Round-Trip Test Verified caption preservation through the SCC format: 1. Extract CEA-608 captions from video to SRT (original) 2. Extract same video to SCC format 3. Convert SCC back to SRT (roundtrip) 4. Compare both SRT files **Result: 118/118 captions matched (100% accuracy)** ``` === Summary === Matching captions: 118/118 (100.0%) ``` ### Additional Tests - ✅ Multiple output formats (SRT, WebVTT, transcript) - ✅ Frame rate option (`--scc-framerate 24`) - ✅ UTF-8 BOM handling - ✅ All 260 Rust unit tests pass ## Usage ```bash # Basic usage ccextractor input.scc -o output.srt # With custom frame rate (for 25fps PAL content) ccextractor input.scc --scc-framerate 25 -o output.srt ``` ## Test Plan - [x] Round-trip test (video → SCC → SRT matches video → SRT) - [x] Verify SRT output format - [x] Verify WebVTT output format - [x] Verify transcript output format - [x] Test `--scc-framerate` option - [x] Test UTF-8 BOM handling - [x] Run Rust unit tests - [ ] Run full regression test suite 🤖 Generated with [Claude Code](https://claude.com/claude-code)
claunia added the pull-request label 2026-01-29 17:23:30 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#2705