# workeffortwaste/gsap-video-export architecture

> Architecture diagram of the GitHub repository workeffortwaste/gsap-video-export, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/workeffortwaste/gsap-video-export
- Repository: https://github.com/workeffortwaste/gsap-video-export

## Overview

gsap-video-export renders a GSAP animation deterministically into video or PNG frames. A CLI user or ESM caller enters the export API, which normalizes the URL, launches Puppeteer, optionally applies cookies and scripts, inspects the GSAP timeline, advances each frame, captures a selected DOM region, optionally post-processes images, and stores temporary PNGs. The encoder then produces the configured video, while info and export metadata return to the caller. The sampled source is concentrated in index.js; some documented options are represented at subsystem level.

Main entry points: [`index.js`](https://github.com/workeffortwaste/gsap-video-export/blob/main/index.js) (Export API), [`cli.js`](https://github.com/workeffortwaste/gsap-video-export/blob/main/cli.js) (CLI adapter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry points"]
  node_cli["CLI adapter<br/>[cli.js]"]
  node_export_api["Export API<br/>[index.js]"]
end

subgraph group_browser["Browser rendering"]
  node_url_page["URL and page<br/>[index.js]"]
  node_browser_session["Browser session<br/>[index.js]"]
  node_web_animation["Animation page"]
  node_timeline_inspector["Timeline inspector<br/>[index.js]"]
  node_frame_advancer["Frame advancer<br/>[index.js]"]
  node_frame_hooks["Frame hooks<br/>[index.js]"]
end

subgraph group_frames["Frame processing"]
  node_screenshot_capture["Screenshot capture<br/>[index.js]"]
  node_post_processor["Post processor<br/>[index.js]"]
  node_temp_frames[("Temporary frames<br/>[index.js]")]
end

subgraph group_output["Encoding output"]
  node_png_output["PNG output<br/>[index.js]"]
  node_ffmpeg_encoder["FFmpeg encoder<br/>[index.js]"]
  node_video_output["Video output<br/>[index.js]"]
  node_export_metadata["Export metadata<br/>[index.js]"]
end

node_user(("User"))
node_ffmpeg["FFmpeg runtime"]

node_user -->|"runs CLI"| node_cli
node_user -->|"calls API"| node_export_api
node_cli -->|"invokes export"| node_export_api
node_export_api -->|"normalizes URL"| node_url_page
node_url_page -->|"opens page"| node_browser_session
node_browser_session -->|"loads animation"| node_web_animation
node_export_api -->|"configures browser"| node_browser_session
node_browser_session -->|"evaluates timeline"| node_timeline_inspector
node_timeline_inspector -->|"reads GSAP"| node_web_animation
node_export_api -->|"advances frames"| node_frame_advancer
node_frame_advancer -->|"updates animation"| node_web_animation
node_export_api -.->|"runs hooks"| node_frame_hooks
node_frame_hooks -.->|"prepares frame"| node_web_animation
node_export_api -->|"captures frame"| node_screenshot_capture
node_screenshot_capture -->|"writes PNG"| node_temp_frames
node_export_api -.->|"processes image"| node_post_processor
node_post_processor -.->|"writes processed PNG"| node_temp_frames
node_export_api -.->|"exports frames"| node_png_output
node_temp_frames -->|"reads PNGs"| node_ffmpeg_encoder
node_ffmpeg_encoder -->|"runs encoder"| node_ffmpeg
node_ffmpeg_encoder -->|"writes video"| node_video_output
node_export_api -->|"returns metadata"| node_export_metadata

click node_cli "https://github.com/workeffortwaste/gsap-video-export/blob/main/cli.js"
click node_export_api "https://github.com/workeffortwaste/gsap-video-export/blob/main/index.js"
click node_url_page "https://github.com/workeffortwaste/gsap-video-export/blob/main/index.js"
click node_browser_session "https://github.com/workeffortwaste/gsap-video-export/blob/main/index.js"
click node_timeline_inspector "https://github.com/workeffortwaste/gsap-video-export/blob/main/index.js"
click node_frame_advancer "https://github.com/workeffortwaste/gsap-video-export/blob/main/index.js"
click node_frame_hooks "https://github.com/workeffortwaste/gsap-video-export/blob/main/index.js"
click node_screenshot_capture "https://github.com/workeffortwaste/gsap-video-export/blob/main/index.js"
click node_post_processor "https://github.com/workeffortwaste/gsap-video-export/blob/main/index.js"
click node_temp_frames "https://github.com/workeffortwaste/gsap-video-export/blob/main/index.js"
click node_png_output "https://github.com/workeffortwaste/gsap-video-export/blob/main/index.js"
click node_ffmpeg_encoder "https://github.com/workeffortwaste/gsap-video-export/blob/main/index.js"
click node_video_output "https://github.com/workeffortwaste/gsap-video-export/blob/main/index.js"
click node_export_metadata "https://github.com/workeffortwaste/gsap-video-export/blob/main/index.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_export_api,node_user toneBlue
class node_url_page,node_browser_session,node_web_animation,node_timeline_inspector,node_frame_advancer,node_frame_hooks toneAmber
class node_screenshot_capture,node_post_processor,node_temp_frames toneMint
class node_png_output,node_ffmpeg_encoder,node_video_output,node_export_metadata toneRose
class node_ffmpeg toneIndigo
```

## Components

### Entry points

- [CLI adapter](https://github.com/workeffortwaste/gsap-video-export/blob/main/cli.js): `cli.js`
- [Export API](https://github.com/workeffortwaste/gsap-video-export/blob/main/index.js): `index.js`

### Browser rendering

- [URL and page](https://github.com/workeffortwaste/gsap-video-export/blob/main/index.js): `index.js`
- [Browser session](https://github.com/workeffortwaste/gsap-video-export/blob/main/index.js): `index.js`
- **Animation page**
- [Timeline inspector](https://github.com/workeffortwaste/gsap-video-export/blob/main/index.js): `index.js`
- [Frame advancer](https://github.com/workeffortwaste/gsap-video-export/blob/main/index.js): `index.js`
- [Frame hooks](https://github.com/workeffortwaste/gsap-video-export/blob/main/index.js): `index.js`

### Frame processing

- [Screenshot capture](https://github.com/workeffortwaste/gsap-video-export/blob/main/index.js): `index.js`
- [Post processor](https://github.com/workeffortwaste/gsap-video-export/blob/main/index.js): `index.js`
- [Temporary frames](https://github.com/workeffortwaste/gsap-video-export/blob/main/index.js): `index.js`

### Encoding output

- [PNG output](https://github.com/workeffortwaste/gsap-video-export/blob/main/index.js): `index.js`
- [FFmpeg encoder](https://github.com/workeffortwaste/gsap-video-export/blob/main/index.js): `index.js`
- [Video output](https://github.com/workeffortwaste/gsap-video-export/blob/main/index.js): `index.js`
- [Export metadata](https://github.com/workeffortwaste/gsap-video-export/blob/main/index.js): `index.js`

### Other components

- **User**
- **FFmpeg runtime**

## Connections

- User → CLI adapter: runs CLI
- User → Export API: calls API
- CLI adapter → Export API: invokes export
- Export API → URL and page: normalizes URL
- URL and page → Browser session: opens page
- Browser session → Animation page: loads animation
- Export API → Browser session: configures browser
- Browser session → Timeline inspector: evaluates timeline
- Timeline inspector → Animation page: reads GSAP
- Export API → Frame advancer: advances frames
- Frame advancer → Animation page: updates animation
- Export API → Frame hooks: runs hooks
- Frame hooks → Animation page: prepares frame
- Export API → Screenshot capture: captures frame
- Screenshot capture → Temporary frames: writes PNG
- Export API → Post processor: processes image
- Post processor → Temporary frames: writes processed PNG
- Export API → PNG output: exports frames
- Temporary frames → FFmpeg encoder: reads PNGs
- FFmpeg encoder → FFmpeg runtime: runs encoder
- FFmpeg encoder → Video output: writes video
- Export API → Export metadata: returns metadata
