Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I use ffmpeg-static? #45

Open
haojia321 opened this issue Dec 25, 2017 · 12 comments
Open

Can I use ffmpeg-static? #45

haojia321 opened this issue Dec 25, 2017 · 12 comments

Comments

@haojia321
Copy link

haojia321 commented Dec 25, 2017

Hi,
If I use this package on my cloud server(which may not have ffmpeg installed on the linux server), so can I use ffmpeg-static instead? Something like this: https://www.npmjs.com/package/ffmpeg-static

@haojia321 haojia321 changed the title Need ffmpeg-static? Can I use ffmpeg-static? Dec 30, 2017
@Aspvik
Copy link

Aspvik commented Mar 13, 2018

Did you figure it out?

@gavinwilliams
Copy link

This works fine with ffmpeg-static. You just need to set ffmpeg.bin to ffmpeg-static.path like the below in ES6.

import ffmpeg_static from 'ffmpeg-static'
import ffmpeg from 'ffmpeg'
ffmpeg.bin = ffmpeg_static.path

From here, you're free to use ffmpeg however you like.

@link-duan
Copy link

This works fine with ffmpeg-static. You just need to set ffmpeg.bin to ffmpeg-static.path like the below in ES6.

import ffmpeg_static from 'ffmpeg-static'
import ffmpeg from 'ffmpeg'
ffmpeg.bin = ffmpeg_static.path

From here, you're free to use ffmpeg however you like.

dont work:
image

@jens1o
Copy link

jens1o commented Feb 16, 2019

@yaphper You need to install ffmpeg(the binary itself) before using a wrapper that eases making commands to ffmpeg.

@haojia321
Copy link
Author

@jens1o I cannot manage the cloud server so I cannot manually install anything on the server. when you say "ffmpeg binary", you mean i need to manually install it on the server, right?

@haojia321
Copy link
Author

haojia321 commented Feb 21, 2019

Im using Mac and I got this error:

I20190221-00:41:12.175(-5)? /bin/sh: ffmpeg: command not found
I20190221-00:41:12.176(-5)?
I20190221-00:41:12.176(-5)? at ChildProcess.exithandler (child_process.js:275:12)
I20190221-00:41:12.176(-5)? at emitTwo (events.js:126:13)
I20190221-00:41:12.176(-5)? at ChildProcess.emit (events.js:214:7)
I20190221-00:41:12.176(-5)? at maybeClose (internal/child_process.js:925:16)
I20190221-00:41:12.176(-5)? at Socket.stream.socket.on (internal/child_process.js:346:11)
I20190221-00:41:12.176(-5)? at emitOne (events.js:116:13)
I20190221-00:41:12.176(-5)? at Socket.emit (events.js:211:7)
I20190221-00:41:12.176(-5)? at Pipe._handle.close [as _onclose] (net.js:554:12)
I20190221-00:41:12.177(-5)? killed: false,
I20190221-00:41:12.177(-5)? code: 127,
I20190221-00:41:12.177(-5)? signal: null,
I20190221-00:41:12.177(-5)? cmd: 'ffmpeg -i assets/app/uploads/uploadedFiles/8tRvc3eGQwf5q6bDg.mp4 -vf "scale='min(854,iw)':'min(480,ih)':force_original_aspect_ratio=decrease,pad=854:480:(ow-iw)/2:(oh-ih)/2" -r 24 -c:v libx264 -b:v 1M -maxrate 1.5M -bufsize 1M assets/app/uploads/uploadedFiles/8tRvc3eGQwf5q6bDg-480P.mp4' } null

W20190221-00:21:07.641(-5)? (STDERR) fs.js:948
W20190221-00:21:07.642(-5)? (STDERR) binding.stat(pathModule._makeLong(path));
W20190221-00:21:07.642(-5)? (STDERR) ^
W20190221-00:21:07.642(-5)? (STDERR)
W20190221-00:21:07.642(-5)? (STDERR) TypeError: path must be a string or Buffer
W20190221-00:21:07.642(-5)? (STDERR) at Object.fs.statSync (fs.js:948:11)
W20190221-00:21:07.643(-5)? (STDERR) at Object.statSync (/Users/i839603/eduees/code/prototypes/videoprocessor/node_modules/graceful-fs/polyfills.js:297:22)
W20190221-00:21:07.643(-5)? (STDERR) at server/main.js:61:60
W20190221-00:21:07.643(-5)? (STDERR) at /Users/i839603/eduees/code/prototypes/videoprocessor/node_modules/ffmpeg/lib/video.js:583:5
W20190221-00:21:07.643(-5)? (STDERR) at /Users/i839603/eduees/code/prototypes/videoprocessor/node_modules/ffmpeg/lib/utils.js:20:3
W20190221-00:21:07.643(-5)? (STDERR) at ChildProcess.exithandler (child_process.js:282:5)
W20190221-00:21:07.643(-5)? (STDERR) at emitTwo (events.js:126:13)
W20190221-00:21:07.644(-5)? (STDERR) at ChildProcess.emit (events.js:214:7)
W20190221-00:21:07.644(-5)? (STDERR) at maybeClose (internal/child_process.js:925:16)
W20190221-00:21:07.644(-5)? (STDERR) at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)

@jens1o
Copy link

jens1o commented Feb 21, 2019

you mean i need to manually install it on the server, right?

yeah. This is just a wrapper to make you more comfortable writing ffmpeg commands.

@haojia321
Copy link
Author

@jens1o do you know if there is any package that doesnt need manually install ffmpeg on the server? The cloud im using doesnt allow install software.

@jens1o
Copy link

jens1o commented Feb 21, 2019

Nope. Hosting the stuff yourself isn't an option, which would also benefit user privacy?

@Zaphiruz
Copy link

Had the same issue. video.js still has a hardcoded 'ffmpeg'

@kodie
Copy link

kodie commented Dec 21, 2021

Just in case anyone else runs into this, I have made a fork that makes the ffmpeg executable configurable: #88

@morgan-wild
Copy link

UP! ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants