render_video
Render a page's animation timelines to an MP4 video. The page's scripts must expose window.__timelines — objects with duration() and pause(t) (a paused gsap.timeline registered there works as-is). Each frame seeks every timeline to t=i/fps and paints the viewport, so the output is deterministic — no wall clock in the pixel values. Audio: narration[] places TTS/voice clips at start times (mixed into one AAC track), audio adds looped background music, and subtitles_srt muxes an SRT as a soft mov_text track. Requires ffmpeg on the server. Returns base64 MP4 (H.264, yuv420p) plus frame count and durations.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fps | No | Frames per second. Default 24. | |
| url | Yes | Page URL whose scripts register timelines in `window.__timelines` (GSAP-style objects with `duration()` + `pause(t)`). | |
| audio | No | Background music: looped to cover the video, volume-scaled, faded out at the tail. | |
| width | No | Viewport width in CSS pixels (floored to even — yuv420p). Default 1280. | |
| height | No | Viewport height in CSS pixels. Default 720. | |
| narration | No | Voiceover clips, each starting at its own time (any TTS output; mixed into one AAC track). | |
| use_proxy | No | Route through proxy (for blocked foreign sites) | |
| subtitles_srt | No | Inline SRT subtitles muxed as a soft (toggleable) mov_text track. | |
| hold_tail_secs | No | Freeze the final timeline state for this many extra seconds. Default 0.5. | |
| tls_fingerprint | No | TLS fingerprint override (stealth mode only) | |
| max_duration_secs | No | Safety cap on timeline + hold tail, seconds. Default 120. | |
| wait_timelines_ms | No | How long to wait for `window.__timelines` to appear, ms. Default 10000. | |
| subtitles_language | No | ISO language tag for the subtitle track, e.g. "eng" / "zh". |