I’d like to generate presentations and upload them to Amazon S3, all using streams. The presentation building operation would be performed on an AWS Lambda function, where it isn’t an option to save the generated presentation to disk before uploading.
For instance, in this example code, instead of reading the video file from disk and writing the generated file to disk, I’d like to read the video from an S3 object and write the generated presentation as another S3 object.
My understanding is that this should be theoretically possible, since the Presentation
constructor accepts a stream of type InputStream
to read from, and the save()
method can write to a stream of type OutputStream
.
However, theres’ a catch when using streams to upload to S3: the upload request must specify the content length in the upload metadata. Is it possible to know the content length for the presentation being saved beforehand?
I’d also appreciate your insights on this whole idea, and whether doing this on AWS Lambda is a good idea to begin with.
Thanks in advance!