NodeJS/Dokku/Docker: ffmpeg exited with code 127 - node.js

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.

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

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.

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

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?

MPEG DASH:using Gpac to get MPD files

My goal is to convert some mpeg4 files in my hard disk into mpd files that will alllow me to use it in mpeg dash streaming .i read about gpac's MP4Box capability to create mpd files and i followed the instructions of the following link to successfully compile gpac for ubuntu like in the instructions in this two links
http://gpac.wp.mines-telecom.fr/2011/04/20/compiling-gpac-on-ubuntu/
http://gpac.wp.mines-telecom.fr/2012/02/01/dash-support/
But when i try to execute any command such as
MP4Box -dash 10000 -frag 1000 -rap myFile.mp4
I get the following error
Option -dash unknown. Please check usage
I wonder is there any commands or instructions that i must execute when building gpac to add the dash and if is there any other methods to get my own MPD File not those provided by itec.
Thanks in advance !!!
Try to follow the compile instruction carefully & make sure to fetch the latest version from SVN.
MP4Box should work with your commands.
looks like you are using a outdated version of MP4Box. try downloading and compiling the latest one from here (for me the same command works): http://gpac.wp.mines-telecom.fr/downloads/gpac-nightly-builds/

How to use the result of guardian-ffmpeg-Android?

I am trying to build ffmpeg on Android. There are many tutorials. Some are very old.
So I want to try one that can use newer version of ffmpeg and Android NDK.
After long time searching, I find one, guardianproject / android-ffmpeg
The project was updated several months ago.
NDK r8 is used. ffmpeg is put from online, so a latest version.
After I follow all the instruction, I am confused which result I should use, and how to use it.
The README mentions testing, like:
# embedding metadata into a matroska video /data/local/ffmpeg -y -i test.mp4 \
-attach attach.txt -metadata:s:2 mimetype=text/plain \
-acodec copy -vcodec copy testattach.mkv
First, I fail to find the path: /data/local
Second, this is a command. How will I use it in Android?
Totall confused.
Any light?
I presume that you have successfully built the ffmpeg executable and understand the difference between static and shared libs in the build. If not you should read up on that before trying to exec it on the CLI in android.
I think that the author uses ffmpeg on the cli using either system.exec or processbuilder techniques to run and executable located on the phone in ./data/local/$yourSubDir....
see here for discussion on ffmpeg on cli in android and note that alot of people prefer to use the full JNI route employing java interfaces to wrap calls to ffmpeg.main(). IMO the JNI route is more robust for apps you intend to distribute. But it works on the cli.
the tests that confused you are just expressions for using ffmpeg that would need to be called in android using the approach you prefer ( system.exec or processbuilder ). You can get familiar with the cli testing by simply running ffmpeg in windows/ linux in your dev environment. Get a shell there and play with samples mentioned in the ffmpeg faqs.
you can look at the halfninja project on git for more examples on JNI approach.

Resources