MCPcopy Create free account
hub / github.com/CapSoftware/Cap / getMetadataFromVideoRow

Function getMetadataFromVideoRow

apps/web/workflows/process-video.ts:323–348  ·  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

321}
322
323function getMetadataFromVideoRow(
324 video:
325 | {
326 duration: number | null;
327 width: number | null;
328 height: number | null;
329 fps: number | null;
330 }
331 | undefined,
332): MediaServerProcessResult["metadata"] | null {
333 if (
334 !video ||
335 !isPositiveNumber(video.width) ||
336 !isPositiveNumber(video.height) ||
337 !isPositiveNumber(video.fps)
338 ) {
339 return null;
340 }
341
342 return {
343 duration: isPositiveNumber(video.duration) ? video.duration : 0,
344 width: video.width,
345 height: video.height,
346 fps: video.fps,
347 };
348}
349
350async function getCompletedMetadata(
351 videoId: string,

Callers 1

getCompletedMetadataFunction · 0.70

Calls 1

isPositiveNumberFunction · 0.70

Tested by

no test coverage detected