packages/docs/docs/lambda/ruby.mdx
available from v4.0.232
To trigger a Lambda render using Ruby, install the remotion_lambda gem.
The version should be the same version of the @remotion/lambda NPM package version that you used to deploy your function.
renderMediaOnLambda(), renderStillOnLambda() and getRenderProgressOnLambda().snake_case versions of the Node.js field names.s3_output_provder.accessKeyId have the original camelCase capitalization.camelCase like the original Node.js functions.require 'remotion_lambda'
client = RemotionLambda::Client.new(
region: 'eu-central-1',
)
function_name = ENV.fetch('REMOTION_APP_FUNCTION_NAME')
payload = get_render_media_on_lambda_payload(
composition: "still-helloworld",
download_behavior: {
type: "play-in-browser",
},
codec: "h264",
input_props: {
message: "Hello from props!",
}
)
res = client.render_media_on_lambda(function_name, payload)
puts res
while true
render_progress_payload = get_render_progress_payload(
render_id: res["renderId"],
bucket_name: res["bucketName"],
)
progress = client.get_render_progress(function_name, render_progress_payload)
puts progress["overallProgress"]
break if progress["done"]
break if progress["fatalErrorEncountered"]
sleep 1
end
require 'remotion_lambda'
client = RemotionLambda::Client.new(
region: 'eu-central-1',
)
function_name = ENV.fetch('REMOTION_APP_FUNCTION_NAME')
payload = get_render_still_on_lambda_payload(
composition: "still-helloworld",
input_props: {
message: "Hello from props!",
}
)
res = client.render_still_on_lambda(function_name, payload)
puts res