---
name: "render-clips"
description: "Use this skill when the task matches: Render selected Opal Sparks into downloadable vertical MP4 files."
---
# Render Clips

## Purpose

Render selected Sparks into downloadable vertical MP4 files.

## Current API

```txt
POST /api/jobs/:jobId/render
POST /api/jobs/:jobId/cancel
GET  /api/jobs/:jobId
GET  /api/jobs/:jobId/downloads
GET  /api/files/:jobId/:fileName
```

## Inputs

```json
{
  "selection": "approved"
}
```

Allowed selections:

```txt
approved
top3
all
```

## Outputs

```json
{
  "jobId": "string",
  "status": "ready_for_download",
  "clips": [
    {
      "id": "string",
      "outputUrl": "string"
    }
  ]
}
```

## Steps

1. Select valid Sparks.
2. Generate subtitle files.
3. Render 1080x1920 MP4 cuts with FFmpeg.
4. Save output metadata.
5. Expose downloads through file routes.

## Rules

Use FFmpeg.
Export MP4.
Use H.264 video.
Use AAC audio.
Support cancellation between render batches and active child processes.
