MCPcopy Create free account
hub / github.com/TomClive/SeeDance2Stitcher / decodeGray

Function decodeGray

server.js:479–495  ·  view source on GitHub ↗
(filePath)

Source from the content-addressed store, hash-verified

477}
478
479async function decodeGray(filePath) {
480 const args = [
481 "-v", "error",
482 "-i", filePath,
483 "-vf", `scale=${ANALYSIS_WIDTH}:${ANALYSIS_HEIGHT}:flags=fast_bilinear,format=gray`,
484 "-f", "rawvideo",
485 "-"
486 ];
487 const { stdout } = await run(FFMPEG, args, { encoding: "buffer" });
488 const frameSize = ANALYSIS_WIDTH * ANALYSIS_HEIGHT;
489 const frameCount = Math.floor(stdout.length / frameSize);
490 const frames = new Array(frameCount);
491 for (let i = 0; i < frameCount; i += 1) {
492 frames[i] = stdout.subarray(i * frameSize, (i + 1) * frameSize);
493 }
494 return frames;
495}
496
497function stats(frame) {
498 let sum = 0;

Callers 1

analyseSessionFunction · 0.85

Calls 1

runFunction · 0.85

Tested by

no test coverage detected