FrameRateMetrics
Computed metrics about the frame rate of a video track.
type FrameRateMetrics = {
underlyingFrameRate: number | null;
bestGuessFrameRate: number;
minFrameRate: number;
maxFrameRate: number;
averageFrameRate: number;
medianFrameRate: number;
frameRateIsConstant: boolean;
probedPacketCount: number;
};Used by
Properties
underlyingFrameRate
underlyingFrameRate: number | null;The true, underlying frame rate of the video that produced the frame timestamps. This value is heuristically determined by examining the time differences between frames, excluding outliers, and then fitting them to fractions. This algorithm is stable even when frames are dropped, as long as all frames lie roughly on one uniform lattice.
If this field is not null, Mediabunny is extremely confident in having found the actual frame rate of the video.
This field is null for videos where no consistent underlying frame rate was detected, indicating a variable frame-rate (VFR) video.
bestGuessFrameRate
bestGuessFrameRate: number;Mediabunny's best guess for the video's actual intended frame rate.
This value is determined heuristically. If underlyingFrameRate exists, this field will be equal to it. If it doesn't, Mediabunny will check if medianFrameRate is close to a "common" frame rate and if so, snap to it. Otherwise, this field simply falls back to medianFrameRate.
minFrameRate
minFrameRate: number;The minimum frame rate of the video at any given point, based on the largest distance between two consecutive frames.
maxFrameRate
maxFrameRate: number;The maximum frame rate of the video at any given point, based on the smallest distance between two consecutive frames.
averageFrameRate
averageFrameRate: number;The average frame rate across the duration of the probed packets. This value represents the average frames per second; it is not the average of frame rates across the video.
medianFrameRate
medianFrameRate: number;The median frame rate, as determined by the distance between any two consecutive frames. For variable frame-rate (VFR) videos, this field gives you a good idea of the de facto frame rate of the video.
frameRateIsConstant
frameRateIsConstant: boolean;Is true only when the underlying video is CFR (constant frame-rate) and no frames are skipped.
probedPacketCount
probedPacketCount: number;The number of packets that were probed/inspected to estimate the frame rate. Probe at least 256 packets for a reliable estimation of frame rate.