diff --git a/src/content/posts/why-i-built-a-video-knowledge-base.md b/src/content/posts/why-i-built-a-video-knowledge-base.md new file mode 100644 index 0000000..bd9a249 --- /dev/null +++ b/src/content/posts/why-i-built-a-video-knowledge-base.md @@ -0,0 +1,88 @@ +--- +title: "Why I Built a Video Knowledge Base: Turning Saved Short Videos into Searchable Notes" +description: "Why saving short videos to bookmarks is a dead end, and how I built a local ASR and AI pipeline to convert them into searchable notes with Click-to-Seek video sync." +pubDate: 2024-11-28 +category: case-studies +tags: ["ai", "video-processing", "whisper", "astro", "knowledge-management"] +draft: true +--- + +Like many developers and lifelong learners, I found myself accumulating hundreds of bookmarks across platforms like Bilibili, YouTube, and Douyin. A 60-second video explaining a Transformer concept here, a 2-minute architectural teardown there. + +The bookmark list kept growing, but when I actually needed that one specific explanation six months later, it was impossible to retrieve. + +Saving videos into platform favorites is a dead end. This post explains why I decided to solve this problem by building a dedicated learning portal, how I designed the architecture around local compute, and the lessons learned turning fleeting video content into a permanent, searchable knowledge asset. + +--- + +## 1. Why Video Bookmarks Fail + +Short-form video is currently the fastest medium for breaking information asymmetry. Creators pack high-density insights into 1 to 3 minutes. However, as a long-term knowledge repository, video suffers from three fatal flaws: + +1. **Unsearchable inside the content**: Platform search only indexes video titles and uploader tags. The actual golden nugget spoken at minute 01:15 is completely invisible to search engines. +2. **High review friction**: Reading a 500-word summary takes 30 seconds; watching a video requires 2 to 3 minutes of passive listening, often padded with intro hooks and subscriber calls. +3. **Fragile shelf life**: Links rot, accounts get banned, and videos get taken down without warning. + +To turn passive consumption into actionable learning, I set a clear requirement: **every video I save must be transcribed, summarized into structured bullet points and mindmaps, and made searchable down to the exact second.** + +--- + +## 2. Architecture & Design Principles + +When designing the system, I established four non-negotiable architectural principles based on my existing home infrastructure: + +``` +[ Local Input / Inbox ] + │ + ▼ +[ Local GPU Pipeline ] ────► Silero-VAD + Faster-Whisper (Zero cloud API fees) + │ + ├──────────────────► LLM 6-D Synthesis (TL;DR, Mindmap, Timestamps) + │ + ▼ +[ Decoupled Data Layer ] + ├── src/content/videos/{slug}.md (Frontmatter + Structured Insights) + └── src/data/transcripts/{slug}.json (Millisecond Cues [start, end, text]) + │ + ▼ +[ Astro 5 Static Portal ] ──► Pagefind Client-Side WASM Search (<20ms latency) + │ + ▼ +[ Dual-Track Video Sync ] ──► Official iFrame Embeds or NVENC H.264 on Cloudflare R2 +``` + +### Decouple Summaries from Transcripts +The biggest architectural trap in early prototypes was concatenating timestamped transcripts directly inside the Markdown content body. This caused Markdown files to balloon to thousands of lines, cluttered formatting, and made re-running LLM summaries destructive. + +The fix: keep `src/content/videos/{slug}.md` strictly for high-level synthesis and Frontmatter, while storing millisecond cues in `src/data/transcripts/{slug}.json`. + +### Zero Cloud STT Fees +Rather than paying recurring per-minute charges to cloud transcription APIs, the pipeline runs locally on an NVIDIA RTX 3060 (12GB VRAM). Using `faster-whisper` and `Silero-VAD`, speech is automatically transcribed into clean 3-to-8 second semantic sentences with sub-second timestamps. + +### Never Stream from Residential NAS +Serving video streaming directly from a residential home NAS to public web visitors saturates home broadband upload bandwidth and risks ISP restrictions. Public playback uses a dual-track strategy: official iframe embeds (Bilibili/YouTube) whenever possible, or lightweight NVENC 720p H.264 streams hosted on Cloudflare R2. + +### Sub-20ms Search with Pagefind +Instead of maintaining an always-on search database like Meilisearch or Elasticsearch, the front portal compiles to a pure static Astro site indexed by Pagefind. Search queries run in-browser via WebAssembly, delivering instantaneous Chinese keyword lookups with zero server memory footprint. + +--- + +## 3. What Changed in My Daily Learning Loop + +Replacing passive "saving for later" with an automated ingestion pipeline fundamentally changed how I retain information: + +- **From Hoarding to Searching**: Instead of scrolling through endless favorited lists, I hit `Cmd+K` in the portal, type a keyword like `RAG` or `Agent`, and instantly see matching quotes highlighted in the transcript. +- **Click-to-Seek Precision**: Clicking on any key point jumps the video player directly to that second, bypassing creator filler and replaying only the core explanation. +- **Permanent Ownership**: The knowledge lives in plain text and JSON in a Git repository, completely independent of third-party platforms. + +--- + +## 4. Work With Me + +Building automated knowledge ingestion pipelines, self-hosted AI workflows, and high-performance static portals is part of what I do. + +If your organization has internal training videos, product recordings, or course archives that you need converted into a fast, searchable internal knowledge hub: + +- **WhatsApp**: [Chat directly on WhatsApp](https://wa.me/60127972969) +- **Email**: [me@hoelee.com](mailto:me@hoelee.com?subject=Inquiry%20regarding%20video%20knowledge%20base%20portal) +- **Website**: [hoelee.com](https://hoelee.com) diff --git a/src/content/posts/zh/why-i-built-a-video-knowledge-base.md b/src/content/posts/zh/why-i-built-a-video-knowledge-base.md new file mode 100644 index 0000000..25e0bf4 --- /dev/null +++ b/src/content/posts/zh/why-i-built-a-video-knowledge-base.md @@ -0,0 +1,88 @@ +--- +title: "为什么我要做视频精读知识库:把收藏夹吃灰的短视频变成可检索笔记" +description: "为什么平台收藏夹是学习的死胡同?记录我如何利用本地语音识别与大模型构建视频精读知识库,实现文字点击跳播与毫秒级全文检索。" +pubDate: 2024-11-28 +category: case-studies +tags: ["ai", "video-processing", "whisper", "astro", "knowledge-management"] +draft: true +--- + +和很多持续学习的开发者一样,我的 B站、YouTube 和抖音收藏夹里常年躺着数百个视频。这里有一段 60 秒讲透 Transformer 注意力机制的精华讲解,那里有一段 2 分钟拆解系统架构的实战经验。 + +然而,收藏夹越来越长,真正要在几个月后复习或查证某个具体知识点时,根本找不到。 + +把视频丢进收藏夹,本质上是一种心理安慰。这篇文章记录了我为什么要立项搭建这套视频学习精读网站,如何用本地算力实现自动化转写与提炼,以及把碎片化视频转变为永久数字资产的思考。 + +--- + +## 1. 为什么平台收藏夹是学习的死胡同? + +短视频是目前打破信息差最高效的载体之一。优秀的博主能用 1 到 3 分钟把复杂的概念讲得通俗透彻。但在知识沉淀的维度上,视频载体有三个天然缺陷: + +1. **内容不可检索**:平台搜索只能检索视频标题和标签,讲者在第 1 分 15 秒说的那句核心结论,搜索引擎根本看不见。 +2. **复习摩擦力极高**:扫一眼 500 字的精读总结只需 30 秒,而重新看一段视频需要 2 到 3 分钟被动听讲,中间往往还夹杂着求关注、引流话术与片头片尾。 +3. **内容极易失效**:原帖下架、博主销号或外链失效时常发生,收藏夹瞬间变成灰白色的失效链接列表。 + +要真正把视频内容沉淀为个人知识库,必须满足一个硬性要求:**收藏的视频必须全自动转写为逐字稿、提炼为结构化要点与思维导图,并支持全文毫秒级检索与精确到秒的点击跳播。** + +--- + +## 2. 架构设计与工程取舍 + +在设计这套系统时,我结合现有的家庭基础设施,确立了四项核心原则: + +``` +[ 本地收集视频 / 收件箱 ] + │ + ▼ +[ 本地 GPU 算力流水线 ] ────► Silero-VAD + Faster-Whisper (本地零云端调用费) + │ + ├──────────────────► 大模型 6 维精读提炼 (TL;DR、思维导图、时间戳) + │ + ▼ +[ 严格解耦的数据层 ] + ├── src/content/videos/{slug}.md (元数据 + AI 结构化精读总结) + └── src/data/transcripts/{slug}.json (毫秒级分句逐字稿 [start, end, text]) + │ + ▼ +[ Astro 5 纯静态门户 ] ────► Pagefind 客户端 WASM 离线检索 (<20ms 响应) + │ + ▼ +[ 双轨流媒体分发 ] ────────► 官方 iFrame 嵌入优先 / NVENC 压缩后托管于 Cloudflare R2 +``` + +### 总结正文与时间轴严格分离 +在早期原型设计中,最容易踩的坑是把带时间戳的逐字稿全部硬编码进同一个 Markdown 正文里。这不仅导致 Markdown 文件膨胀到数千行,更致命的是,一旦后续调整 Prompt 想重新跑一遍 AI 总结,就会把人工校对好的时间戳冲掉。 + +规范的做法是:`src/content/videos/{slug}.md` 纯粹存放结构化要点与元数据,而分句时间轴存放于独立的 `src/data/transcripts/{slug}.json` 中。 + +### 本地算力闭环,零云端转写成本 +不用云端按分钟计费的语音转写 API,流水线直接运行在宿主机的 NVIDIA RTX 3060 显卡上。通过 `faster-whisper` 与 `Silero-VAD` 结合,自动切除无声段,并按标点符号聚合成 3 到 8 秒的自然语义分句。 + +### 严禁家庭 NAS 直出公网视频流 +用家里的 NAS 直出公网 Range/206 视频流,一旦遇到爬虫或多人同时访问,家庭宽带的上行带宽会被瞬间打满,甚至触发运营商对于家用宽带 PCDN 的封禁。公网访问采用双轨策略:长青视频优先使用 B站/YouTube 官方嵌入播放器;自存短视频经 NVENC 压缩为 720p H.264 后托管在免流量费的 Cloudflare R2。 + +### 基于 Pagefind 的毫秒级离线搜索 +前台不维护重型的 Meilisearch 或 Elasticsearch 数据库,直接编译为 Astro 静态站点并利用 Pagefind 构建分片索引。读者在浏览器端搜索时,通过 WebAssembly 按需拉取几十 KB 的分片,零服务器内存常驻,中文关键词检索延迟在 20ms 以内。 + +--- + +## 3. 学习闭环带来的实际改变 + +从“盲目收藏”转变为“流水线吞吐”,知识吸收的效率发生了根本改变: + +- **从囤积变为检索**:不再翻看长长的收藏列表。按下 `Cmd+K` 输入技术术语(如 `RAG` 或 `Agent`),直接定位到哪段视频的第几秒讲过这个概念。 +- **Click-to-Seek 精准跳播**:点击精读要点或时间戳徽章,播放器直接跳到关键帧播放,跳过废话,只看核心论点。 +- **永久自主沉淀**:所有笔记与逐字稿均以 Markdown 与 JSON 保存在 Git 仓库中,即便第三方平台删帖,核心知识依然永久归档。 + +--- + +## 4. 业务咨询与合作 + +搭建全自动化知识提取流水线、本地大模型工作流以及高性能静态门户是我擅长的工作。 + +如果你的企业或团队也积累了大量内部培训录屏、会议回放或知识资产,需要将其转化为可检索、支持时间戳精读的企业内部知识库: + +- **WhatsApp 直接沟通**:[点击打开 WhatsApp (012-7972969)](https://wa.me/60127972969) +- **电子邮箱**:[me@hoelee.com](mailto:me@hoelee.com?subject=关于视频知识库与内训检索系统的合作咨询) +- **官方主页**:[hoelee.com](https://hoelee.com)