Automated pipeline for preparing YouTube metadata from finished videos and blog articles. Generates titles, descriptions, tags, timestamps, and SRT subtitles in both English and Russian.
video-metadata is stage 3 of an automated pipeline that turns a blog article into a published YouTube video — no API keys, driven end-to-end through logged-in browser sessions (Camoufox) and local media tooling.
| # | Stage | Repo | What it does |
|---|---|---|---|
| 1 | Generate | gaia | Drive NotebookLM / Gemini / Flow from a logged-in session → audio overview + slide deck |
| 2 | Build | video-maker | Audio narration + slide-deck PDF → synced MP4 (+ SRT, thumbnail) |
| 3 | Describe | video-metadata ⬅ this repo | Video + article → YouTube title / description / tags / chapter timestamps |
| 4 | Publish | video-publisher | Drive YouTube Studio → upload with metadata, channel switch, visibility |
Flow: article → gaia → video-maker → video-metadata → video-publisher → YouTube
(the published video is then embedded back into the blog article).
Given a finished video file and a corresponding blog article slug, the pipeline:
- Extracts audio from the video using FFmpeg
- Transcribes speech to text using OpenAI Whisper
- Generates SRT subtitles for YouTube upload
- Builds chapter timestamps by matching article section headings to transcription segments
- Researches YouTube tags from article content (headings, key phrases, frontmatter tags)
- Generates metadata (title, description, tags, timestamps) in both EN and RU — as JSON and human-readable TXT
- Python 3.9+
- FFmpeg installed and available in
PATH - OpenAI Whisper (
pip install openai-whisper) - yt-dlp (optional, for tag research via YouTube search)
pip install openai-whispervideo-metadata/
├── scripts/
│ ├── prepare_metadata.py # Main pipeline script
│ └── run.sh # Batch runner for multiple videos
├── input/ # Place source video files here
├── output/ # Generated metadata, SRT files
└── temp/ # Intermediate files (audio, subtitles JSON)
python scripts/prepare_metadata.py \
--video input/my_video.mp4 \
--slug my-blog-article-slug \
--output-dir output/my-blog-article-slug \
--whisper-model baseEdit the VIDEO_MAP in scripts/run.sh to define video-to-slug mappings, then:
bash scripts/run.sh| Option | Description | Default |
|---|---|---|
--video |
Path to input video file | required |
--slug |
Blog article slug (used to find .en.md / .ru.md articles) |
required |
--output-dir |
Directory for output files | required |
--temp-dir |
Directory for intermediate files | temp/<slug> |
--whisper-model |
Whisper model size (tiny, base, small, medium, large) |
base |
--skip-transcribe |
Reuse existing subtitles.json from temp dir |
false |
For each video, the pipeline generates:
| File | Description |
|---|---|
<slug>.srt |
YouTube-ready SRT subtitles |
<slug>_metadata.json |
Structured EN metadata (title, description, tags, timestamps) |
<slug>_metadata.txt |
Human-readable EN metadata for copy-paste into YouTube Studio |
<slug>_ru_metadata.json |
Structured RU metadata |
<slug>_ru_metadata.txt |
Human-readable RU metadata |
Instead of fixed-interval timestamps, the tool matches blog article section headings against Whisper transcription segments using word overlap + bigram scoring. This produces accurate chapter markers that correspond to actual topic transitions in the video.
Tags are extracted directly from article content:
- Section headings split at separators (parentheses, colons, dashes)
- Key phrases from the article description (2-3 word meaningful combinations)
- Frontmatter tags and their pairwise combinations
- Brand tags (
marketmaker,marketmaker_cc) are always appended
The tool expects blog articles in Markdown with YAML frontmatter at a configurable path (default: ../../marketmaker-cc-landing/src/content/blog/). Articles should have title, description, and tags fields, plus section headings (##) in the body.
- gaia — generates the audio + slides upstream
- video-maker — generates the video itself from audio + PDF slides
- video-publisher — uploads the video (with this metadata) to YouTube
MIT
