# skydashnet/clipper architecture

> Architecture diagram of the GitHub repository skydashnet/clipper, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/skydashnet/clipper
- Repository: https://github.com/skydashnet/clipper

## Overview

Skydash.NET extracts high-replay moments from YouTube videos and turns selected or manually specified segments into vertical clips, optionally with hard subtitles. The main workflow runs through either the web dashboard or the CLI: analyze a video, choose segments and options, process them, and inspect progress and saved clips. The graph separates dashboard/API orchestration from the media-processing stages. Some run.py internals are unsampled, so those stage-to-stage links are shown as unverified rather than asserted as direct calls.

Main entry points: [`app.py`](https://github.com/skydashnet/clipper/blob/main/app.py) (Flask API), [`static/app.js`](https://github.com/skydashnet/clipper/blob/main/static/app.js) (Dashboard UI), [`run.py`](https://github.com/skydashnet/clipper/blob/main/run.py) (Video Download), [`templates/index.html`](https://github.com/skydashnet/clipper/blob/main/templates/index.html) (Dashboard Page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard"]
  node_dashboard_ui["Dashboard UI<br/>[app.js]"]
  node_dashboard_page["Dashboard Page<br/>[index.html]"]
  node_flask_api["Flask API<br/>[app.py]"]
  node_job_runner["Background Job Runner<br/>[app.py]"]
  node_job_logs["Job Logs<br/>[app.py]"]
end

subgraph group_analysis["Video Analysis"]
  node_heatmap["Heatmap Detection<br/>[run.py]"]
  node_video_info["Video Metadata<br/>[app.py]"]
  node_segment_selection["Segment Selection<br/>[app.js]"]
end

subgraph group_processing["Clip Processing"]
  node_video_download["Video Download<br/>[run.py]"]
  node_clip_extraction["Clip Extraction<br/>[run.py]"]
  node_vertical_crop["Vertical Crop<br/>[run.py]"]
end

subgraph group_outputs["Rendering and Output"]
  node_transcription["Speech Transcription<br/>[run.py]"]
  node_subtitle_render["Subtitle Rendering<br/>[run.py]"]
end

node_user(("User"))
node_browser(("Web Browser"))
node_youtube["YouTube"]
node_yt_dlp["yt-dlp"]
node_whisper["Faster-Whisper"]
node_ffmpeg["FFmpeg"]
node_clips["Generated Clips"]
node_cli["Command Line<br/>[run.py]"]

node_user -->|"uses"| node_browser
node_browser -->|"requests page"| node_dashboard_page
node_dashboard_page -.->|"loads interface"| node_dashboard_ui
node_dashboard_ui -->|"requests analysis"| node_flask_api
node_flask_api -->|"fetches segments"| node_heatmap
node_flask_api -->|"fetches metadata"| node_video_info
node_youtube -->|"provides replay data"| node_heatmap
node_youtube -->|"provides video details"| node_video_info
node_video_info -->|"queries metadata"| node_yt_dlp
node_heatmap -->|"returns candidates"| node_segment_selection
node_video_info -->|"displays details"| node_segment_selection
node_user -->|"selects clips"| node_segment_selection
node_dashboard_ui -->|"starts job"| node_flask_api
node_flask_api -->|"starts worker"| node_job_runner
node_job_runner -->|"runs process"| node_cli
node_job_runner -->|"writes progress"| node_job_logs
node_flask_api -->|"streams progress"| node_job_logs
node_dashboard_ui -->|"opens event stream"| node_flask_api
node_cli -.->|"processes URL"| node_video_download
node_video_download -->|"downloads video"| node_yt_dlp
node_youtube -->|"supplies video"| node_video_download
node_video_download -.->|"feeds source video"| node_clip_extraction
node_segment_selection -.->|"supplies time ranges"| node_clip_extraction
node_clip_extraction -.->|"prepares clip"| node_vertical_crop
node_vertical_crop -.->|"renders crop"| node_ffmpeg
node_clip_extraction -.->|"provides audio"| node_transcription
node_transcription -->|"transcribes speech"| node_whisper
node_transcription -->|"creates subtitles"| node_subtitle_render
node_subtitle_render -->|"burns subtitles"| node_ffmpeg
node_vertical_crop -.->|"produces clips"| node_clips
node_subtitle_render -.->|"saves rendered clips"| node_clips
node_clips -->|"provides results"| node_user

click node_dashboard_ui "https://github.com/skydashnet/clipper/blob/main/static/app.js"
click node_dashboard_page "https://github.com/skydashnet/clipper/blob/main/templates/index.html"
click node_flask_api "https://github.com/skydashnet/clipper/blob/main/app.py"
click node_job_runner "https://github.com/skydashnet/clipper/blob/main/app.py"
click node_job_logs "https://github.com/skydashnet/clipper/blob/main/app.py"
click node_heatmap "https://github.com/skydashnet/clipper/blob/main/run.py"
click node_video_info "https://github.com/skydashnet/clipper/blob/main/app.py"
click node_segment_selection "https://github.com/skydashnet/clipper/blob/main/static/app.js"
click node_video_download "https://github.com/skydashnet/clipper/blob/main/run.py"
click node_clip_extraction "https://github.com/skydashnet/clipper/blob/main/run.py"
click node_vertical_crop "https://github.com/skydashnet/clipper/blob/main/run.py"
click node_transcription "https://github.com/skydashnet/clipper/blob/main/run.py"
click node_subtitle_render "https://github.com/skydashnet/clipper/blob/main/run.py"
click node_cli "https://github.com/skydashnet/clipper/blob/main/run.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_dashboard_ui,node_dashboard_page,node_flask_api,node_job_runner,node_job_logs,node_user,node_browser toneBlue
class node_heatmap,node_video_info,node_segment_selection toneAmber
class node_video_download,node_clip_extraction,node_vertical_crop toneMint
class node_transcription,node_subtitle_render toneRose
class node_youtube,node_yt_dlp,node_whisper,node_ffmpeg,node_clips toneIndigo
class node_cli toneTeal
```

## Components

### Dashboard

- [Dashboard UI](https://github.com/skydashnet/clipper/blob/main/static/app.js): `static/app.js`
- [Dashboard Page](https://github.com/skydashnet/clipper/blob/main/templates/index.html): `templates/index.html`
- [Flask API](https://github.com/skydashnet/clipper/blob/main/app.py): `app.py`
- [Background Job Runner](https://github.com/skydashnet/clipper/blob/main/app.py): `app.py`
- [Job Logs](https://github.com/skydashnet/clipper/blob/main/app.py): `app.py`

### Video Analysis

- [Heatmap Detection](https://github.com/skydashnet/clipper/blob/main/run.py): `run.py`
- [Video Metadata](https://github.com/skydashnet/clipper/blob/main/app.py): `app.py`
- [Segment Selection](https://github.com/skydashnet/clipper/blob/main/static/app.js): `static/app.js`

### Clip Processing

- [Video Download](https://github.com/skydashnet/clipper/blob/main/run.py): `run.py`
- [Clip Extraction](https://github.com/skydashnet/clipper/blob/main/run.py): `run.py`
- [Vertical Crop](https://github.com/skydashnet/clipper/blob/main/run.py): `run.py`

### Rendering and Output

- [Speech Transcription](https://github.com/skydashnet/clipper/blob/main/run.py): `run.py`
- [Subtitle Rendering](https://github.com/skydashnet/clipper/blob/main/run.py): `run.py`

### Other components

- **User**
- **Web Browser**
- **YouTube**
- **yt-dlp**
- **Faster-Whisper**
- **FFmpeg**
- **Generated Clips**
- [Command Line](https://github.com/skydashnet/clipper/blob/main/run.py): `run.py`

## Connections

- User → Web Browser: uses (evidence: `README.md`)
- Web Browser → Dashboard Page: requests page
- Dashboard Page → Dashboard UI: loads interface
- Dashboard UI → Flask API: requests analysis (evidence: `static/app.js`)
- Flask API → Heatmap Detection: fetches segments (evidence: `app.py`)
- Flask API → Video Metadata: fetches metadata (evidence: `app.py`)
- YouTube → Heatmap Detection: provides replay data (evidence: `run.py`)
- YouTube → Video Metadata: provides video details (evidence: `app.py`)
- Video Metadata → yt-dlp: queries metadata (evidence: `app.py`)
- Heatmap Detection → Segment Selection: returns candidates (evidence: `static/app.js`)
- Video Metadata → Segment Selection: displays details (evidence: `static/app.js`)
- User → Segment Selection: selects clips (evidence: `README.md`)
- Dashboard UI → Flask API: starts job (evidence: `static/app.js`)
- Flask API → Background Job Runner: starts worker (evidence: `app.py`)
- Background Job Runner → Command Line: runs process (evidence: `app.py`)
- Background Job Runner → Job Logs: writes progress (evidence: `app.py`)
- Flask API → Job Logs: streams progress (evidence: `app.py`)
- Dashboard UI → Flask API: opens event stream (evidence: `static/app.js`)
- Command Line → Video Download: processes URL (evidence: `run.py`)
- Video Download → yt-dlp: downloads video (evidence: `run.py`)
- YouTube → Video Download: supplies video (evidence: `README.md`)
- Video Download → Clip Extraction: feeds source video (evidence: `run.py`)
- Segment Selection → Clip Extraction: supplies time ranges
- Clip Extraction → Vertical Crop: prepares clip (evidence: `run.py`)
- Vertical Crop → FFmpeg: renders crop
- Clip Extraction → Speech Transcription: provides audio (evidence: `run.py`)
- Speech Transcription → Faster-Whisper: transcribes speech (evidence: `run.py`)
- Speech Transcription → Subtitle Rendering: creates subtitles (evidence: `run.py`)
- Subtitle Rendering → FFmpeg: burns subtitles (evidence: `run.py`)
- Vertical Crop → Generated Clips: produces clips
- Subtitle Rendering → Generated Clips: saves rendered clips
- Generated Clips → User: provides results (evidence: `README.md`)
