INNER CODE UNIT · TypeScript
getFirstVideoInfo
vargHQ/sdk · src/ai-sdk/providers/editly/index.ts:55
async function getFirstVideoInfo(
clips: Clip[],
backend: FFmpegBackend,
): Promise<{
width?: number;
height?: number;
fps?: number;
}> {
for (const clip of clips) {
for (const layer of clip.layers) {
if (layer.type === "video") {
const info = await backend.ffprobe((layer as VideoLayer).path);
return {
...(info.width != null ? { width: info.width } : {}),
...(info.height != null ? { height: info.height } : {}),
...(info.fps != null ? { fps: info.fps } : {}),
};
}