MCPcopy Index your code
hub / github.com/CapSoftware/Cap / getMetadataFromVideoRow

Function getMetadataFromVideoRow

apps/web/workflows/edit-video.ts:341–366  ·  view source on GitHub ↗
(
	video:
		| {
				duration: number | null;
				width: number | null;
				height: number | null;
				fps: number | null;
		  }
		| undefined,
)

Source from the content-addressed store, hash-verified

339}
340
341function getMetadataFromVideoRow(
342 video:
343 | {
344 duration: number | null;
345 width: number | null;
346 height: number | null;
347 fps: number | null;
348 }
349 | undefined,
350): VideoEditRenderResult["metadata"] | null {
351 if (
352 !video ||
353 !isPositiveNumber(video.width) ||
354 !isPositiveNumber(video.height) ||
355 !isPositiveNumber(video.fps)
356 ) {
357 return null;
358 }
359
360 return {
361 duration: isPositiveNumber(video.duration) ? video.duration : 0,
362 width: video.width,
363 height: video.height,
364 fps: video.fps,
365 };
366}
367
368async function getCompletedMetadata(
369 videoId: string,

Callers 1

getCompletedMetadataFunction · 0.70

Calls 1

isPositiveNumberFunction · 0.70

Tested by

no test coverage detected