tnfe / FFCreator

A fast video processing library based on node.js (一个基于node.js的高速视频制作库)
http://tnfe.github.io/FFCreator/
MIT License
2.78k stars 392 forks source link

Creating outputDir with the FFCreator instance #405

Closed khatiwadaaj closed 7 months ago

khatiwadaaj commented 8 months ago

const cacheDir = join(dirname, "../cache/"); const outputDir = join(dirname, "../video/");

// create creator instance const width = 1080; const height = 1920; const creator = new FFCreator({ cacheDir: cacheDir, outputDir: outputDir, width: width, height: height, // log: true, highWaterMark: "8mb", parallel: 1, fps: 30, });

I have something like this, but it always creates the videos in / directory of where my index.js of project is. Am I missing something? Please direct me towards anything that is helpful.

zdu-strong commented 7 months ago

Please use output.

const output = join(__dirname, "../video/video.mp4");

// create creator instance
const width = 1080;
const height = 1920;
const creator = new FFCreator({
  cacheDir: cacheDir,
  output: output,
  width: width,
  height: height,
  // log: true,
  highWaterMark: "8mb",
  parallel: 1,
  fps: 30,
});
yeeddd commented 7 months ago

mark

yeeddd commented 7 months ago

output: output, width: width,

请问下 output 和outputDir ,分别是啥作用,以及有啥区别?我看example中使用outputDir就能正常输出在对应目录,而我就是在当前目录生成。不知道啥原因。