Deployment — Server-Side Render Pipeline
wity-scene provides a single public Lambda entry point (witySceneRender) that accepts a scene XML document and returns a rendered output URL. Internally it inspects the scene and routes to the appropriate specialized Lambda — callers never need to know about the internal pipeline.
For the full API reference of the gateway, see witySceneRender.
Public entry point — witySceneRender
caller → witySceneRender (gateway)
│ outputFormat?
├─ "mp4" → witySceneToVideo? → witySceneCompose? → final URL
├─ "pdf" → witySceneToPdf → S3 URL
└─ "pptx" → witySceneToPptx → S3 URLInput
{
"sceneXml": "<wity-scene>...</wity-scene>",
"outputFormat": "mp4",
"options": {
"fps": 30,
"sceneWidth": 1920,
"sceneHeight": 1080,
"fontManifest": { "Inter": "https://cdn.example.com/Inter.ttf" }
}
}outputFormat defaults to "mp4". Supported values: "mp4", "pdf", "pptx".
PDF-specific options:
| Option | Type | Default | Description |
|---|---|---|---|
options.ts | number | 0 | Scene time (seconds) to snapshot |
options.timestamps | number[] | — | One page per timestamp (overrides ts) |
options.variant | "standard" | "print" | "standard" | Screen (96 DPI) or high-res (300 DPI) |
options.dpi | number | 96 / 300 | Override render DPI |
PPTX-specific options:
| Option | Type | Default | Description |
|---|---|---|---|
options.ts | number | 0 | Scene time (seconds) to snapshot |
options.timestamps | number[] | — | One slide per timestamp (overrides ts) |
Response
{ "url": "https://...", "fileSize": 9876543, "pipeline": ["witySceneToVideo", "witySceneCompose"] }For "pdf": response also includes "pages": number. For "pptx": response also includes "slides": number.
pipeline lists which downstream Lambdas were invoked — useful for observability and cost attribution.
Lambda config
| Setting | Value |
|---|---|
| Function name | witySceneRender |
| Memory | 512 MB |
| Timeout | 660 s (11 min — accommodates two sequential 300 s downstream calls for mp4) |
| Ephemeral storage | 512 MB |
| Runtime | Node.js 20 |
| No FFmpeg layer needed | This Lambda only parses and routes — no media processing |
Environment variables
| Variable | Default | Description |
|---|---|---|
SCENE_TO_VIDEO_FUNCTION | witySceneToVideo | Graphics compiler Lambda |
SCENE_COMPOSE_FUNCTION | witySceneCompose | Full compositor Lambda |
SCENE_TO_PDF_FUNCTION | witySceneToPdf | PDF renderer Lambda |
SCENE_TO_PPTX_FUNCTION | witySceneToPptx | PPTX renderer Lambda |
IAM note: The execution role must have
lambda:InvokeFunctionpermission on all downstream Lambdas.
Routing logic
Routing is determined by outputFormat:
outputFormat: "mp4" (default)
The gateway additionally inspects element tags to pick the minimal pipeline:
| Scene content | Route |
|---|---|
Only ws-rect / ws-text / ws-image | witySceneToVideo only |
Graphics + ws-video / ws-audio | witySceneToVideo → witySceneCompose |
Only ws-video / ws-audio | witySceneCompose only (graphicsMp4Url: null) |
outputFormat: "pdf" or "pptx"
Single downstream Lambda call. No content inspection — all element types are accepted; ws-video and ws-audio are silently skipped in the snapshot renderer (graphics only).
All routing is entirely internal. The caller provides sceneXml + outputFormat and receives a URL.
Adding a new output format
The gateway uses a PIPELINE_REGISTRY keyed by outputFormat. To add a new format:
- Deploy a specialized Lambda.
- Add one entry to
PIPELINE_REGISTRYinhandler.js. - Add the env var to the gateway config.
No changes to any existing Lambda.
Downstream Lambdas (internal)
These are internal infrastructure. Callers must not invoke them directly — use witySceneRender.
witySceneToVideo — graphics compiler
Renders ws-rect, ws-text, ws-image → PNG frame sequence → silent MP4.
Package: @wity/scene-to-video
| Setting | Value |
|---|---|
| Memory | 3008 MB · Timeout 300 s · Ephemeral 4096 MB |
| FFmpeg layer | arn:aws:lambda:ap-south-1:175033217214:layer:ffmpeg:1 |
Input: { sceneXml, fontManifest?, fps? } → { url, fileSize }
witySceneCompose — full compositor
Blends ws-video + ws-audio + optional graphics overlay via FFmpeg filter_complex.
Package: @wity/scene-compose
| Setting | Value |
|---|---|
| Memory | 2048 MB · Timeout 300 s · Ephemeral 4096 MB |
| FFmpeg layer | arn:aws:lambda:ap-south-1:175033217214:layer:ffmpeg:1 |
Input: { sceneXml, graphicsMp4Url?, fps?, sceneWidth?, sceneHeight? } → { url, fileSize }
witySceneToPdf — PDF renderer
Snapshots scene at one or more timestamps via node-canvas → pdf-lib → PDF.
Package: @wity/scene-to-pdf
| Setting | Value |
|---|---|
| Memory | 2048 MB · Timeout 120 s · Ephemeral 1024 MB |
| No FFmpeg layer needed |
Input: { sceneXml, fontManifest?, ts?, timestamps?, variant?, dpi? } → { url, fileSize, pages }
witySceneToPptx — PPTX renderer
Snapshots scene at one or more timestamps via node-canvas → pptxgenjs → PowerPoint.
Package: @wity/scene-to-pptx
| Setting | Value |
|---|---|
| Memory | 1024 MB · Timeout 120 s · Ephemeral 1024 MB |
| No FFmpeg layer needed |
Input: { sceneXml, fontManifest?, ts?, timestamps? } → { url, fileSize, slides }
Analysis services (separate from rendering)
Analysis services are standalone Lambdas — they are not routed through witySceneRender.
wityAudioProfile — audio loudness analysis
Downloads all ws-video and ws-audio media, decodes audio via FFmpeg, measures windowed RMS loudness per element, and returns per-element + power-mixed loudness profiles in dBFS.
Not an output format — callers invoke this Lambda directly.
See the wityAudioProfile reference for full input/output documentation.
| Setting | Value |
|---|---|
| Memory | 1024 MB · Timeout 120 s · Ephemeral 2048 MB |
| FFmpeg layer | arn:aws:lambda:ap-south-1:175033217214:layer:ffmpeg:1 |
Input: { sceneXml, options?: { windowMs?, sampleRate? } } → AudioProfileResult
S3 bucket setup
All downstream Lambdas write to wity-user-generated-content under separate prefixes:
| Lambda | Prefix |
|---|---|
witySceneToVideo | scene-compiled/ |
witySceneCompose | scene-composed/ |
witySceneToPdf | scene-pdf/ |
witySceneToPptx | scene-pptx/ |
The gateway Lambda does not write to S3 — it only orchestrates.
