A modern, modular, and extensible FFmpeg command builder written in Python.
Encode Kit is designed to make building complex FFmpeg commands simple through a clean object-oriented architecture.
Instead of writing long command strings manually, you describe an encoding job and Encode Kit generates the command for you.
- 🎬 Object-oriented FFmpeg command builder
- 🧩 Plugin-based preset system
- 📦 Modular architecture
- 🚀 Easily extend with custom codecs
- 🎵 Audio, Video and Subtitle support
- 📺 HLS ready
- ⚡ Clean Python API
- 🛠 Built for automation and backend services
EncodeJob
│
▼
FFmpegEngine
│
▼
CommandBuilder
│
▼
Preset
│
▼
FFmpeg Command
git clone https://github.com/muerfox/Encode-Kit.git
cd Encode-Kitfrom Encode-Kit import FFmpegEngine
from Encode-Kit.models import EncodeJob
job = EncodeJob(
video="movie.mp4",
output="movie_out.mp4",
preset="h264",
crf=22,
video_preset="slow",
)
command = FFmpegEngine.build(job)
print(command)Output
ffmpeg \
-i movie.mp4 \
-c:v libx264 \
-crf 22 \
-preset slow \
movie_out.mp4Encode Kit uses a plugin architecture.
Creating a new preset only requires inheriting from Preset.
from .base import Preset
class H264Preset(Preset):
name = "h264"
def apply(self, builder):
builder.add(
"ffmpeg",
"-i",
builder.job.video,
"-c:v", "libx264",
"-crf", str(builder.job.crf),
"-preset", builder.job.video_preset,
builder.job.output
)Done.
foxencode/
├── core/
│ ├── command_builder.py
│ └── ...
│
├── presets/
│ ├── base.py
│ ├── h264.py
│ ├── hevc.py
│ └── ...
│
├── models/
│ └── job.py
│
├── registry.py
│
└── engine.py
Encode Kit follows several software engineering principles:
- Single Responsibility Principle
- Open/Closed Principle
- Dependency Inversion
- Composition over Inheritance
- Extensible Plugin Architecture
- Stream Mapping API
- Audio Pipeline
- Subtitle Pipeline
- HLS Builder
- Hardware Encoder Support
- Thumbnail Generator
- Metadata Builder
- Validation Layer
- Progress Parser
Instead of writing
ffmpeg -i input.mp4 \
-c:v libx264 \
-preset slow \
-crf 20 \
-c:a aac \
-b:a 192k \
output.mp4You simply write
job = EncodeJob(...)
cmd = FFmpegEngine.build(job)- No giant string concatenation
- No unreadable command generation
- Highly testable
- Easily extensible
- Backend friendly
- Production ready architecture
Made with ❤️ using Python & FFmpeg.