Closed Jidzo1 closed 11 months ago
GCP Functions NodeJS 16 runtime uses Ubuntu 18.04 with FFMpeg installed. NodeJS 18/20 use Ubuntu 22.04, and Google in all their wisdom decided not to include FFMpeg -_-.
https://cloud.google.com/functions/docs/runtime-support#node.js https://cloud.google.com/functions/docs/reference/system-packages
That's unfortunate, to say the least...
What's the solution here then? No way to find an easy workaround without having to deploy a custom docker into Google Cloud?
I'm in the same position right now, I don't want to deploy a container just to have FFMpeg.
1 approach would be these libraries that install FFMpeg as an NPM dependency: https://github.com/eugeneware/ffmpeg-static https://github.com/kribblo/node-ffmpeg-installer
I haven't gotten this approach working in GCP Functions yet, so next I am going to try putting an FFMpeg tarball in a GCS bucket and unpacking it to the local filesystem during function initialization.
I think excluding FFMpeg was done intentionally to push users towards GCP Transcoder service, but that service is designed specifically for VOD content preparation, so the full range of FFMpeg capabilities is not available there.
Update here:
After discussing with Google support, they finally decided to add ffmpeg back as a system package on node 18 and 20. This is now working again as needed.
Closing here
Version information
Code to reproduce
Expected results
The above code is working on node js 16 in Google Cloud functions. It provides the duration of the video file from the video URL.
Observed results
The error "cannot find ffprobe" appears when upgrading to node 18 or 20 (No other change than upgrading node).
Setting the path manually using ffmpeg.setFfprobePath(ffprobePath); Trigger the error: -> Error: ffprobe was killed with signal SIGSEGV
I also opened a stackoverflow question: https://stackoverflow.com/questions/77516185/node-18-or-node-20-break-ffmpeg-in-google-cloud-functions-ffprobe-was-killed
As it may be related to the google cloud ffmpeg version.
Thank you for the help