0

I have an app which receives a video file and a text from a front-end form, creates a video intro with text, merges this intro with 1 to 2 hour video. Everything is being encoded using ffmpeg, after the encode job completes, it uploads final video to S3 bucket. I wonder which will be the fastest option on AWS? Lambda is limited to run 15 mins max and not allowing to choose, e.g., 32 core CPU. I also want to modify the app so it'll upload 10 videos simultaneously and I want the ffmpeg to start the job as soon as a particular file reaches a server. Should I use the Beanstalk with 2-4 very powerful instances? Or should I use one EC2 32 core instance to do the job? Please advise.

Mike
  • 13
  • 3
  • 3
    Does this answer your question? [Can you help me with my capacity planning?](https://serverfault.com/questions/384686/can-you-help-me-with-my-capacity-planning) – Tero Kilkanen Feb 11 '21 at 15:15
  • This seems like a perfectly valid question to me, how to approach a problem. – Tim Feb 11 '21 at 19:01

1 Answers1

1

How about using a service instead of a server? AWS Elemental Mediaconvert is file based and can do things like add intro clips, text overs, etc.

The basic tier says it includes "clipping, stitching, and static overlays, among others" and the current price is 1.5c per minute at HD - SD and 4K costs more. So to convert a 2 hour video in HD costs about $1.80, which might be good value given the high cost of high CPU instances and not having them fully utilized. SD would be $0.90 and 4K $3.60. S3 storage cost for the output should be negligable.

If you need different CODECs the professional tier costs a bit more but has a lot more features.

Otherwise I wonder if you can parallelise lambda encoding to create chunks then stitch them together to save having servers.

Tim
  • 30,383
  • 6
  • 47
  • 77
  • Any idea how different this is versus https://aws.amazon.com/elastictranscoder/ ? – ceejayoz Feb 11 '21 at 19:17
  • 3
    FAQ: Why should I choose AWS Elemental MediaConvert over Amazon Elastic Transcoder? AWS Elemental MediaConvert should be the first option you consider for file-based video processing. MediaConvert provides a comprehensive suite of transcoding features that addresses the needs of the majority of use cases. It is optimized to reduce turnaround time and improve scalability which allows you to process more files in parallel. And you benefit from a flexible pricing structure where you only pay for functionality that you use. (continued on AWS site) https://aws.amazon.com/mediaconvert/faqs/ – Tim Feb 11 '21 at 20:14
  • That's a really interesting option, I actually use it already for transcoding to HLS, but I didn't find any API docs except this one https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/emc-examples-jobs.html which isn't explaining, e.g., how to create an intro from static PNG file and text etc. – Mike Feb 12 '21 at 18:03
  • Does this help at all? https://docs.aws.amazon.com/mediaconvert/latest/apireference/mediaconvert-api.pdf – Tim Feb 13 '21 at 08:43
  • 1
    I've overlooked super helpful button 'Show Json' when creating a job in AWS console, that helped a lot. Since Mediaconvert doesn't support text overlay (only image overlay), I've decided to leave this task to Lambda function with FFMPEG layer and leave all the rest job to Mediaconvert. Thanks for sharing your ideas. – Mike Feb 19 '21 at 15:27