-
Notifications
You must be signed in to change notification settings - Fork 517
feat(input): Add native SCC (Scenarist Closed Caption) input support #1913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add native support for reading SCC files directly, eliminating the need for external conversion tools like SCC2RAW.exe or Perl scripts. Implementation: - New Rust parser module (src/rust/src/demuxer/scc.rs) with: - SMPTE timecode parsing (HH:MM:SS:FF format) - Configurable frame rates: 29.97 (default), 24, 25, 30 fps - CEA-608 hex pair extraction - UTF-8 BOM handling - 12 comprehensive unit tests - Stream mode detection in both C and Rust code - FFI exports for C integration (ccxr_is_scc_file, ccxr_process_scc) - New --scc-framerate command line option - Integration in raw_loop() following the McPoodle DVD raw pattern Testing performed: - Round-trip test: video → SRT, video → SCC, SCC → SRT Result: 118/118 captions matched (100% accuracy) - Multiple output formats verified (SRT, WebVTT, transcript) - Frame rate option tested with 24fps sample - UTF-8 BOM handling verified - All 260 Rust tests pass Usage: ccextractor input.scc -o output.srt ccextractor input.scc --scc-framerate 25 -o output.srt Closes CCExtractor#1293 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Replace tabs with spaces in doc comments - Use #[derive(Default)] with #[default] attribute - Use array syntax for char pattern matching - Apply clang-format to C files 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
The scc_framerate field was not being initialized in the C init_options() function, leaving it with an undefined value. This could cause undefined behavior when the options struct is used before the Rust code initializes the field. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
CCExtractor CI platform finished running the test files on windows. Below is a summary of the test results, when compared to test for commit dc352a2...:
Congratulations: Merging this PR would fix the following tests:
All tests passed completely. Check the result page for more info. |
Timing issues in tests 226-230 are pre-existing and unrelated to SCC support. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
CCExtractor CI platform finished running the test files on linux. Below is a summary of the test results, when compared to test for commit 921cbe0...:
Your PR breaks these cases:
It seems that not all tests were passed completely. This is an indication that the output of some files is not as expected (but might be according to you). Check the result page for more info. |
|
@cfsmp3 thankyou very much, Carlos. Very useful addition to the tool. ❤️ |
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.
--scc-framerateoption supporting 29.97 (default), 24, 25, 30 fpsCloses #1293
Implementation Details
Files Added
src/rust/src/demuxer/scc.rs- Core SCC parser with 12 unit testsFiles Modified
ccxr_is_scc_file,ccxr_process_scc)raw_loop()Testing
Round-Trip Test
Verified caption preservation through the SCC format:
Result: 118/118 captions matched (100% accuracy)
Additional Tests
--scc-framerate 24)Usage
Test Plan
--scc-framerateoption🤖 Generated with Claude Code