[FEATURE] : Add 23.98fps alias for --scc-framerate and clarify help text#2150
Conversation
- Add case 4 (23.976f) to both get_scc_fps() and get_scc_fps_internal() in ccx_encoders_scc.c so --scc-framerate 23.98 produces correct output - Add "23.98" | "23.976" match arm in parser.rs mapping to value 4 - Add test_scc_framerate_23_98() unit test in parser.rs - Update --scc-framerate help text to clarify it affects both input parsing AND output encoding (not input only) - Add 23.98 to the listed valid values in the help text Follows up on discussion in CCExtractor#2145 and CCExtractor#2146.
There was a problem hiding this comment.
Pull request overview
Adds support for the film framerate alias 23.98 for SCC processing and updates CLI help/changelog messaging to reflect SCC framerate behavior more accurately.
Changes:
- Accept
--scc-framerate 23.98(and map it through to the SCC encoder framerate logic). - Clarify
--scc-frameratehelp text to indicate it affects both SCC input parsing and output encoding. - Add a Rust unit test for the new framerate value and update the changelog entry.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
src/rust/src/parser.rs |
Adds CLI string mapping for 23.98/23.976 to a new internal framerate code and adds a unit test. |
src/rust/src/args.rs |
Updates --scc-framerate help text and valid-values list. |
src/lib_ccx/ccx_encoders_scc.c |
Extends SCC framerate switch logic to support the new code returning ~23.976fps. |
docs/CHANGES.TXT |
Documents the new accepted framerate and help-text clarification. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/rust/src/args.rs
Outdated
| /// Set the frame rate for SCC (Scenarist Closed Caption) input files. | ||
| /// Valid values: 29.97 (default), 24, 25, 30 | ||
| /// Set the frame rate for Scenarist Closed Captioning (SCC) input parsing and output encoding. | ||
| /// Valid values: 23.98, 29.97 (default), 24, 25, 30 |
There was a problem hiding this comment.
The help text lists valid values as "23.98, 29.97 (default), 24, 25, 30", but the parser also accepts "23.976" (and "29") as inputs. Either document the additional accepted aliases here or restrict the parser to only the documented values so --help stays accurate.
| /// Valid values: 23.98, 29.97 (default), 24, 25, 30 | |
| /// Valid values: 23.98/23.976, 29.97 (default)/29, 24, 25, 30 |
| if let Some(ref fps_str) = args.scc_framerate { | ||
| self.scc_framerate = match fps_str.as_str() { | ||
| "29.97" | "29" => 0, | ||
| "23.98" | "23.976" => 4, | ||
| "24" => 1, |
There was a problem hiding this comment.
--scc-framerate parsing now accepts both "23.98" and the alias "23.976", but the tests only cover "23.98". Add a unit test for the "23.976" alias (and any other documented/accepted aliases) to prevent regressions in the string-to-code mapping.
src/lib_ccx/ccx_encoders_scc.c
Outdated
|
|
||
| // Get frame rate value from scc_framerate setting | ||
| // 0=29.97 (default), 1=24, 2=25, 3=30 | ||
| // 0=29.97 (default), 1=24, 2=25, 3=30, 4=23.98 |
There was a problem hiding this comment.
The mapping comment says 4=23.98, but case 4 returns 23.976f (24000/1001). Update the comment to reflect the actual value (e.g., "23.976 (aka 23.98)") to avoid confusion.
| // 0=29.97 (default), 1=24, 2=25, 3=30, 4=23.98 | |
| // 0=29.97 (default), 1=24, 2=25, 3=30, 4=23.976 (aka 23.98) |
src/lib_ccx/ccx_encoders_scc.c
Outdated
|
|
||
| // Get frame rate value from scc_framerate setting | ||
| // 0=29.97 (default), 1=24, 2=25, 3=30 | ||
| // 0=29.97 (default), 1=24, 2=25, 3=30, 4=23.98 |
There was a problem hiding this comment.
This second mapping comment also says 4=23.98, but case 4 returns 23.976f. Please keep the comment consistent with the implementation here too.
- Fix mapping comments: 4=23.976 (aka 23.98) in ccx_encoders_scc.c - Update help text to document 23.976 and 29 as accepted aliases - Add test_scc_framerate_23_976 unit test for the 23.976 alias
CCExtractor CI platform finished running the test files on linux. Below is a summary of the test results, when compared to test for commit 733ed89...:
Congratulations: Merging this PR would fix the following tests:
All tests passed completely. Check the result page for more info. |
CCExtractor CI platform finished running the test files on windows. Below is a summary of the test results, when compared to test for commit 733ed89...:
Congratulations: Merging this PR would fix the following tests:
All tests passed completely. Check the result page for more info. |
In raising this pull request, I confirm the following (please check boxes):
My familiarity with the project is as follows (check one):
Summary
Follow-up to the discussion in #2145 and #2146, addressing two small improvements
raised around the SCC framerate work.
Changes
1. Add
23.98as a valid--scc-frameratevalue23.98fps(film frame rate, 24000/1001) was absent from valid values while itsNTSC counterpart
29.97(30000/1001) was already explicitly supported. This addsproper first-class support for film frame rate sources.
case 4: return 23.976fto bothget_scc_fps()andget_scc_fps_internal()inccx_encoders_scc.c"23.98" | "23.976"match arm inparser.rsmapping to value4test_scc_framerate_23_98()unit test inparser.rs2. Fix misleading
--scc-frameratehelp textThe help text said "Set the frame rate for SCC input files" implying input-only
behaviour. Since #1916 it affects both input parsing AND output encoding.
Testing
All existing SCC framerate tests pass. New unit test added for
23.98.