I'm using AWS Lambda for converting files from WEBM to MP4
I'm using ffmpeg version 4.3.1-static https://johnvansickle.com/ffmpeg/ (I have done the following tests also with the ffmpeg in serverless AWS ffmpeg layer (that includes de 4.1.3), but results are even worse (about 25% slower)
I'm using Node 10x as container.
WEBM size Time to convert. Memory Lambda. Memory used (as shown in log)
80Mb ~44s 3008 410
40Mb ~44s 3008 375
80Mb ~70s 1024 321
40Mb ~70s 1024 279
All videos are 80s length. So as far as I can see, it does not matter the size of the WEBM, if the length of the video is the same, it takes the same to convert. So ffmpeg takes more time if the video length is higher, not if the file size is higher ... curious ;-)
But in the other hand, I'm confused with Lambda memory. I know memory and CPU comes together in Lambda ... the more memory you choose, the more CPU is assigned.
But...
- Why ffmpeg just take about 300/400Mb if it has more to run ?
- How can I tell ffmpeg to use more memory ?
- Is there any option to accelerate the process in Lambda ?
Btw, In all tests, all ffmpeg are the same, and
cpu-used paramenter)
- I added to ffmpeg parameters cpu-used=100, and it does not matter at all if I put cpu-used=5 ... times are the same, so I guess that parameter is useless (i don't know why)
threads parameter)
- Also I did some tests with "threads" parameters, but it's useless also.
I know it's not a good comparison, but same files takes about 5 seconds to be converted in a simple dedicated server (8 vCores and 8GB RAM in OVH Centos VPS).
Btw, Amazon Elastic Transcoder is not an option: a) it's extremely more expensive b) it has just his profiles to convert, and my ffmpeg commands are very complex (watermarks, effects, etc ...)