filipedeschamps / video-maker

Projeto open source para fazer vídeos automatizados
MIT License
2.43k stars 629 forks source link

Error #331

Closed NiinjaFeroz closed 3 years ago

NiinjaFeroz commented 3 years ago

[video-robot] Starting After Effects (node:440) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_ARG_VALUE]: The argument 'file' cannot be empty. Received '' at normalizeSpawnArguments (child_process.js:414:11) at spawn (child_process.js:545:16) at Promise (C:\video-maker\robots\video.js:164:24) at new Promise () at renderVideoWithAfterEffects (C:\video-maker\robots\video.js:147:12) at Object.robot [as video] (C:\video-maker\robots\video.js:18:9) at process._tickCallback (internal/process/next_tick.js:68:7) (node:440) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2) (node:440) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

o código no momento é: async function createAfterEffectsScript(content) { await state.saveScript(content) }

async function renderVideoWithAfterEffects() { return new Promise((resolve, reject) => { const systemPlatform=os.platform

  let aerenderFilePath = ''
  if (systemPlatform== 'darwin'){
    const aerenderFilePath = 'C:\\Program Files\\Adobe\\Adobe After Effects 2019\\Support Files\\aerender.exe'
  }else if (systemPlatform=='win32'){
    const aerenderFilePath = '%programfiles%\Adobe\Adobe After Effects CC\Arquivos de suporte\aerender.exe'
  }else{
    return reject(new Error('System not Supported'))
  }

  const templateFilePath = fromRoot('${rootPath}/templates/1/template.aep')
  const destinationFilePath = fromRoot('${rootPath}/content/output.mov')

  console.log('> [video-robot] Starting After Effects')

  const aerender = spawn(aerenderFilePath, [
    '-comp', 
    'main',
    '-project', 
    templateFilePath,
    '-output', 
    destinationFilePath
  ])

  aerender.stdout.on('data', (data) => {
    process.stdout.write(data)
  })

  aerender.on('close', () => {
    console.log('> [video-robot] After Effects closed')
    resolve()
  })
})

}

}

module.exports = robot