screencastgen

Provider Overview

How the pluggable provider registries work.

Source: screencastgen/providers/


Registry Pattern

screencastgen uses registry/factory patterns for TTS, alignment, lip-sync, and visualization providers. ML-heavy backends are lazily imported, so provider modules are only loaded when the backend is actually created.

flowchart TB
    CLI[CLI and server arguments] --> Registries
    Pipelines --> Registries

    subgraph Registries[Lazy provider selection]
        TTS[TTS registry]
        Align[Alignment registry]
        Lip[Lip-sync registry]
        Visual[Visualization factory]
    end

    TTS --> Qwen[Qwen3-TTS]
    TTS --> Remote[Remote TTS]
    Align --> WhisperX
    Lip --> LatentSync
    Visual --> ManimGL
    Visual --> ManimCE

How It Works

  1. TTS, alignment, and lip-sync providers define specs with metadata such as name, module path, class/function name, capabilities, and extra parser args.
  2. The registry module stores name -> spec; visualization currently uses a direct factory with the same named-provider shape.
  3. create_backend(name) or the equivalent registry helper imports or instantiates the provider only when needed.
  4. Parser helpers register backend-specific CLI or server arguments by context.

This keeps screencastgen --help usable without requiring ML dependencies to be installed.


Provider Types

TTS Backends

Implement the TTSBackend protocol and are registered in TTS Registry.

Backend Class Contexts Key Capability
Qwen Backend QwenTTS cli, server Multi-language TTS and batched server synthesis
Remote TTS RemoteTTS cli HTTP proxy to GPU server

Alignment Providers

Registered in Alignment Registry.

Provider Function Description
WhisperX Provider align_with_whisperx() Word-level alignment via WhisperX

Lipsync Providers

Registered in Lipsync Registry.

Provider Function Description
LatentSync Provider run_latentsync() High-quality lip-sync

Visualization Renderers

Registered in Visualization Registry.

Renderer Class Description
ManimGL Renderer ManimGLRenderer Primary ManimGL subprocess adapter
ManimCE Renderer ManimCERenderer Command builder placeholder; rendering intentionally disabled

See Also