PreviewGen is a microservice that generates .webm preview videos from a sequence of screenshots.
Built with:
Designed for easy integration into Docker Compose environments, e.g. Kompakkt Mono.
Endpoint: POST /generate-preview-video
Headers: Content-Type: application/json
Body Schema:
{
entityId: string; // Unique ID for the job/entity
screenshots: string[]; // Array of base64 encoded image strings
}Example Request:
curl -X POST http://localhost:3000/generate-preview-video \
-H "Content-Type: application/json" \
-d '{
"entityId": "demo-1",
"screenshots": ["data:image/png;base64,iVBORw0KGgo...", "data:image/png;base64,..."]
}' --output preview.webmResponse:
Returns the binary video file (Content-Type: video/webm).
services:
preview-gen:
image: ghcr.io/your-username/previewgen:latest
restart: always
ports:
- "3000:3000"# Build the image
docker build -t preview-gen .
# Run the container
docker run -p 3000:3000 preview-genPrerequisites:
- Bun
- FFmpeg (must be in your PATH)
# Install dependencies
bun install
# Run in development mode
bun run --watch src/index.tsLicensed under the GNU Affero General Public License v3.0 (AGPLv3).