Documentation
¶
Overview ¶
Package framerate provides framerate drift detection for subtitle alignment.
Index ¶
Constants ¶
View Source
const MinLinearR2 = 0.8
MinLinearR2 is the minimum R² (coefficient of determination) for drift to be considered linear (indicating a framerate mismatch rather than random or constant offset). Below this threshold, drift is non-linear.
Variables ¶
View Source
var KnownFramerates = []float64{
23.976,
24.0,
25.0,
29.97,
30.0,
48.0,
50.0,
59.94,
60.0,
}
KnownFramerates contains common video framerates and their NTSC/PAL conversions.
View Source
var KnownRatios = buildKnownRatios()
KnownRatios contains all common framerate conversion pairs.
Functions ¶
func LinearRegression ¶
func LinearRegression(points []DriftPoint) (slope, intercept, r2 float64)
LinearRegression fits y = slope*x + intercept to the drift points.
Types ¶
type DriftPoint ¶
DriftPoint represents a measured drift at a timeline position.
Click to show internal directories.
Click to hide internal directories.