Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#2,145 11 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
1/5
Thời gian dự kiến
Dưới một giờ
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
c
Lĩnh vực
backend

Hướng nghiên cứu

Bắt đầu trong src/lib_ccx/ccx_common_timing.c tại print_scc_time() và sử dụng lệnh grep từ issue để xác nhận tốc độ khung hình được hardcode. Kiểm tra các cập nhật của current_fps trong avc_functions.c và es_functions.c, sau đó xác minh rằng timecode SCC sử dụng tốc độ khung hình thực tế của stream đối với các nguồn không phải 29.97.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
C
Star
901
Fork
591
Merge trung bình
5 ngày 10 giờ
Pull request đã merge (30 ngày)
12

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của CCExtractor/ccextractor

Tất cả issue của CCExtractor/ccextractor

Issue tương tự

Thêm issue về C

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.