Nexrender: action encode error

Created on 23 Apr 2020  路  15Comments  路  Source: inlife/nexrender

Recently I have been experiencing errors trying to use action-encode as a postrender module on node js. ,

"actions": {

"postrender": [
{
"module": "@nexrender/action-encode",
"output": "encode.mp4",
"preset": "mp4",
"params": {"-vcodec": "libx264", "-r": 25}
},

              {
                "module": "@nexrender/action-copy",
                 "output": "C:/Users/chaza/Documents/nexrender/exports mp4 copis/thisIsACopy.mp4"
             },

              ]
   },

I get the following:

[HCsuaTveEEyfO2Q9OGgkO] applying postrender actions...
[HCsuaTveEEyfO2Q9OGgkO] starting action-encode action (ffmpeg)
[HCsuaTveEEyfO2Q9OGgkO] action-encode: input file C:\Users\chaza\Documents\nexrender\HCsuaTveEEyfO2Q9OGgkO\result.avi
[HCsuaTveEEyfO2Q9OGgkO] action-encode: output file C:\Users\chaza\Documents\nexrender\HCsuaTveEEyfO2Q9OGgkO\encode.mp4
Error: Error loading postrender module @nexrender/action-encode: Error: Error in action-encode module (ffmpeg)
at C:\Users\chaza\Desktop\paginas\invitaciones\prueba4\node_modules\@nexrender\core\src\tasks\actions.js:25:35
at runMicrotasks ()
at processTicksAndRejections
(internal/process/task_queues.js:97:5)
at async main (C:\Users\chaza\Desktop\paginas\invitaciones\prueba 4\src\routes\index.js:234:23)

I tried reinstalling the modules without luck.
could you help me?
thanx

question

All 15 comments

What versions of nexrender are you using?

hi,
"@nexrender/action-copy": "^1.8.16",
"@nexrender/action-encode": "^1.12.6",
"@nexrender/core": "^1.13.0",

Nexrender make a folder with an id, copy the project and the assets, then make the render, and the action-copy module work well too but the action encode module fail.

could you try using lower version of action-encode to see if that would work
in 1.12.6 I updated the backend library, that might be the reason

Thank you so much, I install the 1.12.4 version and the module work perfect.
The only thing , when I was installing that version I get the following:

"npm WARN deprecated [email protected]: ffmpeg-static@2 won't be updated with new ffmpeg binaries anymore. Use ffmpeg-static@latest.

I dont know if it is important (I could get the encode :)

I've been getting the similar error, I'm on a mac using yarn workspaces. action-encode line 52 resolve(require(mymodule + '-static').path) is returning undefined. however resolve(require(mymodule + '-static')) works

Looking at ffmpeg-static - all it exports and returns a string. Will put in a pull request.

FYI ffmpeg-static

'use strict'

if (process.env.FFMPEG_BIN) {
  module.exports = process.env.FFMPEG_BIN
} else {
  var os = require('os')
  var path = require('path')

  var binaries = Object.assign(Object.create(null), {
    darwin: ['x64'],
    linux: ['x64', 'ia32', 'arm64', 'arm'],
    win32: ['x64', 'ia32']
  })

  var platform = os.platform()
  var arch = os.arch()

  var ffmpegPath = path.join(
    __dirname,
    platform === 'win32' ? 'ffmpeg.exe' : 'ffmpeg'
  )

  if (!binaries[platform] || binaries[platform].indexOf(arch) === -1) {
    ffmpegPath = null
  }

  module.exports = ffmpegPath
}

Oh, I see, they've changed api in the newer version, my mistake for not checking that properly

the new version 1.13.1 with fixes from @pdkn is published and binaries are being assembled

Hi @inlife ,

after updating the new version, I met this error, could you help me? Thanks!

> job rendering failed
Error: Error loading postrender module @nexrender/action-encode: Error: Error starting ffmpeg process: Error: spawn /usr/local/lib/node_modules/@nexrender/action-encode/node_modules/ffmpeg-static/ffmpeg EACCES
    at /usr/local/lib/node_modules/@nexrender/core/src/tasks/actions.js:25:35

try installing a previous version. " npm i @nexrender/[email protected] -g " (it works for me).

Or try updating ffmpeg

I have installed 1.12.4 and .6 version and worked fine but now I have the same error with all versions. Someone could fix it?

Error: Error loading postrender module @nexrender/action-encode: Error: Error in action-encode module (ffmpeg)
at C:\Users\chaza\Desktop\paginas\invitaciones\prueba 4\node_modules\@nexrender\core\src\tasks\actions.js:25:35
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async main (C:\Users\chaza\Desktop\paginas\invitaciones\prueba 4\src\routes\index.js:234:23)

Seems like there is an issue with permissions of the FFmpeg executable, at least judging from the error message that @northwind provided, can anybody else confirm that this is the case?

Please, check if the release v1.16.0 fixes that issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Dezzymei picture Dezzymei  路  3Comments

amarCosmospace picture amarCosmospace  路  3Comments

Marcuzzz picture Marcuzzz  路  4Comments

danielgwilson picture danielgwilson  路  3Comments

darshak-gosar picture darshak-gosar  路  3Comments