Skip to content

[FIX] Use the detected frame rate for CEA-708 SCC timecodes - #2406

Open
harshalsp07 wants to merge 1 commit into
CCExtractor:masterfrom
harshalsp07:fix/scc-timecode-fps
Open

harshalsp07 wants to merge 1 commit into
CCExtractor:masterfrom
harshalsp07:fix/scc-timecode-fps

Conversation

@harshalsp07

@harshalsp07 harshalsp07 commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

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

Reason for this PR:

  • This PR adds new functionality.
  • This PR fixes a bug that I have personally experienced or that a real user has reported and for which a sample exists.
  • This PR is porting code from C to Rust.

Sanity check:

  • I have read and understood the contributors guide.
  • I have checked that another pull request for this purpose does not exist.
  • If the PR adds new functionality, I've added it to the changelog. If it's just a bug fix, I have NOT added it to the changelog.
  • I am NOT adding new C code unless it's to fix an existing, reproducible bug.

Fixes #2145.

What changed

CEA-708 SCC timecodes used a hardcoded 29.97 for the frame field. The writers now use the detected current_fps:

  • C: print_scc_time() in src/lib_ccx/ccx_common_timing.c.
  • Rust: get_scc_time_str() in src/rust/src/decoder/timing.rs, plus the one-frame delay in dtvcc_tv_screen::write_scc().
  • Timestamp::to_scc_time() now takes the frame rate. Its old u8 seconds arithmetic overflowed after 255 seconds; it uses i64 now and prints an integer frame.

--scc-framerate is unchanged. It still controls the CEA-608 SCC encoder and SCC input parsing. The 708 writer uses the stream rate, as requested in #2145.

Why

For a 25 fps source, the frame field was calculated with 29.97, so frame numbers drifted within each second. This is the same bug as the closed #2146, fixed here for both writers. cfsmp3's review on #2146 asked for get_scc_time_str and to_scc_time to be updated too; this PR includes them. #2173 already switched the C 708 delay to current_fps; the Rust writer still subtracted 1000 / 29.97 as i64 in its overlap branches.

Testing

I used a 25 fps H.264 MPEG-TS with one CEA-708 service 1 caption. It is generated for this PR, not a broadcast capture; the base64 is at the end. The SPS has fixed_frame_rate_flag=1, so current_fps is 25.

Save the base64 block at the end as sample25.b64, then:

base64 -d sample25.b64 > sample25.ts
ccextractor sample25.ts --service 1 --out=scc
cat sample25.p1.svc01.scc

Results with the same sample:

  • master d7eb132e: 00:00:04;07 942c 942c ...
  • this branch: 00:00:04;06 942c 942c ...

The caption FTS is 4.28 s. SCC subtracts one frame (40 ms), so the timecode is 4.24 s, which is frame 6 at 25 fps. 29.97 gives frame 7.

Checks:

  • cargo test in src/rust: 428 passed.
  • cargo test in src/rust/lib_ccxr: 55 unit and 46 doc tests passed.
  • cargo fmt --all -- --check and cargo clippy -- -D warnings in both crates.
  • ctest in a local CMake build: 1/1 passed.
  • clang-format --dry-run -Werror src/lib_ccx/ccx_common_timing.c.
  • Full CMake build with GPAC, then the before/after run above.

The default build uses the Rust 708 writer, so the C print_scc_time() change is not on the sample path. I checked it directly by linking the compiled ccx_common_timing.c object into a small harness: 960 ms at 29.97/25/24 gives frames 28/24/23, and 500 ms at 30 gives frame 15.

Output changes

Non-29.97 SCC output changes, which is the point. For 29.97, the Rust one-frame delay was 1000 / (29.97 as i64) (34 ms) and is now (1000 / 29.97) as i64 (33 ms), closer to the C writer. That can move a timecode by one frame at a boundary. Any sample-platform test that compares SCC output from a non-29.97 source will need its baseline regenerated.

sample25.ts (base64, 21,808 bytes, sha256 00341a21cc2381a09397bf4356f70adb61b9b063dfa459ac299f273ebf471c09)
R0AREABC8CUAAcEAAP8B/wAB/IAUSBIBBkZGbXBlZwlTZXJ2aWNlMDF3fEPK////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//////////////////////9HQAAQAACwDQABwQAAAAHwACqxBLL/////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////0dQABAAArASAAHBAADhAPAAG+EA8AAV
vU1W////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////R0EAMAdQ
AAB7DH4AAAAB4AAAgIAFIQAH2GEAAAABCfAAAAABZ0LACtp7ARAAAAMAEAAAAwMo8SJqAAAAAWjO
D8gAAAEGBf//UtxF6b3m2Ui3lizYINkj7u94MjY0IC0gY29yZSAxNjUgcjMyMjIgYjM1NjA1YSAt
IEguMjY0L01QRUctNCBBVkMgY29kZWMgLSBDb3B5bGVmdCAyMDAzLTIwMjUgLSBodHRwOi8vd3d3
LnZpZGVvbGFuLm9HAQARcmcveDI2NC5odG1sIC0gb3B0aW9uczogY2FiYWM9MCByZWY9MSBkZWJs
b2NrPTA6MDowIGFuYWx5c2U9MDowIG1lPWRpYSBzdWJtZT0wIHBzeT0xIHBzeV9yZD0xLjAwOjAu
MDAgbWl4ZWRfcmVmPTAgbWVfcmFuZ2U9MTYgY2hyb21hX21lPTEgdHJlbGxpcz0wIDh4OGRjdD0w
IGNxbT0wIGRlYWR6b25lPTIxLDExIGZhc3RfcEcBABJza2lwPTEgY2hyb21hX3FwX29mZnNldD0w
IHRocmVhZHM9MSBsb29rYWhlYWRfdGhyZWFkcz0xIHNsaWNlZF90aHJlYWRzPTAgbnI9MCBkZWNp
bWF0ZT0xIGludGVybGFjZWQ9MCBibHVyYXlfY29tcGF0PTAgY29uc3RyYWluZWRfaW50cmE9MCBi
ZnJhbWVzPTAgd2VpZ2h0cD0wIGtleWludD0xMDAwIGtleWludF9taW49NTAxRwEAMzwA////////
//////////////////////////////////////////////////////////////////////8gc2Nl
bmVjdXQ9MCBpbnRyYV9yZWZyZXNoPTAgcmM9Y3JmIG1idHJlZT0wIGNyZj0yMy4wIHFjb21wPTAu
NjAgcXBtaW49MCBxcG1heD02OSBxcHN0ZXA9NCBpcF9yYXRpbz0xLjQwIGFxPTAAgAAAAWWIhDom
KAAJAuBHQQA0mgD/////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////8AAAHgAACA
gAUhAAf0gQAAAAEJ8AAAAAFBmiAmlEdBADWaEAAAiRx+AP//////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/////////////wAAAeAAAICABSEACRChAAAAAQnwAAAAAUGaQCqUR0EANpoA////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////AAAB4AAAgIAFIQAJLMEAAAABCfAAAAABQZpgKpRH
QQA3mhAAAJcsfgD/////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////8AAAHgAACAgAUhAAlI
4QAAAAEJ8AAAAAFBmoAqlEdBADiaAP//////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/////wAAAeAAAICABSEACWUBAAAAAQnwAAAAAUGaoCqUR0EAOZoQAAClPH4A////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////AAAB4AAAgIAFIQAJgSEAAAABCfAAAAABQZrAKpRHQQA6mgD/
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////8AAAHgAACAgAUhAAmdQQAAAAEJ
8AAAAAFBmuAqlEdBADuaEAAAs0x+AP//////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////wAA
AeAAAICABSEACblhAAAAAQnwAAAAAUGbACqUR0EAPJoA////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////AAAB4AAAgIAFIQAJ1YEAAAABCfAAAAABQZsgKpRHQQA9mhAAAMFcfgD/
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////8AAAHgAACAgAUhAAnxoQAAAAEJ8AAAAAFB
m0AqlEdBAD6aAP//////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////wAAAeAAAICA
BSEACw3BAAAAAQnwAAAAAUGbYCqUR0EAP5oQAADPbH4A////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////AAAB4AAAgIAFIQALKeEAAAABCfAAAAABQZuAKpRHQQAwmgD/////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//////////////////////////////////8AAAHgAACAgAUhAAtGAQAAAAEJ8AAAAAFBm6AqlEdB
ADGaEAAA3Xx+AP//////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////wAAAeAAAICABSEAC2Ih
AAAAAQnwAAAAAUGbwCqUR0EAMpoA////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////AAAB4AAAgIAFIQALfkEAAAABCfAAAAABQZvgKpRHQQAzmhAAAOuMfgD/////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//////////////////////////8AAAHgAACAgAUhAAuaYQAAAAEJ8AAAAAFBmgAqlEdBADSaAP//
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////wAAAeAAAICABSEAC7aBAAAAAQnw
AAAAAUGaICqUR0EANZoQAAD5nH4A////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////AAAB
4AAAgIAFIQAL0qEAAAABCfAAAAABQZpAKpRHQQA2mgD/////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//////////////////8AAAHgAACAgAUhAAvuwQAAAAEJ8AAAAAFBmmAqlEdBADeaEAABB6x+AP//
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////wAAAeAAAICABSEADQrhAAAAAQnwAAAAAUGa
gCqUR0EAOJoA////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////AAAB4AAAgIAF
IQANJwEAAAABCfAAAAABQZqgKpRHQQA5mhAAARW8fgD/////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//////////8AAAHgAACAgAUhAA1DIQAAAAEJ8AAAAAFBmsAqlEdBADqaAP//////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/////////////////////////////////wAAAeAAAICABSEADV9BAAAAAQnwAAAAAUGa4CqUR0EA
O5oQAAEjzH4A////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////AAAB4AAAgIAFIQANe2EA
AAABCfAAAAABQZsAKpRHQQA8mgD/////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//8AAAHgAACAgAUhAA2XgQAAAAEJ8AAAAAFBmyAqlEdBAD2aEAABMdx+AP//////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/////////////////////////wAAAeAAAICABSEADbOhAAAAAQnwAAAAAUGbQCqUR0EAPpoA////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////AAAB4AAAgIAFIQANz8EAAAABCfAA
AAABQZtgKpRHQQA/mhAAAT/sfgD/////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////8AAAHg
AACAgAUhAA3r4QAAAAEJ8AAAAAFBm4AqlEdBADCaAP//////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/////////////////wAAAeAAAICABSEADwgBAAAAAQnwAAAAAUGboCqUR0EAMZoQAAFN/H4A////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////AAAB4AAAgIAFIQAPJCEAAAABCfAAAAABQZvA
KpRHQQAymgD/////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////8AAAHgAACAgAUh
AA9AQQAAAAEJ8AAAAAFBm+AqlEdBADOaEAABXAx+AP//////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/////////wAAAeAAAICABSEAD1xhAAAAAQnwAAAAAUGaACqUR0EANJoA////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////AAAB4AAAgIAFIQAPeIEAAAABCfAAAAABQZogKpRHQQA1
mhAAAWocfgD/////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////8AAAHgAACAgAUhAA+UoQAA
AAEJ8AAAAAFBmkAqlEdBADaaAP//////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/wAAAeAAAICABSEAD7DBAAAAAQnwAAAAAUGaYCqUR0EAN5oQAAF4LH4A////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////AAAB4AAAgIAFIQAPzOEAAAABCfAAAAABQZqAKpRHQQA4mgD/////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////8AAAHgAACAgAUhAA/pAQAAAAEJ8AAA
AAFBmqAqlEdBADmaEAABhjx+AP//////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////wAAAeAA
AICABSEAEQUhAAAAAQnwAAAAAUGawCqUR0EAOpoA////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////AAAB4AAAgIAFIQARIUEAAAABCfAAAAABQZrgKpRHQQA7mhAAAZRMfgD/////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////8AAAHgAACAgAUhABE9YQAAAAEJ8AAAAAFBmwAq
lEdBADyaAP//////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////wAAAeAAAICABSEA
EVmBAAAAAQnwAAAAAUGbICqUR0EAPZoQAAGiXH4A////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////AAAB4AAAgIAFIQARdaEAAAABCfAAAAABQZtAKpRHQQA+mgD/////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//////////////////////////////8AAAHgAACAgAUhABGRwQAAAAEJ8AAAAAFBm2AqlEdBAD+a
EAABsGx+AP//////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////wAAAeAAAICABSEAEa3hAAAA
AQnwAAAAAUGbgCqUR0EAMJoA////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
AAAB4AAAgIAFIQARygEAAAABCfAAAAABQZugKpRHQQAxmhAAAb58fgD/////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//////////////////////8AAAHgAACAgAUhABHmIQAAAAEJ8AAAAAFBm8AqlEdBADKaAP//////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////wAAAeAAAICABSEAEwJBAAAAAQnwAAAA
AUGb4CqUR0EAM5oQAAHMjH4A////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////AAAB4AAA
gIAFIQATHmEAAAABCfAAAAABQZoAKpRHQQA0mgD/////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//////////////8AAAHgAACAgAUhABM6gQAAAAEJ8AAAAAFBmiAqlEdBADWaEAAB2px+AP//////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////wAAAeAAAICABSEAE1ahAAAAAQnwAAAAAUGaQCqU
R0EANpoA////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////AAAB4AAAgIAFIQAT
csEAAAABCfAAAAABQZpgKpRHQQA3mhAAAeisfgD/////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//////8AAAHgAACAgAUhABOO4QAAAAEJ8AAAAAFBmoAqlEdBADiaAP//////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/////////////////////////////wAAAeAAAICABSEAE6sBAAAAAQnwAAAAAUGaoCqUR0EAOZoQ
AAH2vH4A////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////AAAB4AAAgIAFIQATxyEAAAAB
CfAAAAABQZrAKpRHQQA6mgD/////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////8A
AAHgAACAgAUhABPjQQAAAAEJ8AAAAAFBmuAqlEdBADuaEAACBMx+AP//////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/////////////////////wAAAeAAAICABSEAE/9hAAAAAQnwAAAAAUGbACqUR0EAPJoA////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////AAAB4AAAgIAFIQAVG4EAAAABCfAAAAAB
QZsgKpRHQQA9mhAAAhLcfgD/////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////8AAAHgAACA
gAUhABU3oQAAAAEJ8AAAAAFBm0AqlEdBAD6aAP//////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/////////////wAAAeAAAICABSEAFVPBAAAAAQnwAAAAAUGbYCqUR0EAP5oQAAIg7H4A////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////AAAB4AAAgIAFIQAVb+EAAAABCfAAAAABQZuAKpRH
QQAwmgD/////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////8AAAHgAACAgAUhABWM
AQAAAAEJ8AAAAAFBm6AqlEdBADGaEAACLvx+AP//////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/////wAAAeAAAICABSEAFaghAAAAAQnwAAAAAUGbwCqUR0EAMpoA////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////AAAB4AAAgIAFIQAVxEEAAAABCfAAAAABQZvgKpRHQQAzmhAA
Aj0MfgD/////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////8AAAHgAACAgAUhABXgYQAAAAEJ
8AAAAAFBmgAqlEdBADSaAP//////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////wAA
AeAAAICABSEAFfyBAAAAAQnwAAAAAUGaICqUR0EANZoQAAJLHH4A////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////AAAB4AAAgIAFIQAXGKEAAAABCfAAAAABQZpAKpRHQQA2mgD/////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////8AAAHgAACAgAUhABc0wQAAAAEJ8AAAAAFB
mmAqlEdBADeaEAACWSx+AP//////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////wAAAeAAAICA
BSEAF1DhAAAAAQnwAAAAAUGagCqUR0EAOJoA////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////AAAB4AAAgIAFIQAXbQEAAAABCfAAAAABQZqgKpRHQQA5mhAAAmc8fgD/////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//////////////////////////////////8AAAHgAACAgAUhABeJIQAAAAEJ8AAAAAFBmsAqlEdB
ADqaAP//////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////wAAAeAAAICABSEAF6VB
AAAAAQnwAAAAAUGa4CqUR0EAO5oQAAJ1TH4A////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////AAAB4AAAgIAFIQAXwWEAAAABCfAAAAABQZsAKpRHQQA8mgD/////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//////////////////////////8AAAHgAACAgAUhABfdgQAAAAEJ8AAAAAFBmyAqlEdBAD2aEAAC
g1x+AP//////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////wAAAeAAAICABSEAF/mhAAAAAQnw
AAAAAUGbQCqUR0EAPpoA////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////AAAB
4AAAgIAFIQAZFcEAAAABCfAAAAABQZtgKpRHQQA/mhAAApFsfgD/////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//////////////////8AAAHgAACAgAUhABkx4QAAAAEJ8AAAAAFBm4AqlEdBADCaAP//////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////wAAAeAAAICABSEAGU4BAAAAAQnwAAAAAUGb
oCqUR0EAMZoQAAKffH4A////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////AAAB4AAAgIAF
IQAZaiEAAAABCfAAAAABQZvAKpRHQQAymgD/////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//////////8AAAHgAACAgAUhABmGQQAAAAEJ8AAAAAFBm+AqlEdBADOaEAACrYx+AP//////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/////////////////////////////////wAAAeAAAICABSEAGaJhAAAAAQnwAAAAAUGaACqUR0EA
NJoA////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////AAAB4AAAgIAFIQAZvoEA
AAABCfAAAAABQZogKpRHQQA1mhAAArucfgD/////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//8AAAHgAACAgAUhABnaoQAAAAEJ8AAAAAFBmkAqlEdBADaaAP//////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/////////////////////////wAAAeAAAICABSEAGfbBAAAAAQnwAAAAAUGaYCqUR0EAN5oQAALJ
rH4A////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////AAAB4AAAgIAFIQAbEuEAAAABCfAA
AAABQZqAKpRHQQA4mgD/////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////8AAAHg
AACAgAUhABsvAQAAAAEJ8AAAAAFBmqAqlEdBADmaEAAC17x+AP//////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/////////////////wAAAeAAAICABSEAG0shAAAAAQnwAAAAAUGawCqUR0EAOpoA////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////AAAB4AAAgIAFIQAbZ0EAAAABCfAAAAABQZrg
KpRHQQA7mhAAAuXMfgD/////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////8AAAHgAACAgAUh
ABuDYQAAAAEJ8AAAAAFBmwAqlEdBADyaAP//////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/////////wAAAeAAAICABSEAG5+BAAAAAQnwAAAAAUGbICqUR0EAPZoQAALz3H4A////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////AAAB4AAAgIAFIQAbu6EAAAABCfAAAAABQZtAKpRHQQA+
mgD/////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////8AAAHgAACAgAUhABvXwQAA
AAEJ8AAAAAFBm2AqlEdBAD+aEAADAex+AP//////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/wAAAeAAAICABSEAG/PhAAAAAQnwAAAAAUGbgCqUR0EAMJoA////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////AAAB4AAAgIAFIQAdEAEAAAABCfAAAAABQZugKpRHQQAxmhAAAw/8
fgD/////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////8AAAHgAACAgAUhAB0sIQAAAAEJ8AAA
AAFBm8AqlEdBADKaAP//////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////wAAAeAA
AICABSEAHUhBAAAAAQnwAAAAAUGb4CqUR0EAM5oQAAMeDH4A////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////AAAB4AAAgIAFIQAdZGEAAAABCfAAAAABQZoAKpRHQQA0mgD/////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////8AAAHgAACAgAUhAB2AgQAAAAEJ8AAAAAFBmiAq
lEdBADWaEAADLBx+AP//////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////wAAAeAAAICABSEA
HZyhAAAAAQnwAAAAAUGaQCqUR0EANpoA////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////AAAB4AAAgIAFIQAduMEAAAABCfAAAAABQZpgKpRHQQA3mhAAAzosfgD/////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//////////////////////////////8AAAHgAACAgAUhAB3U4QAAAAEJ8AAAAAFBmoAqlEdBADia
AP//////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////wAAAeAAAICABSEAHfEBAAAA
AQnwAAAAAUGaoCqUR0EAOZoQAANIPH4A////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
AAAB4AAAgIAFIQAfDSEAAAABCfAAAAABQZrAKpRHQQA6mgD/////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//////////////////////8AAAHgAACAgAUhAB8pQQAAAAEJ8AAAAAFBmuAqlEdBADuaEAADVkx+
AP//////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////wAAAeAAAICABSEAH0VhAAAAAQnwAAAA
AUGbACqUR0EAPJoA////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////AAAB4AAA
gIAFIQAfYYEAAAABCfAAAAABQZsgKpRHQQA9mhAAA2RcfgD/////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//////////////8AAAHgAACAgAUhAB99oQAAAAEJ8AAAAAFBm0AqlEdBAD5yAP//////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////AAAB4AAAgIAFIQAf
mcEAAAABCfAAAAABBgQgtQAvAxtI/wcILQaYIAYKCgYBDwYAiQYBSAZJiAYBAP+AAAAAAUGbYCqU
R0EAP5oQAANybH4A////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////AAAB4AAAgIAFIQAf
teEAAAABCfAAAAABQZuAKpRHQQAwmgD/////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//////8AAAHgAACAgAUhAB/SAQAAAAEJ8AAAAAFBm6AqlA==

print_scc_time() and its Rust counterparts computed the SCC frame field
with a hardcoded 29.97, so SCC output from 24/25/30 fps sources carried
the wrong frame numbers. Use current_fps in C and in the Rust 708 writer,
and pass the rate to Timestamp::to_scc_time().

The Rust writer also still subtracted a hardcoded 29.97 frame delay in
the overlap/clear cases; match the C path, which has used current_fps
since CCExtractor#2173. While there, fix the u8 overflow in to_scc_time() and print
an integer frame instead of a fractional value.
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.

BUG: SCC timecodes use hardcoded 29.97 FPS instead of actual stream frame rate

2 participants