Error: spawn EACCESS node-webkit ffmpeg with fluent-ffmpeg - node.js

I'm doing a nodewebkit app and trying to bundle ffmpeg inside so the user doesn't have to have ffmpeg installed on their system.
EACCESS has to do with rights running the code. I tried a chmod -R ug+rw ffmpegFolder to no avail.
I downloaded the osx binaries from here: https://evermeet.cx/ffmpeg/ I'm assuming these are compiled but I could be wrong?
I am bundling the extracted ffmpeg folder into the root of my .nw, which, extracted looks like this:
This part has to do with fluent-ffmpeg.
It has this method called setFfmpegPath(path) which tells fluent-ffmpeg to use a FFMPEG you provide.
I get the fs.realpath to ffmpeg-2.5.4 and use that.Using ./ffmpeg-2.5.4 or /ffmpeg-2.5.4 or ffmpeg-2.5.4 just gives a spawn ENOENT error which I've read, means not found.
If I remove setFfmepgPath from my fluent-ffmpeg command it works fine using my system ffmpeg.
I feel I'm on the right track with the spawn EACCESS error. How to make it play nice though?

Related

Getting "Cannot find ffprobe error " when attempting to run nodejs script

I am attempting to use an npm package for splitting audio (https://github.com/calufornia/audio-split), however I am not able to run a single test since I get the following error on my callback:
Error: Cannot find ffprobe, I have read a bit and it seems that this is directly related to the npm package fluent_ffmpeg, which is actually a dependency of the first package I mentioned.
The problem on some other questions/forums is that people do not have properly installed ffmpeg on their environment. In my case however, I have made sure that my PATH is updated with the ffmpeg directory (C:\FFmpeg\bin for me), and I am able to open a command prompt and run both
ffmpeg -version
and
ffprobe -version
I would much appreciate if anyone else has struggled with this previously and could provide me with some more guidance. Thanks

pydub no ffprobe found

I have an app for MacOS that is compiled with py2app. The app uses the pydub module and the latter uses ffmpeg family package.
The problem is that once I compile the app and move it to a different OS, the subprocess call from pydub fails to find any of the ffmpeg packages even though they are installed in /usr/local/bin.
If I launch the app from terminal ./Nameapp.app/Contents/MacOs/Nameapp then it runs no problem, but if I launch it with double click then pydub complains not finding the packages and the app hangs where ffmpeg/ffprobe should do the work.
I can see that pydub searches in the /usr/local/bin only if launched from terminal, otherwise no. If I add /usr/local/bin to PATH, pydub doesnt complain anymore that it doesnt find ffmpeg/ffprobe, but it still gives me an error for both ffmpeg and ffprobe: [Errno 2] No such file or directory:.
If I hardcode the path pydub.AudioSegment.converter = "/usr/local/bin/ffmpeg", the app gives me only ffprobe error [Errno 2] No such file or directory:'ffprobe': 'ffprobe'.
On some other posts i've seen pydub.AudioSegment.ffprobe = "/path/to/ffprobe" but it doesnt seem to work in my case?
So my two questions are:
How to hardcode the ffprobe path in pydub?
How to solve this without hardcoding path?
for some reason it works when changing the shell to zsh... switching back to bash no. not really happy with this solution but it's something

Cannot find ffprobe?

I am trying to generate video thumbnail in my node project for that I tried
thumbsupply and video-thumbnail npm both returns the same error called not found: ffprobe
const thumbsupply = require('thumbsupply');
const ffprobe = require('#ffprobe-installer/ffprobe');
let aa = thumbsupply.generateThumbnail('videoplayback.mp4', {
size: thumbsupply.ThumbSize.MEDIUM, // or ThumbSize.LARGE
timestamp: "10%", // or `30` for 30 seconds
forceCreate: true,
cacheDir: "~/myapp/cache",
mimetype: "video/mp4"
})
console.log(aa);
Thumbsupply uses fluent-ffmpeg (from a quick look at the source):
https://github.com/fluent-ffmpeg/node-fluent-ffmpeg
fluent-ffmpeg has information on the requirements around ffmpeg installation and the required path at the link above.
Prerequisites
ffmpeg and ffprobe
fluent-ffmpeg requires ffmpeg >= 0.9 to work. It may work with previous versions but several features won't be available (and the library is not tested with lower versions anylonger).
If the FFMPEG_PATH environment variable is set, fluent-ffmpeg will use it as the full path to the ffmpeg executable. Otherwise, it will attempt to call ffmpeg directly (so it should be in your PATH). You must also have ffprobe installed (it comes with ffmpeg in most distributions). Similarly, fluent-ffmpeg will use the FFPROBE_PATH environment variable if it is set, otherwise it will attempt to call it in the PATH.
ffmpeg details including installation is here: https://www.ffmpeg.org/download.html
I was also getting this issue Error: Cannot find ffprobe
I have done following steps to make it work in ubuntu
sudo apt update
sudo apt install ffmpeg
restarted my pm2 api instance.
This was my case with the deployment server,
Since, I was working in local on mac os, I used
brew install ffmpeg

setup ffmpeg on ubuntu and node.js

I am new to ubuntu and I am struggling in setting up ffmpeg installation on the ubuntu server. I have install the ffmpeg on ubuntu and also I can see it by issuing a command ffmpeg -v. I have done the development in node.js in windows and specify the path of ffmpeg. Below is the path of window in node.js:
proc.setFfmpegPath("D:\\abc\\ffmpeg-20121120-git-8b6aeb1-win64-static\\bin\\ffmpeg.exe");
but now I have to specify the path for ffmpeg for ubuntu in my node.js code.
proc.setFfmpegPath("/usr/bin/ffmpeg/ffmpeg");
it says Uncaught Error: spawn ENOTDIR
Even though I have tried with this path:
proc.setFfmpegPath("/usr/bin/ffmpeg");
then it says An error happened: ffmpeg exited with code 1
Also I have run this command "whereis ffmpeg" and it says "/usr/bin/ffmpeg"
Any help is very much appreciated
This one is correct:
proc.setFfmpegPath("/usr/bin/ffmpeg");
It is returning error code 1, which means that it is executing the ffmpeg but ffmpeg is not successfully running to completion. Try running it on the command line to see if there are any obvious problems. If that doesn't work, you'll have to dig in with some more logging and/or debugging.

NodeJS/Dokku/Docker: ffmpeg exited with code 127

I'm trying to run ffmpeg inside of a Docker container via Dokku. I've heavily modified a Dokku plugin to accomplish this as I need h264 support. I currently get an error from fluent-ffmpeg which states
Error: ffmpeg exited with code 127
I've tried to look up what error code 127 is but haven't found much. Some people seem to suggest that it's some sort of issue with finding ffmpeg. However, I did have a libx264 error from ffmpeg earlier in the process so I'm pretty sure the ffmpeg binary is being found. Unfortunately fluent doesn't send the used command line for ffmpeg to the error event so I'm not sure what the exact command being ran is.
127 means command not found. (127 Return code from $?)
I guess your ffmpeg executable is not located in any directories defined by environment variable PATH.

Resources