Skip to content

[FEATURE] : Add 23.98fps alias for --scc-framerate and clarify help text#2150

Merged
cfsmp3 merged 2 commits intoCCExtractor:masterfrom
Varadraj75:fix/scc-framerate-help-and-23.98-alias
Feb 28, 2026
Merged

[FEATURE] : Add 23.98fps alias for --scc-framerate and clarify help text#2150
cfsmp3 merged 2 commits intoCCExtractor:masterfrom
Varadraj75:fix/scc-framerate-help-and-23.98-alias

Conversation

@Varadraj75
Copy link
Contributor

In raising this pull request, I confirm the following (please check boxes):

  • I have read and understood the contributors guide.
  • I have checked that another pull request for this purpose does not exist.
  • I have considered, and confirmed that this submission will be valuable to others.
  • I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  • I give this submission freely, and claim no ownership to its content.
  • I have mentioned this change in the changelog.

My familiarity with the project is as follows (check one):

  • I have never used CCExtractor.
  • I have used CCExtractor just a couple of times.
  • I absolutely love CCExtractor, but have not contributed previously.
  • I am an active contributor to CCExtractor.

Summary

Follow-up to the discussion in #2145 and #2146, addressing two small improvements
raised around the SCC framerate work.

Changes

1. Add 23.98 as a valid --scc-framerate value

23.98fps (film frame rate, 24000/1001) was absent from valid values while its
NTSC counterpart 29.97 (30000/1001) was already explicitly supported. This adds
proper first-class support for film frame rate sources.

  • Added case 4: return 23.976f to both get_scc_fps() and
    get_scc_fps_internal() in ccx_encoders_scc.c
  • Added "23.98" | "23.976" match arm in parser.rs mapping to value 4
  • Added test_scc_framerate_23_98() unit test in parser.rs

2. Fix misleading --scc-framerate help text

The 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.

Before:
  Set the frame rate for SCC (Scenarist Closed Caption) input files.
  Valid values: 29.97 (default), 24, 25, 30

After:
  Set the frame rate for Scenarist Closed Captioning (SCC) input parsing and output encoding.
  Valid values: 23.98, 29.97 (default), 24, 25, 30

Testing

All existing SCC framerate tests pass. New unit test added for 23.98.

- 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.
Copilot AI review requested due to automatic review settings February 28, 2026 11:33
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-framerate help 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.

/// 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
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
/// Valid values: 23.98, 29.97 (default), 24, 25, 30
/// Valid values: 23.98/23.976, 29.97 (default)/29, 24, 25, 30

Copilot uses AI. Check for mistakes.
Comment on lines 839 to 843
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,
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--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.

Copilot uses AI. Check for mistakes.

// 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
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
// 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)

Copilot uses AI. Check for mistakes.

// 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
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
- 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-bot
Copy link
Collaborator

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...:
Report Name Tests Passed
Broken 13/13
CEA-708 14/14
DVB 7/7
DVD 3/3
DVR-MS 2/2
General 27/27
Hardsubx 1/1
Hauppage 3/3
MP4 3/3
NoCC 10/10
Options 86/86
Teletext 21/21
WTV 13/13
XDS 34/34

Congratulations: Merging this PR would fix the following tests:

  • ccextractor --autoprogram --out=srt --latin1 --quant 0 85271be4d2..., Last passed: Never
  • ccextractor --autoprogram --out=ttxt --latin1 --ucla dab1c1bd65..., Last passed: Never
  • ccextractor --out=srt --latin1 --autoprogram 29e5ffd34b..., Last passed: Never
  • ccextractor --out=spupng c83f765c66..., Last passed: Never
  • ccextractor --startcreditstext "CCextractor Start crdit Testing" c4dd893cb9..., Last passed: Never
  • ccextractor --startcreditsnotbefore 1 --startcreditstext "CCextractor Start crdit Testing" c4dd893cb9..., Last passed: Never
  • ccextractor --startcreditsnotafter 2 --startcreditstext "CCextractor Start crdit Testing" c4dd893cb9..., Last passed: Never
  • ccextractor --startcreditsforatleast 1 --startcreditstext "CCextractor Start crdit Testing" c4dd893cb9..., Last passed: Never
  • ccextractor --startcreditsforatmost 2 --startcreditstext "CCextractor Start crdit Testing" c4dd893cb9..., Last passed: Never

All tests passed completely.

Check the result page for more info.

@ccextractor-bot
Copy link
Collaborator

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...:
Report Name Tests Passed
Broken 13/13
CEA-708 14/14
DVB 7/7
DVD 3/3
DVR-MS 2/2
General 27/27
Hardsubx 1/1
Hauppage 3/3
MP4 3/3
NoCC 10/10
Options 86/86
Teletext 21/21
WTV 13/13
XDS 34/34

Congratulations: Merging this PR would fix the following tests:

  • ccextractor --autoprogram --out=srt --latin1 --quant 0 85271be4d2..., Last passed: Never
  • ccextractor --autoprogram --out=ttxt --latin1 --ucla dab1c1bd65..., Last passed: Never
  • ccextractor --out=srt --latin1 --autoprogram 29e5ffd34b..., Last passed: Never
  • ccextractor --out=spupng c83f765c66..., Last passed: Never
  • ccextractor --startcreditstext "CCextractor Start crdit Testing" c4dd893cb9..., Last passed: Never
  • ccextractor --startcreditsnotbefore 1 --startcreditstext "CCextractor Start crdit Testing" c4dd893cb9..., Last passed: Never
  • ccextractor --startcreditsnotafter 2 --startcreditstext "CCextractor Start crdit Testing" c4dd893cb9..., Last passed: Never
  • ccextractor --startcreditsforatleast 1 --startcreditstext "CCextractor Start crdit Testing" c4dd893cb9..., Last passed: Never
  • ccextractor --startcreditsforatmost 2 --startcreditstext "CCextractor Start crdit Testing" c4dd893cb9..., Last passed: Never

All tests passed completely.

Check the result page for more info.

@cfsmp3 cfsmp3 merged commit c919daf into CCExtractor:master Feb 28, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants