Skip to contents

Renders the scene to a video file. Supports multiple output formats and quality settings.

Usage

render(
  scene,
  output = NULL,
  format = "mp4",
  quality = "medium",
  fps = NULL,
  preview = FALSE,
  open = FALSE,
  background_color = NULL,
  transparent = FALSE,
  progress = TRUE,
  cache = TRUE
)

Arguments

scene

A Scene object

output

Output filename (without extension, or with extension to specify format)

format

Output format ("mp4", "gif", "webm", "png_sequence")

quality

Quality preset ("low", "medium", "high", "4K")

fps

Frames per second (overrides scene fps if specified)

preview

Open preview after rendering

open

Open file after rendering

background_color

Override background color

transparent

Render with transparent background (for gif/webm)

progress

Show progress bar

cache

Use cached frames if available

Value

Invisibly returns the path to the output file

Examples

if (FALSE) { # \dontrun{
scene("demo") %>%
  add_text("Hello") %>%
  write_in() %>%
  render(output = "hello_animation", format = "mp4")

# Render high-quality GIF
scene("demo") %>%
  add_circle() %>%
  grow_from_center() %>%
  render(format = "gif", quality = "high")
} # }