node-ffmetadata
node-ffmetadata copied to clipboard
Error: spawn ffmpeg ENOENT
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.
Do you have ffmpeg installed? See the Installation section in the readme. https://github.com/parshap/node-ffmetadata#installation
@parshap Yes i have.
C:\Sumit Ridhal\GitHub\audio-meta\node_modules\ffmetadata\index.js:41
stream.emit("error", new Error(error.getBody().toString()));
^
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 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) {
...