# Sheet to videos

This example app is a web page you run on your own computer. It turns a product sheet into one video ad per row, and renders them all as one batch. Each row puts a product's photo, name and price into a 9-second sale spot.

```video
src: /docs/blitframe/videos/sheet-to-videos.mp4
poster: /docs/blitframe/images/sheet-to-videos-poster.jpg
caption: Sheet to videos: edit the sheet, render it as one batch, and download every video
```

The code is open source: [github.com/CodeArtworks/blitframe-sheet-to-videos](https://github.com/CodeArtworks/blitframe-sheet-to-videos).

## What you can do with it

1. Edit the sheet in the page, or import a CSV file of your own products.
2. Press **Render**. Each tile plays its video while it renders.
3. Download every video as one ZIP.

## Run it

You need [Node.js](https://nodejs.org) 22.18 or later and an API key from the [console](https://app.codeartworks.com/blitframe/api-keys). To run it:

```bash
git clone https://github.com/CodeArtworks/blitframe-sheet-to-videos.git
cd blitframe-sheet-to-videos
npm install
npm start
```

Open `http://localhost:3000` in your browser and paste your API key when the page asks for it. The app's server, which runs on your computer, saves the key in a `.env` file, so the next start connects by itself.

The app also works without the page. Once the key is in `.env`, this command renders every row of `products.csv` and saves the videos in the `out/` folder:

```bash
npm run cli
```

![Sheet to videos after a render: the bottom of the product sheet with its Render 5 videos button, and five finished videos, each showing its own pair of glasses, price and feature, with an MP4 link and a Download all as ZIP button.](/docs/blitframe/images/example-sheet-to-videos.webp)

## How it uses the API

The API behind each feature:

| Step | API |
|---|---|
| The app sends the template folder to a project, which holds the composition and its files. Every later run reuses that project. | [Projects and versions](/docs/blitframe/projects) |
| The app asks which layers of the template can be changed, and finds the layer each column changes by its name. | [Editable layers](/docs/blitframe/layers#editable-layers) |
| Each row's photo is sent to Blitframe as its own upload. | [Uploads and ZIP import](/docs/blitframe/uploads) |
| **Render** queues one render per row, all in one batch request. Each render carries replacements, which put that row's text and photo into its video only. | [Many videos from a data sheet](/docs/blitframe/renders#many-videos-from-a-data-sheet) |
| One request reads the status of every render in the batch. Each tile plays its video as an HLS stream while it renders. | [Live HLS](/docs/blitframe/renders#live-hls) |
| **Download all as ZIP** asks for one ZIP of every finished video. | [Download many videos as one ZIP](/docs/blitframe/renders#download-many-videos-as-one-zip) |

## Make it yours

To render your own design from your own sheet:

1. Name the layers you want to change, in After Effects or in `data.json`.
2. Put your composition and its files in the `template/` folder.
3. List which column changes which layer, in the app's code. The repository's README says where.

Add [text fitting](/docs/blitframe/text-fitting) rules to your template to keep longer names and prices inside the design, as the sample template does.
