MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / parseFrameRate

Function parseFrameRate

packages/engine/src/utils/ffprobe.ts:238–247  ·  view source on GitHub ↗
(frameRateStr: string | undefined)

Source from the content-addressed store, hash-verified

236}
237
238function parseFrameRate(frameRateStr: string | undefined): number {
239 if (!frameRateStr) return 0;
240 const parts = frameRateStr.split("/");
241 if (parts.length === 2) {
242 const num = parseFloat(parts[0] ?? "");
243 const den = parseFloat(parts[1] ?? "");
244 if (den !== 0) return Math.round((num / den) * 100) / 100;
245 }
246 return parseFloat(frameRateStr) || 0;
247}
248
249/**
250 * Probe a media file (video, image, or container) and return normalized metadata.

Callers 1

extractMediaMetadataFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected