Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#2,145 10 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
1/5
Tempo stimato
Meno di un'ora
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
c
Ambito
backend

Direzione di ricerca

Inizia in src/lib_ccx/ccx_common_timing.c, nella funzione print_scc_time(), e usa il comando grep dell’issue per confermare il frame rate codificato staticamente. Controlla gli aggiornamenti di current_fps in avc_functions.c e es_functions.c, quindi verifica che i timecode SCC utilizzino il frame rate effettivo dello stream per le sorgenti diverse da 29.97.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Summary

print_scc_time() in src/lib_ccx/ccx_common_timing.c computes SCC timecode frame numbers using a hardcoded literal 29.97, completely ignoring the current_fps global that exists in the same file and is dynamically updated from stream NAL data at runtime.

Any SCC output from a 24fps, 25fps, 30fps, or 50/60fps source will have incorrect frame numbers in every timecode, making the output non-standard and potentially rejected by downstream validators.


Affected File

src/lib_ccx/ccx_common_timing.c — Line 125


Reproduction

grep -n "29\.97" src/lib_ccx/ccx_common_timing.c
22: double current_fps = (double)30000.0 / 1001; /* 29.97 */ // TODO: Get from framerates_values[] instead
125: frame = ((double)(time.time_in_ms - 1000 * (time.ss + 60 * (time.mm + 60 * time.hh))) * 29.97 / 1000);

Root Cause

current_fps is already updated dynamically in two places:

  • avc_functions.c:891 — from stream NAL timing data
  • avc_functions.c:991 and es_functions.c:442 — from framerates_values[current_frame_rate]

print_scc_time() is simply the one function that was never updated to use it.


Impact

  • All non-NTSC sources (24fps film, 25fps PAL, 30fps progressive) produce SCC timecodes with wrong frame numbers
  • 25fps PAL broadcasts — common across Europe — see a ~20% frame count error
  • Downstream broadcast validators may reject the output or apply incorrect sync

Suggested Fix

Single-token change on line 125:

// BEFORE:
frame = ((double)(time.time_in_ms - 1000 * (time.ss + 60 * (time.mm + 60 * time.hh))) * 29.97 / 1000);

// AFTER:
frame = ((double)(time.time_in_ms - 1000 * (time.ss + 60 * (time.mm + 60 * time.hh))) * current_fps / 1000);

current_fps is a file-level global in the same translation unit — no header changes needed. Happy to submit a PR for this.

Lingua principale
C
Stelle
902
Fork
591
Merge medio
4g 19h
PR unite (30g)
10

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di CCExtractor/ccextractor

Tutte le issue di CCExtractor/ccextractor

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.