transitive-bullshit / ffmpeg-concat

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

Install failing on Mac #92

Closed nitinthewiz closed 3 years ago

nitinthewiz commented 3 years ago

Hi,

I'm trying to install ffmpeg-concat on OS X and it's failing like this -

****:ffmpeg_playground khanna$ npm install -g ffmpeg-concat 
npm WARN deprecated left-pad@1.3.0: use String.prototype.padStart()
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
/usr/local/bin/ffmpeg-concat -> /usr/local/lib/node_modules/ffmpeg-concat/lib/cli.js

> gl@4.5.3 install /usr/local/lib/node_modules/ffmpeg-concat/node_modules/gl
> prebuild-install || node-gyp rebuild

> sharp@0.24.1 install /usr/local/lib/node_modules/ffmpeg-concat/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

info sharp Using cached /Users/khanna/.npm/_libvips/libvips-8.9.0-darwin-x64.tar.gz
prebuild-install WARN install No prebuilt binaries found (target=14.7.0 runtime=node arch=x64 libc= platform=darwin)
gyp ERR! find Python 
gyp ERR! find Python checking Python explicitly set from command line or npm configuration
gyp ERR! find Python - "--python=" or "npm config get python" is "/usr/local/bin/python3"
gyp ERR! find Python - executable path is "/usr/local/opt/python/bin/python3.7"
gyp ERR! find Python - "/usr/local/opt/python/bin/python3.7" could not be run
gyp ERR! find Python checking Python explicitly set from environment variable PYTHON
gyp ERR! find Python - process.env.PYTHON is "/usr/local/bin/python3"
gyp ERR! find Python - executable path is "/usr/local/opt/python/bin/python3.7"
gyp ERR! find Python - "/usr/local/opt/python/bin/python3.7" could not be run
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - "python" is not in PATH or produced an error
gyp ERR! find Python checking if "python2" can be used
gyp ERR! find Python - "python2" is not in PATH or produced an error
gyp ERR! find Python checking if "python3" can be used
gyp ERR! find Python - executable path is "/usr/local/opt/python/bin/python3.7"
gyp ERR! find Python - "/usr/local/opt/python/bin/python3.7" could not be run
gyp ERR! find Python 
gyp ERR! find Python **********************************************************
gyp ERR! find Python You need to install the latest version of Python.
gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
gyp ERR! find Python you can try one of the following options:
gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
gyp ERR! find Python   (accepted by both node-gyp and npm)
gyp ERR! find Python - Set the environment variable PYTHON
gyp ERR! find Python - Set the npm configuration variable python:
gyp ERR! find Python   npm config set python "/path/to/pythonexecutable"
gyp ERR! find Python For more information consult the documentation at:
gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
gyp ERR! find Python **********************************************************
gyp ERR! find Python 
gyp ERR! configure error 
gyp ERR! stack Error: Could not find any Python installation to use
gyp ERR! stack     at PythonFinder.fail (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:307:47)
gyp ERR! stack     at PythonFinder.runChecks (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:136:21)
gyp ERR! stack     at PythonFinder.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:225:16)
gyp ERR! stack     at PythonFinder.execFileCallback (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:271:16)
gyp ERR! stack     at exithandler (child_process.js:315:5)
gyp ERR! stack     at ChildProcess.errorhandler (child_process.js:327:5)
gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:274:12)
gyp ERR! stack     at onErrorNT (internal/child_process.js:468:16)
gyp ERR! stack     at processTicksAndRejections (internal/process/task_queues.js:80:21)
gyp ERR! System Darwin 19.6.0
gyp ERR! command "/usr/local/Cellar/node/14.7.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/ffmpeg-concat/node_modules/sharp
gyp ERR! node -v v14.7.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp@0.24.1 install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the sharp@0.24.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/khanna/.npm/_logs/2020-08-20T23_22_19_489Z-debug.log

I'm somewhat of a rookie at understanding npm, so could you help me understand what exactly is failing?

Is it sharp, or gl? Is sharp trying to an install of libvips, which is failing?

I tried installing gl separately and that works (npm install gl). Same with sharp.

Also, I have python 2 and 3 on here, and I even tried to set export PYTHON=$(which python) but to no avail.

I'm on Catalina and node versions are -

***:~ khanna$ node --version
v14.7.0
***:~ khanna$ npm --version
6.14.7
***:~ khanna$ 

I noticed that openGL doesn't work for node 12.x to 13.6, but as you can see, this is beyond that version...

A general google search for node-gyp not finding python mostly shows results related to gyp not finding python on Windows... which... whatever...

Is a better route to just the docker image mentioned in Issue #77 ? I'm not averse to xvfb. I'm using it with a puppetcam repo but native would be sooooo much better!

By the way, I ran brew install libvips and woooh! The fans were in overdrive, but it got installed without any issues!

Any thoughts?

nitinthewiz commented 3 years ago

By the way, after I installed libvips, I tried to install ffmpeg-concat again, and it detected the global version of libvips, but still failed with the rest of the above python error...

> sharp@0.24.1 install /usr/local/lib/node_modules/ffmpeg-concat/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

info sharp Detected globally-installed libvips v8.10.0
info sharp Building from source via node-gyp
gyp ERR! find Python 
gyp ERR! find Python checking Python explicitly set from command line or npm configuration
gyp ERR! find Python - "--python=" or "npm config get python" is "/usr/local/bin/python3"
gyp ERR! find Python - executable path is "/usr/local/opt/python/bin/python3.7"
gyp ERR! find Python - "/usr/local/opt/python/bin/python3.7" could not be run
gyp ERR! find Python checking Python explicitly set from environment variable PYTHON
.
.
.
nitinthewiz commented 3 years ago

Ugh. Nevermind.

I updated xcode to 11.6, uninstalled commandline tools, reinstalled commandline tools, and installed node-gyp...

and it worked!

Oh, and ffmpeg-concat is pretty powerful! Thank you so much for this awesome library!

(leaving this here for posterity)

transitive-bullshit commented 3 years ago

Awesome -- glad it worked out 😄