node-ffmetadata icon indicating copy to clipboard operation
node-ffmetadata copied to clipboard

Error: spawn ffmpeg ENOENT

Open sumitridhal opened this issue 8 years ago • 4 comments

Error reading metadata { Error: spawn ffmpeg ENOENT at exports._errnoException (util.js:1022:11) at Process.ChildProcess._handle.onexit (internal/child_process.js:189:19) at onErrorNT (internal/child_process.js:366:16) at _combinedTickCallback (internal/process/next_tick.js:102:11) at process._tickCallback (internal/process/next_tick.js:161:9) at Function.Module.runMain (module.js:607:11) at startup (bootstrap_node.js:158:16) at bootstrap_node.js:575:3 code: 'ENOENT', errno: 'ENOENT', syscall: 'spawn ffmpeg', path: 'ffmpeg', spawnargs: [ '-i', 'song.mp3', '-f', 'ffmetadata', 'pipe:1' ] } C:\Sumit Ridhal\GitHub\audio-meta\node_modules\ffmetadata\index.js:41 stream.emit("error", new Error(error.getBody().toString())); ^

TypeError: Cannot read property 'toString' of undefined at ChildProcess. (C:\Sumit Ridhal\GitHub\audio-meta\node_modules\ffmetadata\index.js:41:50) at emitTwo (events.js:125:13) at ChildProcess.emit (events.js:213:7) at maybeClose (internal/child_process.js:897:16) at Socket.stream.socket.on (internal/child_process.js:340:11) at emitOne (events.js:115:13) at Socket.emit (events.js:210:7) at Pipe._handle.close [as _onclose] (net.js:549:12)

sumitridhal avatar Jul 04 '17 17:07 sumitridhal

Do you have ffmpeg installed? See the Installation section in the readme. https://github.com/parshap/node-ffmetadata#installation

parshap avatar Jul 05 '17 03:07 parshap

@parshap Yes i have.

C:\Sumit Ridhal\GitHub\audio-meta\node_modules\ffmetadata\index.js:41
stream.emit("error", new Error(error.getBody().toString()));
^

sumitridhal avatar Jul 05 '17 07:07 sumitridhal

I also have this issue. I do not have ffmpeg installed globally, as I am using this in an Electron app (not all users will have ffmpeg installed). Instead I am using ffmpeg-binaries to load ffmpeg locally. This works fine for fluent-ffmpeg but seems incompatible with this lib. I have tried setting process.env.FFMPEG_PATH (which is what the README says to do) to './node_modules/ffmpeg-binaries/bin/ffmpeg.exe', './node_modules/ffmpeg-binaries/bin/ffmpeg' (which is what fluent-ffmpeg accepts), and './node_modules/ffmpeg-binaries/bin' but none have worked, I still get the same error described in this post.

jonbarrow avatar Jul 21 '17 00:07 jonbarrow

@jonbarrow It's been a long time, but I use ffmpeg-static-electron, and it works fine.

import ffmpeg from 'ffmpeg-static-electron';
...
ffmetadata.setFfmpegPath(ffmpeg.path);
ffmetadata.write(path, data, options, function(err, data) {
...

asososo avatar Aug 17 '21 09:08 asososo