Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Principle:0xsline OpenChatCut Server Side Video Rendering

From Leeroopedia
Knowledge Sources
Domains Video_Rendering, Video_Export, Encoding
Last Updated 2026-10-22 14:00 GMT

Overview

Rendering principle that converts a timeline state into a production-ready video file by composing frames in a headless browser, encoding with hardware-accelerated H.264 (or ProRes/VP8), and applying optional frame-rate retiming.

Description

Server-Side Video Rendering is the core rendering stage of the export pipeline. It takes a materialized `ExportPlan` and produces a video file by:

  • Composing frames in a headless Chromium browser via Remotion's `renderMedia`.
  • Selecting the composition from the Remotion bundle with the materialized timeline as input props.
  • Encoding with H.264 (hardware-accelerated via NVENC/VAAPI when available), VP8 (WebM), or ProRes 422 HQ (mezzanine).
  • Frame-rate retiming — optionally re-encoding at a different FPS by dropping/duplicating frames while preserving duration.
  • Progress reporting — streaming progress updates (phase, percentage, frame count) to the job lifecycle.
  • Error recovery — detecting OOM, timeout, and cancellation, cleaning up partial outputs, and classifying failures for retry.

The renderer supports multiple codecs:

  • H.264: Default video codec, with hardware acceleration selection and bitrate control.
  • VP8: WebM container alternative.
  • ProRes 422 HQ: Mezzanine master, server-only, no bitrate control.
  • MP3/WAV: Audio-only export.

Usage

Use this principle when:

  • Rendering a timeline to a video file without a visible browser window.
  • Producing H.264, VP8, ProRes, or audio-only exports.
  • Applying frame-rate retiming (e.g., 30fps → 24fps while preserving duration).
  • Selecting the best available H.264 encoder (hardware vs. software fallback).

Theoretical Basis

The rendering pipeline:

  1. Bundle: Load the Remotion serve URL (pre-built composition bundle).
  2. Select composition: Resolve the composition with input props (timeline state, project).
  3. Render frames: Chromium renders each frame to an image buffer.
  4. Encode: FFmpeg encodes frames to the target codec (H.264/VP8/ProRes).
  5. Retime (optional): If `retimeFps` differs from source FPS, re-encode with frame drop/duplication.
  6. Output: Write the final file to `outputLocation`.
# Abstract algorithm (NOT real implementation)
def render_timeline(state, output_location, codec, scale, fps_retime):
    serve_url = load_remotion_bundle()
    composition = select_composition(serve_url, input_props={state})
    encoder = select_h264_encoder()  # hardware or software
    rendered = render_media(
        composition, codec=codec, scale=scale,
        encoder_options=encoder,
        on_progress=report_progress,
    )
    if fps_retime and fps_retime != state.fps:
        rendered = retime_fps(rendered, state.fps, fps_retime)
    write_file(rendered, output_location)

Related Pages

Implemented By

Uses Heuristic

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment