# udaysrinu/viral-video-analyzer architecture

> Architecture diagram of the GitHub repository udaysrinu/viral-video-analyzer, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/udaysrinu/viral-video-analyzer
- Repository: https://github.com/udaysrinu/viral-video-analyzer

## Overview

Viral Video Analyzer is a local command-line pipeline for turning a video URL into material for human or LLM pattern analysis. The user supplies a URL and options; the script downloads the video and metadata, extracts frames and—unless skipped—audio and a timestamped transcript, then writes a summary template. The README also documents supported platforms and optional transcription. Components are concentrated in one script; the graph reflects its explicit calls and outputs, not an assumed downstream analysis service.

Main entry points: [`analyze_viral_video.py`](https://github.com/udaysrinu/viral-video-analyzer/blob/master/analyze_viral_video.py) (CLI workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Download"]
  node_cli["CLI workflow"]
  node_downloader["Video download"]
  node_video["Downloaded video"]
  node_metadata["Video metadata"]
end

subgraph group_processing["Media Processing"]
  node_keyframes["Keyframe extraction"]
  node_audio["Audio extraction"]
  node_whisper_transcription["Whisper transcription"]
end

subgraph group_outputs["Analysis Artifacts"]
  node_frames["JPEG frames"]
  node_transcripts["Transcript and SRT"]
  node_summary["Summary template"]
end

node_creator(("Creator or agent"))
node_ytdlp["yt-dlp"]
node_ffmpeg["ffmpeg"]
node_whisper["OpenAI Whisper"]
node_llm(("External LLM"))

node_creator -->|"provides URL"| node_cli
node_cli -->|"calls"| node_downloader
node_downloader -->|"downloads video"| node_ytdlp
node_ytdlp -->|"writes video"| node_video
node_ytdlp -->|"writes metadata"| node_metadata
node_downloader -->|"returns metadata"| node_cli
node_cli -->|"calls"| node_keyframes
node_keyframes -->|"runs"| node_ffmpeg
node_keyframes -->|"writes frames"| node_frames
node_cli -->|"calls unless skipped"| node_audio
node_audio -->|"runs"| node_ffmpeg
node_cli -->|"calls if audio exists"| node_whisper_transcription
node_whisper_transcription -->|"transcribes audio"| node_whisper
node_whisper_transcription -->|"writes text and SRT"| node_transcripts
node_cli -->|"writes template"| node_summary
node_metadata -->|"supplies fields"| node_summary
node_frames -.->|"analyzed externally"| node_llm
node_transcripts -.->|"analyzed externally"| node_llm

click node_cli "https://github.com/udaysrinu/viral-video-analyzer/blob/master/analyze_viral_video.py"
click node_downloader "https://github.com/udaysrinu/viral-video-analyzer/blob/master/analyze_viral_video.py"
click node_video "https://github.com/udaysrinu/viral-video-analyzer/blob/master/analyze_viral_video.py"
click node_metadata "https://github.com/udaysrinu/viral-video-analyzer/blob/master/analyze_viral_video.py"
click node_keyframes "https://github.com/udaysrinu/viral-video-analyzer/blob/master/analyze_viral_video.py"
click node_audio "https://github.com/udaysrinu/viral-video-analyzer/blob/master/analyze_viral_video.py"
click node_frames "https://github.com/udaysrinu/viral-video-analyzer/blob/master/analyze_viral_video.py"
click node_whisper_transcription "https://github.com/udaysrinu/viral-video-analyzer/blob/master/analyze_viral_video.py"
click node_transcripts "https://github.com/udaysrinu/viral-video-analyzer/blob/master/analyze_viral_video.py"
click node_summary "https://github.com/udaysrinu/viral-video-analyzer/blob/master/analyze_viral_video.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_cli,node_downloader,node_video,node_metadata toneBlue
class node_keyframes,node_audio,node_whisper_transcription toneAmber
class node_frames,node_transcripts,node_summary toneMint
class node_creator,node_ytdlp,node_ffmpeg,node_whisper,node_llm toneIndigo
```

## Components

### Download

- [CLI workflow](https://github.com/udaysrinu/viral-video-analyzer/blob/master/analyze_viral_video.py): `analyze_viral_video.py`
- [Video download](https://github.com/udaysrinu/viral-video-analyzer/blob/master/analyze_viral_video.py): `analyze_viral_video.py`
- [Downloaded video](https://github.com/udaysrinu/viral-video-analyzer/blob/master/analyze_viral_video.py): `analyze_viral_video.py`
- [Video metadata](https://github.com/udaysrinu/viral-video-analyzer/blob/master/analyze_viral_video.py): `analyze_viral_video.py`

### Media Processing

- [Keyframe extraction](https://github.com/udaysrinu/viral-video-analyzer/blob/master/analyze_viral_video.py): `analyze_viral_video.py`
- [Audio extraction](https://github.com/udaysrinu/viral-video-analyzer/blob/master/analyze_viral_video.py): `analyze_viral_video.py`
- [Whisper transcription](https://github.com/udaysrinu/viral-video-analyzer/blob/master/analyze_viral_video.py): `analyze_viral_video.py`

### Analysis Artifacts

- [JPEG frames](https://github.com/udaysrinu/viral-video-analyzer/blob/master/analyze_viral_video.py): `analyze_viral_video.py`
- [Transcript and SRT](https://github.com/udaysrinu/viral-video-analyzer/blob/master/analyze_viral_video.py): `analyze_viral_video.py`
- [Summary template](https://github.com/udaysrinu/viral-video-analyzer/blob/master/analyze_viral_video.py): `analyze_viral_video.py`

### Other components

- **Creator or agent**
- **yt-dlp**
- **ffmpeg**
- **OpenAI Whisper**
- **External LLM**

## Connections

- Creator or agent → CLI workflow: provides URL (evidence: `README.md`)
- CLI workflow → Video download: calls (evidence: `analyze_viral_video.py`)
- Video download → yt-dlp: downloads video (evidence: `analyze_viral_video.py`)
- yt-dlp → Downloaded video: writes video (evidence: `README.md`)
- yt-dlp → Video metadata: writes metadata (evidence: `analyze_viral_video.py`)
- Video download → CLI workflow: returns metadata (evidence: `analyze_viral_video.py`)
- CLI workflow → Keyframe extraction: calls (evidence: `analyze_viral_video.py`)
- Keyframe extraction → ffmpeg: runs (evidence: `analyze_viral_video.py`)
- Keyframe extraction → JPEG frames: writes frames (evidence: `analyze_viral_video.py`)
- CLI workflow → Audio extraction: calls unless skipped (evidence: `analyze_viral_video.py`)
- Audio extraction → ffmpeg: runs (evidence: `analyze_viral_video.py`)
- CLI workflow → Whisper transcription: calls if audio exists (evidence: `analyze_viral_video.py`)
- Whisper transcription → OpenAI Whisper: transcribes audio (evidence: `analyze_viral_video.py`)
- Whisper transcription → Transcript and SRT: writes text and SRT (evidence: `analyze_viral_video.py`)
- CLI workflow → Summary template: writes template (evidence: `analyze_viral_video.py`)
- Video metadata → Summary template: supplies fields (evidence: `analyze_viral_video.py`)
- JPEG frames → External LLM: analyzed externally (evidence: `README.md`)
- Transcript and SRT → External LLM: analyzed externally (evidence: `README.md`)
