# cyberytti/video2transcript architecture

> Architecture diagram of the GitHub repository cyberytti/video2transcript, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cyberytti/video2transcript
- Repository: https://github.com/cyberytti/video2transcript

## Overview

##### Project type and purpose
- This is a full-stack, monolithic Flask web application whose goal is to let users upload MP4 videos, convert them into audio, transcribe speech using an AI model (Whisper via the Groq API), translate the transcript into multiple languages (using Gemma3 via Ollama), and download the result as a JSON file.

##### File structure
- Top-level:
- app.py – Flask application and route definitions
- main.py – Orchestrator for the processing pipeline
- functions/ – Pure-Python modules implementing each processing step
- templates/ + static/ – Frontend HTML, JS, CSS
- outputs/ – Stores generated transcript JSONs
- requirements.txt, README.md, LICENSE
- The “functions” directory reveals a simple pipeline: video_to_wav → wav_to_16kwav → convertedwav_to_transcript → transcript_lan_covert.

##### Extract additional insights from the README
- Core external dependencies: FFmpeg (local CLI), Groq API (remote HTTP) for speech recognition, Ollama with Gemma3 (local HTTP) for translation.
- UI is a single-page form with progress indicators and a “Download JSON” link.

##### Key details to capture
- All four processing steps in order
- The role of FFmpeg as an external binary
- Two distinct external AI services (Groq vs. Ollama)
- The persistence of uploads and outputs on disk
- The synchronous request-response pattern in Flask

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        Browser["Browser\n(User Interface)"]:::frontend
        Index["templates/index.html"]:::frontend
        Script["static/script.js"]:::frontend
        Style["static/style.css"]:::frontend
    end

    %% Application Layer
    subgraph "Application Layer"
        FlaskApp["Flask App\n(app.py)"]:::backend
        Orchestrator["Orchestrator\n(main.py)"]:::backend
    end

    %% Processing Pipeline
    subgraph "Processing Pipeline"
        Video2Wav["Video → WAV Converter\n(functions/video_to_wav.py)"]:::backend
        Wav2["WAV → 16kHz Converter\n(functions/wav_to_16kwav.py)"]:::backend
        Transcribe["Audio Transcription\n(functions/convertedwav_to_transcript.py)"]:::backend
        Translate["Transcript Translation\n(functions/transcript_lan_covert.py)"]:::backend
    end

    %% External Services
    subgraph "External Services"
        FFmpeg["FFmpeg CLI"]:::external
        GroqAPI["Groq Whisper API"]:::external
        Ollama["Ollama/Gemma3 API"]:::external
    end

    %% File Storage
    Outputs["Output File Store\n(outputs/)"]:::storage

    %% Documentation
    subgraph "Documentation"
        Req["requirements.txt"]
        Readme["README.md"]
        License["LICENSE"]
    end

    %% Connections
    Browser -->|"POST /process-video"| FlaskApp
    FlaskApp -->|"save upload"| Outputs
    FlaskApp --> Orchestrator
    Orchestrator --> Video2Wav
    Video2Wav -->|"spawn ffmpeg"| FFmpeg
    Orchestrator --> Wav2
    Wav2 -->|"spawn ffmpeg"| FFmpeg
    Orchestrator --> Transcribe
    Transcribe -->|"REST /transcribe"| GroqAPI
    Orchestrator --> Translate
    Translate -->|"REST /translate"| Ollama
    Orchestrator -->|"write JSON"| Outputs
    Browser -->|"GET /progress & download"| FlaskApp

    %% Click Events
    click Index "https://github.com/cyberytti/video2transcript/blob/main/templates/index.html"
    click Script "https://github.com/cyberytti/video2transcript/blob/main/static/script.js"
    click Style "https://github.com/cyberytti/video2transcript/blob/main/static/style.css"
    click FlaskApp "https://github.com/cyberytti/video2transcript/blob/main/app.py"
    click Orchestrator "https://github.com/cyberytti/video2transcript/blob/main/main.py"
    click Video2Wav "https://github.com/cyberytti/video2transcript/blob/main/functions/video_to_wav.py"
    click Wav2 "https://github.com/cyberytti/video2transcript/blob/main/functions/wav_to_16kwav.py"
    click Transcribe "https://github.com/cyberytti/video2transcript/blob/main/functions/convertedwav_to_transcript.py"
    click Translate "https://github.com/cyberytti/video2transcript/blob/main/functions/transcript_lan_covert.py"
    click Outputs "https://github.com/cyberytti/video2transcript/tree/main/outputs/"
    click Req "https://github.com/cyberytti/video2transcript/blob/main/requirements.txt"
    click Readme "https://github.com/cyberytti/video2transcript/blob/main/README.md"
    click License "https://github.com/cyberytti/video2transcript/tree/main/LICENSE"

    %% Styles
    classDef frontend fill:#bbdefb,stroke:#333,stroke-width:1px
    classDef backend fill:#c8e6c9,stroke:#333
    classDef external fill:#ffe0b2,stroke:#333
    classDef storage fill:#e0e0e0,stroke:#333
```
