Skip to content

YPT-ME/Local-Encoder

Repository files navigation

Local Encoder

CI Python 3.11+ License: MIT Ruff Checked with mypy

Production-style video ingestion and transcoding pipeline built with Python.

The application downloads videos from external platforms, processes them with FFmpeg, generates thumbnails, and uploads optimized streaming files to an AVideo server — with real-time progress updates streamed to the browser.


Screenshots

chrome-capture-2026-05-29 (1)

Technical Highlights

  • FastAPI backend with async endpoints
  • Real-time progress streaming using SSE
  • Background worker architecture with thread-safe queues
  • FFmpeg transcoding pipeline
  • Multi-resolution HLS-ready encoding
  • Chunked uploads for large files
  • HTTP integrations using httpx
  • Typed Python codebase with strict mypy
  • Automated CI with GitHub Actions
  • Unit tests with pytest

Features

  • Import videos from:

    • YouTube
    • Vimeo
    • 10,000+ platforms via yt-dlp
    • Local files
  • Automatic transcoding with FFmpeg

  • Thumbnail generation:

    • JPG
    • GIF
    • WebP
  • Multi-resolution encoding

  • Chunked uploads

  • Real-time browser progress updates

  • CLI interface

  • Web dashboard


Architecture

Browser (React + SSE)
        │
        ▼
FastAPI API Server
        │
        ▼
Thread-safe Job Queue
        │
        ▼
Worker Pipeline
   ├── yt-dlp
   ├── FFmpeg
   └── AVideo API

Quick Start

git clone https://github.com/YPT-ME/Local-Encoder
cd Local-Encoder

python -m venv .venv
source .venv/bin/activate

pip install -e .

local-encoder serve

Open:

http://localhost:8000

Development

pip install -e ".[dev]"

pytest
ruff check .
mypy local_encoder

Tech Stack

Area Technologies
Backend FastAPI, httpx
Video Processing FFmpeg, yt-dlp
Frontend React, Tailwind
Testing pytest
Tooling Ruff, mypy
Packaging Hatchling
CI/CD GitHub Actions

Requirements

yt-dlp is a Python package and is installed automatically with pip install -e . — no manual setup needed.


External Tools

FFmpeg and FFprobe

The application resolves ffmpeg and ffprobe in this order:

Priority Method How
1 Bundled binaries Place ffmpeg / ffprobe (or .exe on Windows) inside a bin/ folder at the project root
2 Environment variables Set FFMPEG_BIN and FFPROBE_BIN in .env
3 System PATH Have ffmpeg and ffprobe available globally

Option A — Standalone (recommended for portability):

Local-Encoder/
└── bin/
    ├── ffmpeg.exe     ← Windows
    └── ffprobe.exe

Download static builds from ffmpeg.org/download.html or github.com/BtbN/FFmpeg-Builds.
Extract and copy only ffmpeg and ffprobe into the bin/ folder — no install required.

Option B — Environment variable:

# .env
FFMPEG_BIN=C:/tools/ffmpeg/bin/ffmpeg.exe
FFPROBE_BIN=C:/tools/ffmpeg/bin/ffprobe.exe

Option C — System PATH:

Install FFmpeg via your package manager and verify:

ffmpeg -version
ffprobe -version

License

MIT

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors