Advanced / Scene · guide
renderSceneToVideoFrames
Current Apexify.js 6.0.0 documentation for renderSceneToVideoFrames.
Encodes a frame sequence into video via VideoCreator.createVideo with createFromFrames. The composed scene PNG can be prepended to your frame list.
Requirements: FFmpeg on PATH. video.options.createFromFrames is mandatory (throws if missing).
Pipeline (summary)
composedPng = await sceneCreator.render(scene, video.sceneRender)— optionalSceneRenderOptions(same asrenderScenesecond argument).body=expandSceneVideoFrames(framesWithRepeats)or[...createFromFrames.frames]frames= prepend[composedPng, ...body]unlessprependComposedToFrames === falsemerged={ ...video.options, source: video.options.source ?? composedPng, createFromFrames: { ...cf, frames } }videoCreator.createVideo(merged)
SceneVideoFrameSlot: string | Buffer | { source: string | Buffer; repeat?: number } · Optional video.sceneRender forwards SceneRenderOptions to that inner scene render step.
Variant: intro card + only composed frame
With empty frames and default prepend, the list is [composedPng] — a very short clip (one image at fps).
Variant: composed + file paths / buffers
Final order: [composedPng, a.png, b.png].
Variant: framesWithRepeats (holds / timelapse feel)
expandSceneVideoFrames flattens repeat into consecutive identical frames for FFmpeg.
Variant: no composed — only explicit frames
Must have non-empty frames or framesWithRepeats after expansion, or you get “no frames after expansion” (composed is not added).
Variant: optional source on VideoCreationOptions
If you omit source, it defaults to composedPng so VideoCreationOptions stays valid for branches that read source.
Variant: extra VideoCreationOptions keys
The merge does { ...opt, source, createFromFrames }. VideoCreator.createVideo typically follows one operation branch — extra keys are usually ignored unless they collide with detection order. Keep createFromFrames as the primary operation for this path.
Troubleshooting
| Symptom | Check |
|---|---|
| FFmpeg not found | Install FFmpeg, restart shell, ffmpeg -version. |
| Empty frames error | Prepend on + non-empty frames / framesWithRepeats, or prepend off + non-empty frames. |
| Wrong duration | Lower fps or add repeat slots to lengthen. |
See also
- Video overview —
createVideoone-op router - Video pipeline (advanced) — trim, splice, captions, SFX after scene export
createAudio(advanced) — procedural SFX to mux withmixAudioor pipeline.audio()- Video (advanced) hub