Skip to content

🎥 Make videos programmatically with React

add to lambda and go sdks

Jonny Burgere152553420a5
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 22080045bb..2398932514 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -21,5 +21,8 @@
"python.formatting.provider": "none",
"typescript.preferences.autoImportFileExcludePatterns": [
"@types/node/test.d.ts"
- ]
+ ],
+ "[go]": {
+ "editor.defaultFormatter": "golang.go"
+ }
}
diff --git a/packages/lambda-go/internalops.go b/packages/lambda-go/internalops.go
index 200f3000b8..87442cc4d4 100644
--- a/packages/lambda-go/internalops.go
+++ b/packages/lambda-go/internalops.go
@@ -21,23 +21,24 @@ func constructRenderInternals(options *RemotionOptions) (*renderInternalOptions,
}
internalParams := renderInternalOptions{
- ServeUrl: options.ServeUrl,
- InputProps: inputProps,
- Composition: options.Composition,
- Version: VERSION,
- FrameRange: options.FrameRange,
- OutName: options.OutName,
- AudioBitrate: options.AudioBitrate,
- VideoBitrate: options.VideoBitrate,
- Webhook: options.Webhook,
- ForceHeight: options.ForceHeight,
- X264Preset: options.X264Preset,
- ForceWidth: options.ForceWidth,
- BucketName: options.BucketName,
- AudioCodec: options.AudioCodec,
- ForceBucketName: options.ForceBucketName,
- RendererFunctionName: &options.RendererFunctionName,
- Type: "start",
+ ServeUrl: options.ServeUrl,
+ InputProps: inputProps,
+ Composition: options.Composition,
+ Version: VERSION,
+ FrameRange: options.FrameRange,
+ OutName: options.OutName,
+ AudioBitrate: options.AudioBitrate,
+ VideoBitrate: options.VideoBitrate,
+ Webhook: options.Webhook,
+ ForceHeight: options.ForceHeight,
+ OffthreadVideoCacheSizeInBytes: options.OffthreadVideoCacheSizeInBytes,
+ X264Preset: options.X264Preset,
+ ForceWidth: options.ForceWidth,
+ BucketName: options.BucketName,
+ AudioCodec: options.AudioCodec,
+ ForceBucketName: options.ForceBucketName,
+ RendererFunctionName: &options.RendererFunctionName,
+ Type: "start",
}
internalParams.Muted = options.Muted
diff --git a/packages/lambda-go/models.go b/packages/lambda-go/models.go
index 2cee1dd570..75232bfd20 100644
--- a/packages/lambda-go/models.go
+++ b/packages/lambda-go/models.go
@@ -1,81 +1,83 @@
package lambda_go_sdk
type RemotionOptions struct {
- ServeUrl string `json:"serveUrl" validate:"required"`
- FunctionName string `json:"functionName" validate:"required"`
- RendererFunctionName string `json:"rendererFunctionName"`
- Region string `json:"region" validate:"required"`
- InputProps interface{} `json:"inputProps"`
- Composition string `json:"composition" validate:"required"`
- Codec string `json:"codec"`
- ImageFormat string `json:"imageFormat"`
- Crf int `json:"crf"`
- EnvVariables interface{} `json:"envVariables"`
- Quality int `json:"quality"`
- MaxRetries int `json:"maxRetries"`
- Privacy string `json:"privacy"`
- LogLevel string `json:"logLevel"`
- FrameRange interface{} `json:"frameRange"`
- OutName interface{} `json:"outName"`
- TimeoutInMilliseconds int `json:"timeoutInMilliseconds"`
- ChromiumOptions interface{} `json:"chromiumOptions"`
- Scale int `json:"scale"`
- EveryNthFrame int `json:"everyNthFrame"`
- NumberOfGifLoops int `json:"numberOfGifLoops"`
- ConcurrencyPerLambda int `json:"concurrencyPerLambda"`
- DownloadBehavior map[string]interface{} `json:"downloadBehavior"`
- Muted bool `json:"muted"`
- Overwrite bool `json:"overwrite"`
- AudioBitrate interface{} `json:"audioBitrate"`
- VideoBitrate interface{} `json:"videoBitrate"`
- Webhook interface{} `json:"webhook"`
- ForceHeight interface{} `json:"forceHeight"`
- ForceWidth interface{} `json:"forceWidth"`
- BucketName interface{} `json:"bucketName"`
- AudioCodec interface{} `json:"audioCodec"`
- ForceBucketName string `json:"forceBucketName"`
- Gl string `json:"gl"`
- X264Preset interface{} `json:"x264Preset"`
+ ServeUrl string `json:"serveUrl" validate:"required"`
+ FunctionName string `json:"functionName" validate:"required"`
+ RendererFunctionName string `json:"rendererFunctionName"`
+ Region string `json:"region" validate:"required"`
+ InputProps interface{} `json:"inputProps"`
+ Composition string `json:"composition" validate:"required"`
+ Codec string `json:"codec"`
+ ImageFormat string `json:"imageFormat"`
+ Crf int `json:"crf"`
+ EnvVariables interface{} `json:"envVariables"`
+ Quality int `json:"quality"`
+ MaxRetries int `json:"maxRetries"`
+ Privacy string `json:"privacy"`
+ LogLevel string `json:"logLevel"`
+ FrameRange interface{} `json:"frameRange"`
+ OutName interface{} `json:"outName"`
+ TimeoutInMilliseconds int `json:"timeoutInMilliseconds"`
+ ChromiumOptions interface{} `json:"chromiumOptions"`
+ Scale int `json:"scale"`
+ EveryNthFrame int `json:"everyNthFrame"`
+ NumberOfGifLoops int `json:"numberOfGifLoops"`
+ ConcurrencyPerLambda int `json:"concurrencyPerLambda"`
+ DownloadBehavior map[string]interface{} `json:"downloadBehavior"`
+ Muted bool `json:"muted"`
+ Overwrite bool `json:"overwrite"`
+ AudioBitrate interface{} `json:"audioBitrate"`
+ VideoBitrate interface{} `json:"videoBitrate"`
+ Webhook interface{} `json:"webhook"`
+ ForceHeight interface{} `json:"forceHeight"`
+ OffthreadVideoCacheSizeInBytes interface{} `json:"offthreadVideoCacheSizeInBytes"`
+ ForceWidth interface{} `json:"forceWidth"`
+ BucketName interface{} `json:"bucketName"`
+ AudioCodec interface{} `json:"audioCodec"`
+ ForceBucketName string `json:"forceBucketName"`
+ Gl string `json:"gl"`
+ X264Preset interface{} `json:"x264Preset"`
}
type renderInternalOptions struct {
- RendererFunctionName *string `json:"rendererFunctionName"`
- FramesPerLambda *string `json:"framesPerLambda"`
- Composition string `json:"composition" validate:"required"`
- ServeUrl string `json:"serveUrl" validate:"required"`
- InputProps interface{} `json:"inputProps"`
- Type string `json:"type,omitempty"`
- Codec string `json:"codec"`
- ImageFormat string `json:"imageFormat"`
- Crf int `json:"crf,omitempty"`
- EnvVariables interface{} `json:"envVariables,omitempty"`
- Quality int `json:"quality,omitempty"`
- MaxRetries int `json:"maxRetries"`
- Privacy string `json:"privacy"`
- LogLevel string `json:"logLevel"`
- FrameRange interface{} `json:"frameRange"`
- OutName interface{} `json:"outName"`
- TimeoutInMilliseconds int `json:"timeoutInMilliseconds"`
- ChromiumOptions interface{} `json:"chromiumOptions"`
- Scale int `json:"scale"`
- EveryNthFrame int `json:"everyNthFrame"`
- NumberOfGifLoops int `json:"numberOfGifLoops"`
- ConcurrencyPerLambda int `json:"concurrencyPerLambda"`
- DownloadBehavior map[string]interface{} `json:"downloadBehavior"`
- Muted bool `json:"muted"`
- Version string `json:"version"`
- Overwrite bool `json:"overwrite"`
- AudioBitrate interface{} `json:"audioBitrate"`
- VideoBitrate interface{} `json:"videoBitrate"`
- Webhook interface{} `json:"webhook"`
- ForceHeight interface{} `json:"forceHeight"`
- ForceWidth interface{} `json:"forceWidth"`
- BucketName interface{} `json:"bucketName"`
- AudioCodec interface{} `json:"audioCodec"`
-
- ForceBucketName string `json:"forceBucketName,omitempty"`
- Gl *string `json:"gl,omitempty"`
- X264Preset interface{} `json:"x264Preset"`
+ RendererFunctionName *string `json:"rendererFunctionName"`
+ FramesPerLambda *string `json:"framesPerLambda"`
+ Composition string `json:"composition" validate:"required"`
+ ServeUrl string `json:"serveUrl" validate:"required"`
+ InputProps interface{} `json:"inputProps"`
+ Type string `json:"type,omitempty"`
+ Codec string `json:"codec"`
+ ImageFormat string `json:"imageFormat"`
+ Crf int `json:"crf,omitempty"`
+ EnvVariables interface{} `json:"envVariables,omitempty"`
+ Quality int `json:"quality,omitempty"`
+ MaxRetries int `json:"maxRetries"`
+ Privacy string `json:"privacy"`
+ LogLevel string `json:"logLevel"`
+ FrameRange interface{} `json:"frameRange"`
+ OutName interface{} `json:"outName"`
+ TimeoutInMilliseconds int `json:"timeoutInMilliseconds"`
+ ChromiumOptions interface{} `json:"chromiumOptions"`
+ Scale int `json:"scale"`
+ EveryNthFrame int `json:"everyNthFrame"`
+ NumberOfGifLoops int `json:"numberOfGifLoops"`
+ ConcurrencyPerLambda int `json:"concurrencyPerLambda"`
+ DownloadBehavior map[string]interface{} `json:"downloadBehavior"`
+ Muted bool `json:"muted"`
+ Version string `json:"version"`
+ Overwrite bool `json:"overwrite"`
+ AudioBitrate interface{} `json:"audioBitrate"`
+ VideoBitrate interface{} `json:"videoBitrate"`
+ Webhook interface{} `json:"webhook"`
+ OffthreadVideoCacheSizeInBytes interface{} `json:"offthreadVideoCacheSizeInBytes"`
+ ForceHeight interface{} `json:"forceHeight"`
+ ForceWidth interface{} `json:"forceWidth"`
+ BucketName interface{} `json:"bucketName"`
+ AudioCodec interface{} `json:"audioCodec"`
+
+ ForceBucketName string `json:"forceBucketName,omitempty"`
+ Gl *string `json:"gl,omitempty"`
+ X264Preset interface{} `json:"x264Preset"`
}
type RawInvokeResponse struct {
@@ -91,8 +93,6 @@ type RemotionRenderResponse struct {
RenderId string `json:"renderId"`
}
-
-
type RenderConfig struct {
RenderId string `json:"renderId" validate:"required"`
BucketName string `json:"bucketName" validate:"required"`
@@ -107,7 +107,6 @@ type renderProgressInternalConfig struct {
Version string `json:"version" validate:"required"`
}
-
type RenderProgress struct {
OverallProgress float64 `json:"overallProgress"`
Chunks int `json:"chunks"`
diff --git a/packages/lambda-php/src/RenderParams.php b/packages/lambda-php/src/RenderParams.php
index e57c006a83..684da69cbc 100644
--- a/packages/lambda-php/src/RenderParams.php
+++ b/packages/lambda-php/src/RenderParams.php
@@ -66,6 +66,7 @@ class RenderParams
private $webhook = null;
private $forceHeight = null;
private $forceWidth = null;
+ private $offthreadVideoCacheSizeInBytes = null;
private $audioCodec = null;
private $rendererFunctionName = null;
private $proResProfile = null;
@@ -100,6 +101,7 @@ class RenderParams
?string $webhook = null,
?int $forceHeight = null,
?int $forceWidth = null,
+ ?int $offthreadVideoCacheSizeInBytes = null,
?string $audioCodec = null,
?int $framesPerLambda = null,
?string $rendererFunctionName = null,
@@ -135,6 +137,7 @@ class RenderParams
$this->webhook = $webhook;
$this->forceHeight = $forceHeight;
$this->forceWidth = $forceWidth;
+ $this->offthreadVideoCacheSizeInBytes = $offthreadVideoCacheSizeInBytes;
$this->audioCodec = $audioCodec;
$this->framesPerLambda = $framesPerLambda;
$this->rendererFunctionName = $rendererFunctionName;
@@ -174,6 +177,7 @@ class RenderParams
'webhook' => $this->getWebhook(),
'forceHeight' => $this->getForceHeight(),
'forceWidth' => $this->getForceWidth(),
+ 'offthreadVideoCacheSizeInBytes' => $this->getOffthreadVideoCacheSizeInBytes(),
'bucketName' => $this->getBucketName(),
'audioCodec' => $this->getAudioCodec(),
'x264Preset' => $this->getX264Preset(),
@@ -626,6 +630,11 @@ class RenderParams
$this->forceWidth = $forceWidth;
}
+ public function setOffthreadVideoCacheSizeInBytes($offthreadVideoCacheSizeInBytes)
+ {
+ $this->offthreadVideoCacheSizeInBytes = $offthreadVideoCacheSizeInBytes;
+ }
+
// Getter methods
public function getMuted()
{
@@ -661,6 +670,10 @@ class RenderParams
{
return $this->forceWidth;
}
+ public function getOffthreadVideoCacheSizeInBytes()
+ {
+ return $this->offthreadVideoCacheSizeInBytes;
+ }
/**
* Get the value of serverUrl
diff --git a/packages/lambda-python/remotion_lambda/models.py b/packages/lambda-python/remotion_lambda/models.py
index 90a00d6fa2..e18dd8e449 100644
--- a/packages/lambda-python/remotion_lambda/models.py
+++ b/packages/lambda-python/remotion_lambda/models.py
@@ -43,6 +43,7 @@ class RenderParams:
video_bitrate: Optional[int] = None
webhook: Optional[str] = None
force_height: Optional[int] = None
+ offthreadvideo_cache_size_in_bytes: Optional[int] = None
force_width: Optional[int] = None
audio_codec: Optional[str] = None
renderer_function_name: Optional[str] = None
@@ -81,6 +82,7 @@ class RenderParams:
'videoBitrate': self.video_bitrate,
'webhook': self.webhook,
'forceHeight': self.force_height,
+ 'offthreadVideoCacheSizeInBytes': self.offthreadvideo_cache_size_in_bytes,
'forceWidth': self.force_width,
'bucketName': self.bucket_name,
'audioCodec': self.audio_codec,