Per the Firebase Cloud Functions documentation, you can leverage ImageMagick from within a cloud function: https://firebase.google.com/docs/functions/use-cases
Is i
ffmpeg is now included in the Cloud Functions environment so it can be used directly:
ffmpeg
spawn( 'ffmpeg', ['-i', 'video.mp4'] )
Full list of installed packages: https://cloud.google.com/functions/docs/reference/nodejs-system-packages