0

I want to use ffmpeg as described here:

https://github.com/firebase/functions-samples/blob/master/ffmpeg-convert-audio/functions/index.js

ffmpeg-static contains binaries. I am using Windows 10 and want to upload the code using firebase deploy.

However I do not understand what I need to do to get this to work. The binaries that will be installed on my PC are of course different from those needed by the cloud firebase (https://www.npmjs.com/package/ffmpeg-static).

How can I do this?

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
Leo
  • 4,136
  • 6
  • 48
  • 72
  • 1
    Did you see https://stackoverflow.com/questions/42773497/can-you-call-out-to-ffmpeg-in-a-firebase-cloud-function? If so, can you edit your question to show what you've tried already based on that, and the link you provided? – Frank van Puffelen Oct 30 '20 at 13:37
  • @FrankvanPuffelen Thanks, no I searched but did not find that question for some reason until after I posted mine. (Maybe I am just too frustrated that Google did not already provide a simple to use ffmpeg in the cloud... - the GitHub example seems to be just a toy, according to what I have been reading now.) – Leo Oct 30 '20 at 15:01

1 Answers1

2

When you deploy Cloud Functions, the deployment process doesn't include the contents of node_modules from your local machine. Google infrastructure will effectively run npm install for you and rebuild the entire thing in an environment that matches your target Cloud Functions runtime. As such, you will get the correct binaries with your function. It doesn't matter that you developed on Windows, and there is (in theory) nothing you have to do to get the function to work, as long as you wrote platform-independent code.

If you have a specific problem, your question should show what, including any code and error messages one would use for debugging.

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441