I am building a platform, that allows users to upload some video files (20-40 seconds) from their phone to server. All this upload is working great for now, files are stored in google storage bucket via nodejs cloud functions.
Now I want to create a gcp transcoder-job, that will convert uploaded .mp4 video file to .hls video stream with .ts chunks of 2-4 seconds duration.
Probably success scenario:
functions.storage.object().onFinalize
[Done]onFinalize
triggers Google Cloud Job, that will convert mp4 to hls. [We are here]Will appreciate any help on creating such job. I am using firebase cloud functions with nodejs.
I would do this using the transcoder API in GCP. It supports mp4 input and hls output. See supported formats
Note that videos must be greater than 5 seconds in length. If they can't be 5 seconds in length, maybe avoid this API and using a tool on AppEngine.
A rough flow of events to accomplish this could be something like: