MCPcopy Index your code
hub / github.com/simstudioai/sim / overlayImage

Function overlayImage

apps/sim/lib/media/ffmpeg.ts:472–487  ·  view source on GitHub ↗
(
  dir: string,
  inputPaths: string[],
  options: FfmpegOptions
)

Source from the content-addressed store, hash-verified

470}
471
472async function overlayImage(
473 dir: string,
474 inputPaths: string[],
475 options: FfmpegOptions
476): Promise<FfmpegResult> {
477 if (inputPaths.length < 2) throw new Error('overlay_image requires [video, image]')
478 const xy = OVERLAY_POSITION[options.position || 'top-right'] || OVERLAY_POSITION['top-right']
479 const outputPath = path.join(dir, 'out.mp4')
480 const command = ffmpeg()
481 .input(inputPaths[0])
482 .input(inputPaths[1])
483 .complexFilter([`[0:v][1:v]overlay=${xy}[v]`])
484 .outputOptions(['-map', '[v]', '-map', '0:a?', '-c:a', 'copy'])
485 await runCommand(command, outputPath)
486 return readOut(outputPath, 'mp4')
487}
488
489async function addText(
490 dir: string,

Callers 1

runFfmpegOperationFunction · 0.85

Calls 3

readOutFunction · 0.85
joinMethod · 0.80
runCommandFunction · 0.70

Tested by

no test coverage detected