Ffmate
FFmate is a modern and powerful automation layer built on top of FFmpeg - designed to make video and audio transcoding simpler, smarter, and easier to integrate
Install / Use
/learn @welovemedia/FfmateREADME
FFmate
FFmate is an automation layer built on top of FFmpeg, designed not only to simplify transcoding but also to serve as an extensible engine for custom media workflows. It provides developers with the tools to integrate FFmpeg's power into their applications and services through a comprehensive REST API, event-driven webhooks, and scriptable pre/post-processing hooks.
If you're looking to build custom media processing pipelines, integrate transcoding into your existing systems, or develop tools that leverage FFmpeg, FFmate provides the foundation.
✨ Core Features for Extensibility
FFmate is built with extensibility in mind. Here's how you can leverage its core components:
- REST API – Submit and manage FFmpeg tasks programmatically
- Web UI – Monitor and control jobs in real time, no terminal required
- Cluster Support – Run multiple FFmate instances together, sharing the same database for scaling and redundancy
- Watchfolders – Automatically process files dropped into a directory
- Presets – Ready-made set of pre-configured transcoding presets for common use cases
- Webhooks – Get real-time notifications for task events
- Dynamic Wildcards – Automate file naming and folder structures
- Pre/Post Processing – Run custom scripts before or after each task to automate complex workflow steps
- Built-in Queue – Manage task execution with priority control and smart concurrency handling
📚 Product Documentation
Want to dive deeper into FFmate? The documentation covers everything—from API usage to Web UI features and real-world examples 👉 Everything you need is now available at https://docs.ffmate.io
🚀 Getting Started for Developers
To start extending, integrating with, or contributing to FFmate:
Prerequisites
- FFmpeg: Installed and in
$PATH. - Go (Golang): Version 1.24+ (or specify your project's minimum version). Required for building from source or contributing to core.
- Git: For cloning the repository.
- Familiarity with REST APIs and JSON.
- Your preferred scripting language (Python, Bash, Node.js, etc.) for pre/post-processing scripts.
Installation & Setup
You have two main options:
-
Use Pre-compiled Binaries (for integration/extension):
- Download the latest binary from GitHub Releases.
- Make executable:
chmod +x ffmate - (Optional) Move to a directory in your
$PATH. - Run FFmate Server:
./ffmate server
-
Build from Source (for core contribution/deep customization):
- Clone the repository:
git clone https://github.com/welovemedia/ffmate.git cd ffmate - Install Go dependencies:
go mod tidy # or go get ./... - Build the FFmate binary:
The compiledgo build -o ffmate main.goffmatebinary will be in the root of theffmatedirectory. - Run FFmate Server:
./ffmate server # For development, consider enabling debug for relevant namespaces: # ./ffmate server --debug="api:webhook:queue:ffmpeg:sev"
- Clone the repository:
The API will be available at http://localhost:3000.
Key Extension Points - Quick Reference
- Integrating with an existing application?
- Start with the
/api/v1/tasksendpoint to submit jobs. - Use
/api/v1/webhooksto get status updates back to your application.
- Start with the
- Need custom logic around transcoding?
- Implement pre/post-processing scripts.
- Define
scriptPathandsidecarPathin your task/preset API calls.
- Building a custom dashboard or UI?
- The entire Web UI is built on the public REST API and WebSockets. You can do the same!
- WebSockets (served from
/wson the same port) provide real-time updates for tasks and logs.
- Automating complex ingestion workflows?
- Use the
/api/v1/watchfoldersendpoint combined with presets that trigger your custom processing logic.
- Use the
🔧 Understanding FFmate Internals & Code Structure
FFmate is a Go application. A high-level overview of its structure and key components for extension:
Conceptual Diagram:
graph TD
%% ─── UI & API ─────────────────────────
YourApp["Your Application / Script"] -- REST API --> REST_API["FFmate REST API (Gin)"]
WebUI["FFmate Web UI (Vue/React/Static)"] -- REST API / WebSockets --> REST_API
%% ─── Services (single row) ───────────
subgraph FFmate_Services ["Services Layer (./internal/services)"]
direction LR
TaskSvc["Task Service"]
PresetSvc["Preset Service"]
WatchfolderSvc["Watchfolder Service"]
WebhookSvc["Webhook Service"]
end
REST_API --> TaskSvc
REST_API --> PresetSvc
REST_API --> WatchfolderSvc
REST_API --> WebhookSvc
%% ─── Core & DB side-by-side ───────────
subgraph FFmate_Core ["Core Logic (./internal/core, ./internal/ffmpeg)"]
direction LR
Queue["Task Queue Processor"]
PrePostScripts["Pre/Post-Processing Engine"]
DB[(SQLite DB - GORM)]
end
TaskSvc --> Queue
Queue --> PrePostScripts
PrePostScripts --> FFMpegBinary["ffmpeg Binary Wrapper"]
Queue --> DB
WebhookSvc -- Event Bus/Direct Call --> YourAppWebhook["Your Webhook Endpoint"]
FFMpegBinary -- system call --> ActualFFmpeg["ffmpeg (External Binary)"]
%% ─── Styling ───────────
style YourApp fill:#e6ffe6,stroke:#009933,stroke-width:1.5px,color:#000;
style YourAppWebhook fill:#e6ffe6,stroke:#009933,stroke-width:1.5px,color:#000;
classDef ui fill:#99d6ff,stroke:#2060a0,stroke-width:1.2px,color:#000000;
classDef api fill:#b3e0ff,stroke:#2060a0,stroke-width:1.2px,color:#000000;
classDef svc fill:#bdb4ff,stroke:#4b44a0,stroke-width:1.2px,color:#000000;
classDef core fill:#99ff99,stroke:#2d7a2d,stroke-width:1.2px,color:#000000;
classDef db fill:#ffcc80,stroke:#b36b00,stroke-width:1.2px,color:#000000;
classDef ffbin fill:#ff99cc,stroke:#b3366b,stroke-width:1.2px,color:#000000;
Code Structure:
main.go: Main application entry point, CLI command parsing (using Cobra), server initialization./internal/: Core application logic, not intended for direct import by other projects./controller/: HTTP request handlers (e.g., using Gin). This is where API routes are defined and map to services./services/: Business logic for each major feature (Tasks, Presets, Watchfolders, Webhooks). Services orchestrate operations, interact with the database, and call core components./dto/: A folder holding all Data Transfer Objects./queue/: Manages the task queue, concurrency, and task lifecycle./interceptor/: Interceptors to use with Gin for various routes./middleware/: Global middleware being used by Gin./metrics/: Manages and exposes prometheus metrics for later scraping./ffmpeg/: Wrapper around theffmpegbinary, responsible for executing commands, parsing progress, and handling output/errors./database/: Database models/structs (e.g., for GORM if used) and database interaction logic (repository pattern)./config/: Application configuration management./utils/: Common utility functions.
/pkg/: Libraries intended to be used by external applications (if any). (Your current docs don't suggest FFmate is used as a library itself, mostly as a standalone server)./ui/or/web/dist/: Contains the pre-built static assets for the Web UI./docs/: Your Markdown documentation.go.mod,go.sum: Go module files.
Key Extension & Contribution Areas:
- API Handlers (
/internal/controller/): Extend existing API endpoints or add new ones. - Services (
/internal/services/): Modify or add business logic for features. - Core Logic (
/internal/ffmpeg/): Enhance task processing, FFmpeg interaction, or pre/post-script handling. - Web UI (
/ui/): The ffmate-ui repository as submodule.
🤝 Contributing to FFmate Core
Interested in contributing directly to FFmate's development? We welcome contributions!
- Understand the Project: Familiarize yourself with the existing documentation and code structure (see "Understanding FFmate Internals & Code Structure" above).
- Setup your Environment: Ensure you have Go (see prerequisites) and Git
Related Skills
bluebubbles
349.2kUse when you need to send or manage iMessages via BlueBubbles (recommended iMessage integration). Calls go through the generic message tool with channel="bluebubbles".
gh-issues
349.2kFetch GitHub issues, spawn sub-agents to implement fixes and open PRs, then monitor and address PR review comments. Usage: /gh-issues [owner/repo] [--label bug] [--limit 5] [--milestone v1.0] [--assignee @me] [--fork user/repo] [--watch] [--interval 5] [--reviews-only] [--cron] [--dry-run] [--model glm-5] [--notify-channel -1002381931352]
healthcheck
349.2kHost security hardening and risk-tolerance configuration for OpenClaw deployments
imsg
349.2kiMessage/SMS CLI for listing chats, history, and sending messages via Messages.app.
