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

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

📋 Pull Request Information

Original PR: https://github.com/CCExtractor/ccextractor/pull/1913
Author: @cfsmp3
Created: 12/27/2025
Status: Merged
Merged: 12/27/2025
Merged by: @cfsmp3

Base: masterHead: feat/scc-input-support


📝 Commits (5)

  • d4d2281 feat(input): Add native SCC (Scenarist Closed Caption) input support
  • 2820042 style: Fix formatting and clippy warnings
  • 7829c14 fix: Initialize scc_framerate in init_options()
  • fd4db0e chore: Trigger CI re-run
  • 2b0d9ed chore: trigger CI rebuild

📊 Changes

17 files changed (+671 additions, -7 deletions)

View changed files

📝 src/ccextractor.c (+6 -0)
📝 src/lib_ccx/ccx_common_constants.h (+1 -0)
📝 src/lib_ccx/ccx_common_option.c (+2 -0)
📝 src/lib_ccx/ccx_common_option.h (+1 -0)
📝 src/lib_ccx/general_loop.c (+15 -2)
📝 src/lib_ccx/lib_ccx.h (+9 -5)
📝 src/lib_ccx/stream_functions.c (+24 -0)
📝 src/rust/lib_ccxr/src/common/constants.rs (+1 -0)
📝 src/rust/lib_ccxr/src/common/options.rs (+3 -0)
📝 src/rust/src/args.rs (+5 -0)
📝 src/rust/src/common.rs (+3 -0)
📝 src/rust/src/ctorust.rs (+1 -0)
📝 src/rust/src/demuxer/mod.rs (+1 -0)
src/rust/src/demuxer/scc.rs (+452 -0)
📝 src/rust/src/demuxer/stream_functions.rs (+25 -0)
📝 src/rust/src/libccxr_exports/demuxer.rs (+104 -0)
📝 src/rust/src/parser.rs (+18 -0)

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/CCExtractor/ccextractor/pull/1913 **Author:** [@cfsmp3](https://github.com/cfsmp3) **Created:** 12/27/2025 **Status:** ✅ Merged **Merged:** 12/27/2025 **Merged by:** [@cfsmp3](https://github.com/cfsmp3) **Base:** `master` ← **Head:** `feat/scc-input-support` --- ### 📝 Commits (5) - [`d4d2281`](https://github.com/CCExtractor/ccextractor/commit/d4d228125a889684963b455fdd3e754c3234dee6) feat(input): Add native SCC (Scenarist Closed Caption) input support - [`2820042`](https://github.com/CCExtractor/ccextractor/commit/2820042c1dc47d9162ee52324c4d540076612398) style: Fix formatting and clippy warnings - [`7829c14`](https://github.com/CCExtractor/ccextractor/commit/7829c14c60a42e1111e865d01c3c670b1d9c20db) fix: Initialize scc_framerate in init_options() - [`fd4db0e`](https://github.com/CCExtractor/ccextractor/commit/fd4db0e7bfa685941a247e4644e76bb041f7691a) chore: Trigger CI re-run - [`2b0d9ed`](https://github.com/CCExtractor/ccextractor/commit/2b0d9ed4274a25d771dc27e5adafebd68f72d5bc) chore: trigger CI rebuild ### 📊 Changes **17 files changed** (+671 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `src/ccextractor.c` (+6 -0) 📝 `src/lib_ccx/ccx_common_constants.h` (+1 -0) 📝 `src/lib_ccx/ccx_common_option.c` (+2 -0) 📝 `src/lib_ccx/ccx_common_option.h` (+1 -0) 📝 `src/lib_ccx/general_loop.c` (+15 -2) 📝 `src/lib_ccx/lib_ccx.h` (+9 -5) 📝 `src/lib_ccx/stream_functions.c` (+24 -0) 📝 `src/rust/lib_ccxr/src/common/constants.rs` (+1 -0) 📝 `src/rust/lib_ccxr/src/common/options.rs` (+3 -0) 📝 `src/rust/src/args.rs` (+5 -0) 📝 `src/rust/src/common.rs` (+3 -0) 📝 `src/rust/src/ctorust.rs` (+1 -0) 📝 `src/rust/src/demuxer/mod.rs` (+1 -0) ➕ `src/rust/src/demuxer/scc.rs` (+452 -0) 📝 `src/rust/src/demuxer/stream_functions.rs` (+25 -0) 📝 `src/rust/src/libccxr_exports/demuxer.rs` (+104 -0) 📝 `src/rust/src/parser.rs` (+18 -0) </details> ### 📄 Description ## 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) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#2702