(filePath: string)
| 403 | * yt-dlp --download-sections or screen recordings often have sparse keyframes. |
| 404 | */ |
| 405 | export async function analyzeKeyframeIntervals(filePath: string): Promise<KeyframeAnalysis> { |
| 406 | const cached = keyframeCache.get(filePath); |
| 407 | if (cached) return cached; |
| 408 | |
| 409 | const promise = analyzeKeyframeIntervalsUncached(filePath); |
| 410 | keyframeCache.set(filePath, promise); |
| 411 | promise.catch(() => { |
| 412 | if (keyframeCache.get(filePath) === promise) { |
| 413 | keyframeCache.delete(filePath); |
| 414 | } |
| 415 | }); |
| 416 | return promise; |
| 417 | } |
| 418 | |
| 419 | async function analyzeKeyframeIntervalsUncached(filePath: string): Promise<KeyframeAnalysis> { |
| 420 | const stdout = await runFfprobe([ |
no test coverage detected