Quick demo for converting mp4 --> webm using firebase functions and fluent-ffmpeg. All major code can be found in functions/index.js
Create a new firebase project on the Firebase Console.
-
Deploy the project by using
firebase init
andfirebase deploy
in the directory. -
Go to the Firebase Storage tab in the firebase console, and upload any webm file.
Firebase Functions have a timeout that's normally set to 1 minute. Due to the slow conversion speed of most video types, it's somewhat nessecary to increase the timeout duration.
To increase the duration:
- Go to the Cloud Function Console
- Click select when prompted to select a project and pick your newly created firebase project
- Click the three dots on the right next to the function, and click Test Function
- Click Edit
- Change Timeout to a bigger number (I chose 180 seconds, but more or less may be better)