AI & ML interests

None defined yet.

Recent Activity

Organization Card

FFmpeg Shorts Generator – Polyglot Implementation

Multiple language implementations of the same FFmpeg video processing API for load balancing, educational purposes, and polyglot learning.

This project provides wrappers around FFmpeg for generating short videos with audio, subtitles, and background clips. All implementations expose the same HTTP API, regardless of programming language.


Available Languages

  • Python – Native FastAPI implementation
  • Node.js – JavaScript/TypeScript wrapper
  • Go – Go wrapper
  • More languages can be added as needed

Each implementation runs independently and exposes the same endpoints, allowing seamless job routing and polyglot load balancing.


Why Multiple Languages?

Load Balancing

Multiple language implementations allow more concurrent processing spaces. Each service can handle jobs independently, increasing total throughput.

Learning Resource

See the same video processing API implemented in different programming languages. This is useful for developers to understand FFmpeg integration in various ecosystems.

Flexibility

Contributors can add their preferred language without changing the API contract. All code is open-source under the MIT License.


Free to Use

💡 The code is fully free to use.

You can:

  • Fork the repository
  • Copy code directly
  • Modify it as you wish

All implementations are open-source under the MIT License, so feel free to adapt, extend, or integrate it into your projects.


How It Works

All implementations expose the same HTTP endpoints:

GET    /register          – Get or create your client token
POST   /generate          – Submit a new video processing job
GET    /job/{id}          – Poll status and queue position
DELETE /job/{id}          – Cancel a job (controller only)
GET    /queue             – Get overall queue snapshot
GET    /download/{id}     – Download completed video
DELETE /video/{id}        – Delete video
GET    /videos/{category} – List available background videos
GET    /health            – Health check

Workflow

  1. Register client – Obtain a client token (/register).
  2. Submit job – Send audio (base64), subtitles (ASS), and background info (/generate).
  3. Queued & processed – Job enters a queue with rate limiting and concurrent job management.
  4. Progress tracking – Poll job status via /job/{id} for progress, estimated wait time, and encoding stats.
  5. Download output – When complete, video can be downloaded from /download/{id}.

The ArchNemix controller automatically routes jobs to any available service instance, regardless of language implementation.


Performance

  • 1 concurrent job per service (configurable)
  • Average job duration: ~6 minutes per short video
  • Queue system calculates ETA and progress
  • Total throughput increases as more language implementations are added

Features

  • FFmpeg single-pass encoding with subtitles overlay
  • Background video trimming or looping to match audio duration
  • CRF 16, medium preset, 8–16 Mbps, AAC 192k audio
  • Rate limiting per client and per job
  • Job persistence and automatic cleanup of old jobs
  • Detailed FFmpeg progress tracking (frame, fps, speed, out_time)

Contributing

Want to add another language implementation?

  1. Fork an existing implementation (Python, Node.js, Go, etc.)
  2. Translate it into your preferred language
  3. Maintain the same API contract

This ensures compatibility with the ArchNemix controller and allows jobs to be routed across languages.


License

MIT

models 0

None public yet