Skip to content

Kompakkt/PreviewGen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PreviewGen

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.

API Reference

Generate Video

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.webm

Response: Returns the binary video file (Content-Type: video/webm).

Deployment

Docker Compose

services:
  preview-gen:
    image: ghcr.io/your-username/previewgen:latest
    restart: always
    ports:
      - "3000:3000"

Building from Source

# Build the image
docker build -t preview-gen .

# Run the container
docker run -p 3000:3000 preview-gen

Development

Prerequisites:

  • Bun
  • FFmpeg (must be in your PATH)
# Install dependencies
bun install

# Run in development mode
bun run --watch src/index.ts

License

Licensed under the GNU Affero General Public License v3.0 (AGPLv3).

About

Microservice that generates preview videos from a sequence of screenshots.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages