transitive-bullshit / ffmpeg-concat

Concats a list of videos together using ffmpeg with sexy OpenGL transitions.
863 stars 113 forks source link

Unable to get transitions json working #158

Closed sbutler44 closed 6 months ago

sbutler44 commented 6 months ago

I'm able to get a number of videos concatenated with a single transition, but when I want multiple transitions using a json file, I get the following error:

` ffmpeg-concat: 4.32ms concat error Error: number of transitions must equal number of videos minus one at module.exports (C:\Users\Simon\AppData\Roaming\npm\node_modules\ffmpeg-concat\lib\init-frames.js:26:11) at module.exports (C:\Users\Simon\AppData\Roaming\npm\node_modules\ffmpeg-concat\lib\index.js:44:15) at module.exports (C:\Users\Simon\AppData\Roaming\npm\node_modules\ffmpeg-concat\lib\cli.js:39:11) at Object. (C:\Users\Simon\AppData\Roaming\npm\node_modules\ffmpeg-concat\lib\cli.js:65:8) at Module._compile (node:internal/modules/cjs/loader:1376:14) at Module._extensions..js (node:internal/modules/cjs/loader:1435:10) at Module.load (node:internal/modules/cjs/loader:1207:32) at Module._load (node:internal/modules/cjs/loader:1023:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12) at node:internal/main/run_main_module:28:49 node:internal/process/promises:289 triggerUncaughtException(err, true / fromPromise /); ^

Error: number of transitions must equal number of videos minus one at module.exports (C:\Users\Simon\AppData\Roaming\npm\node_modules\ffmpeg-concat\lib\init-frames.js:26:11) at module.exports (C:\Users\Simon\AppData\Roaming\npm\node_modules\ffmpeg-concat\lib\index.js:44:15) at module.exports (C:\Users\Simon\AppData\Roaming\npm\node_modules\ffmpeg-concat\lib\cli.js:39:11) at Object. (C:\Users\Simon\AppData\Roaming\npm\node_modules\ffmpeg-concat\lib\cli.js:65:8) at Module._compile (node:internal/modules/cjs/loader:1376:14) at Module._extensions..js (node:internal/modules/cjs/loader:1435:10) at Module.load (node:internal/modules/cjs/loader:1207:32) at Module._load (node:internal/modules/cjs/loader:1023:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12) at node:internal/main/run_main_module:28:49

Node.js v20.10.0 `

My commandline is:

ffmpeg-concat --transitions temp.json -o output.mp4 1.mp4 2.mp4 3.mp4 4.mp4 5.mp4

And my json file is:

{ "transitions": [ { "name": "circleopen", "duration": 2000 }, { "name": "crosswarp", "duration": 2000 }, { "name": "directionalwarp", "duration": 2000 }, { "name": "squareswire", "duration": 2000 } ] }

sbutler44 commented 6 months ago

I have worked around this issue by having Python write the node.js code to have multiple mp4s and multiple transitions.