You must download a large media file (more available RAM) in S3, the pre-coding it in Base64.
Help to optimize the Ruby code to read a file, encode to Base64 and then loading up on S3 was performed in blocks.
blob = StringIO.new( Base64.encode64( IO.binread('big_file.mp4')), 'rb' )
Documentation Base64.encode64 is not possible to process the file stream in chunks. Are there any tricks?