# ClipNest — An AI video pipeline on queues

> My own product: a pipeline that writes, narrates, picks footage for, renders and publishes short videos. NestJS workers on BullMQ queues, CLIP embeddings in pgvector, FFmpeg on Lambda, and a spend cap that switches the cloud off before the bill runs away. Closed beta.

- Source: https://ivankarpinskyi.dev/work/clipnest

- Role: Founder and engineer: architecture, backend, infrastructure, frontend
- Years: 2025 – now
- Status: Own product · closed beta
- Live: https://clipnest.org

## § 01 Video made by a pipeline

A short video is a sequence of jobs, not a person at an editor: a script, a voice track, footage for every line, a render and a scheduled post. Each stage is a NestJS worker reading its own BullMQ queue on Redis.

## § 02 Stages and queues

_Fig. 1: ClipNest: five stages, a queue between each; the render retries up to three times._

## § 03 Matching footage with CLIP

Each line of the script is embedded with CLIP and matched against footage stored as vectors in pgvector. The footage service is the one part that runs on ECS.

## § 04 Rendering on Lambda

FFmpeg runs on AWS Lambda, with the work inside one render split across parallel invocations.

## § 05 What retries and what runs once

1. **Render retries three times**: With backoff. A failed render costs little to repeat.
2. **Generation and footage run once**: On purpose, because each run costs money. Content resumes from checkpoints instead of starting over.
3. **A hard spend cap**: A $10 monthly AWS budget with an automatic kill-switch, and a generation budget held in code.

## § 06 Publishing on a schedule

Finished videos go out on a schedule to YouTube, TikTok and Instagram.

## Stack

NestJS · TypeScript · Prisma · PostgreSQL + pgvector · BullMQ · Redis · OpenAI API · Claude API (switchable) · AWS Lambda · AWS ECS (footage) · Amazon S3 · Terraform · React · Cloudflare

## Related notes

- [Node's backpressure is a request, not a limit](https://ivankarpinskyi.dev/blog/node-streams-backpressure.md) (2026-09-09, Mechanism): highWaterMark gates one boolean and buffers the chunk anyway. What Node's write buffer really is, why drain fires once, and where pipe() leaks.
