eugeneware / ffmpeg-static

ffmpeg static binaries for Mac OSX and Linux and Windows
GNU General Public License v3.0
1.11k stars 182 forks source link

Web hosting #116

Open Zainmansour opened 2 years ago

Zainmansour commented 2 years ago

what I have to do to use this library in my website if I want to deploy it to a webhost like vercel

derhuerst commented 2 years ago

What do you mean exactly? Run ffmpeg on the server to convert media?

Zainmansour commented 2 years ago

yes how can I initialize my server to use ffmpeg?

derhuerst commented 2 years ago

ffmpeg-static just makes sure that you have an ffmpeg binary suitable for your platform & architecture installed. The path to this ffmpeg binary can be obtained by require('ffmpeg-static').

You can then execute ffmpeg however you please:

Does that answer your question?

Zainmansour commented 2 years ago

I am not sure that you understood my question focus with my please: to install ffmpeg on my machine I downloaded it manually and add the path of /bin folder to environment variables in win 10 I create a website and I use ffmpeg it works fine on my machine so if I wanna deploy my website to a web hosting server like ( heroku or vercel ) how I can initialize the environment to use ffmpeg because I can't install it manually?? hope you understand and sorry for my poor english

derhuerst commented 2 years ago

to install ffmpeg on my machine I downloaded it manually

This a valid way to install ffmpeg!

This package (ffmpeg-static) is intended for automatic usage: If you want your Node.js-based project to use ffmpeg, you can use ffmpeg-static as a dependency to obtain an ffmpeg binary, instead of manually downloading one.

This only works in an environment where you can spawn child processes, not sure if this works on Vercel; But I know it works on a plain old Linux-based VM/VPS used for web hosting.