Muhammad Umer
Muhammad Umer

Reputation: 18097

Prevent google cloud function timeout for video processing?

Firstly I'm not sure if my approach is right one.

This is what I'm doing. I've some video processing work to do, for which I'm gonna use FFMPEG. And it can take from 1 minute to 20 minutes to do work.

so my questions are:

From what I know it's perfect scenario to use cloud functions. Alternative is to use build queue, wait for available processes to finish and then when time comes finish task.

Upvotes: 0

Views: 667

Answers (1)

JamWils
JamWils

Reputation: 785

It might be a little tricky for you to perform this using Google Cloud Functions. Yes, you can increase the timeout limit, but right now the max is 5 minutes and if your video file is large enough then you might constantly run into timeout issues. To me it looks like you have two options.

  1. If you want to stick with Google then you might be better off using Kubernetes Engine instead and spinning up Cloud Functions. This would eliminate your timeout issues. You could also use App Engine which would be easier to standup versus Kubernetes Engine.
  2. You could use Amazon's Lambda service along with AWS Step Functions. This would give you the ability to break any videos into small chunks based on markers, and use Step Functions to parallelize the process. Once all of the small chunks of video are done then you can put them back together and output the larger video.

This is definitely possible, they had a talk at AWS:Ignite 2017 about using FFMPEG, Lambdas, and Step Functions to accomplish the task.

Upvotes: 2

Related Questions