Communitygithub.com

delorenj/skills

將影片/音訊轉換為彩色 ASCII 藝術的 MP4/GIF。

skills 是什麼?

這是一個完整的 ASCII 藝術影片生產管線技能,支援將影片、音訊、圖片或生成式輸入轉換為高品質的彩色 ASCII 字元影片(MP4、GIF、圖片序列)。它涵蓋六種主要模式:影片轉 ASCII、音訊反應式視覺化、生成式動畫、混合影片+音訊、歌詞/字幕疊加,以及 TTS 旁白影片。該技能強調創意卓越,要求每個專案都具備獨特的視覺概念,而非僅僅進行技術轉換。它採用 6 階段的管線架構:輸入、分析、場景函式、色調映射、著色器處理和編碼,並包含豐富的參考文件(架構、合成、效果、著色器、場景、輸入、最佳化、疑難排解),以實現電影級 ASCII 藝術。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/delorenj/skills/tree/HEAD/ascii-video

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

ASCII 影片生產管線

使用時機

當使用者要求:ASCII 影片、文字藝術影片、終端機風格影片、字元藝術動畫、復古文字視覺化、ASCII 音訊視覺化、將影片轉換為 ASCII 藝術、矩陣風格效果,或任何動態 ASCII 輸出時使用。

內容包含

ASCII 藝術影片的生產管線 — 支援任何格式。將影片/音訊/圖片/生成式輸入轉換為彩色 ASCII 字元影片輸出(MP4、GIF、圖片序列)。涵蓋:影片轉 ASCII 轉換、音訊反應式音樂視覺化、生成式 ASCII 藝術動畫、混合式影片+音訊反應、文字/歌詞疊加、即時終端機渲染。

創意標準

這是視覺藝術。ASCII 字元是媒介;電影是標準。

在撰寫任何一行程式碼之前,請先闡明創意概念。氛圍是什麼?這個影片講述了什麼視覺故事?是什麼讓這個專案與其他每個 ASCII 影片不同?使用者的提示只是一個起點 — 請以創意的野心來詮釋,而不是逐字翻譯。

首次渲染的卓越品質是無可妥協的。 輸出必須視覺上引人注目,無需進行修改回合。如果某些東西看起來很普通、平淡,或像是「AI 生成的 ASCII 藝術」,那它就是錯的 — 在交付之前重新思考創意概念。

超越參考詞彙。 參考資料中的效果目錄、著色器預設和調色盤庫只是一個起點詞彙。對於每個專案,都要結合、修改並發明新的模式。目錄是一盤顏料 — 你來創作畫作。

主動發揮創意。 當專案需要時,擴展技能的詞彙庫。如果參考資料沒有你願景所需的東西,就建立它。至少包含一個使用者沒有要求但會欣賞的視覺時刻 — 一個轉場、一個效果、一個能提升整體作品的色彩選擇。

統一美學優先於技術正確。 影片中的所有場景必須感覺由統一的視覺語言連結 — 共享的色溫、相關的字元調色盤、一致的運動詞彙。一個技術上正確但每個場景都隨機使用不同效果的影片,在美學上是失敗的。

密集、分層、深思熟慮。 每個影格都值得仔細觀看。永遠不要使用平坦的黑色背景。始終使用多網格構圖。始終按場景變化。始終使用有意的色彩。

模式

模式輸入輸出參考資料
影片轉 ASCII影片檔案來源素材的 ASCII 重現references/inputs.md § 影片取樣
音訊反應式音訊檔案由音訊特徵驅動的生成式視覺效果references/inputs.md § 音訊分析
生成式無(或種子參數)程序化 ASCII 動畫references/effects.md
混合式影片 + 音訊帶有音訊反應式疊加的 ASCII 影片兩個輸入參考資料
歌詞/文字音訊 + 文字/SRT帶有視覺效果的計時文字references/inputs.md § 文字/歌詞
TTS 旁白文字引言 + TTS API帶有打字文字效果的旁白見證/引言影片references/inputs.md § TTS 整合

技術堆疊

每個專案一個獨立的 Python 腳本。無需 GPU。

層工具用途
核心Python 3.10+, NumPy數學、陣列運算、向量化效果
訊號SciPyFFT、峰值檢測(音訊模式)
影像Pillow (PIL)字型光柵化、影格解碼、圖片 I/O
影片 I/Offmpeg (CLI)解碼輸入、編碼輸出、多工音訊
並行concurrent.futures用於批次/片段渲染的 N 個工作者
TTSElevenLabs API (可選)生成旁白片段
可選OpenCV影片影格取樣、邊緣檢測

管線架構

每種模式都遵循相同的 6 階段管線:

輸入 → 分析 → 場景函式 → 色調映射 → 著色 → 編碼
  1. 輸入 — 載入/解碼來源素材(影片影格、音訊樣本、圖片或無)
  2. 分析 — 提取每個影格的特徵(音訊頻帶、影片亮度/邊緣、運動向量)
  3. 場景函式 — 場景函式渲染到像素畫布 (uint8 H,W,3)。透過 _render_vf() + 像素混合模式組合多個字元網格。請參閱 references/composition.md
  4. 色調映射 — 基於百分位數的自適應亮度歸一化。請參閱 references/composition.md § 自適應色調映射
  5. 著色 — 透過 ShaderChain + FeedbackBuffer 進行後處理。請參閱 references/shaders.md
  6. 編碼 — 將原始 RGB 影格透過管道傳遞給 ffmpeg 以進行 H.264/GIF 編碼

創意方向

美學維度

維度選項參考資料
字元調色盤密度漸層、區塊元素、符號、腳本(片假名、希臘文、符文、點字)、專案專用architecture.md § 調色盤
色彩策略HSV、OKLAB/OKLCH、離散 RGB 調色盤、自動生成和諧、單色、色溫architecture.md § 色彩系統
背景紋理正弦場、fBM 雜訊、域扭曲、沃羅諾伊、反應擴散、細胞自動機、影片effects.md
主要效果環形、螺旋、隧道、漩渦、波浪、干涉、極光、火焰、SDF、奇怪吸引子effects.md
粒子火花、雪、雨、氣泡、符文、軌道、群體行為、流場跟隨者、軌跡effects.md § 粒子
著色器氛圍復古 CRT、簡潔現代、故障藝術、電影感、夢幻、工業、迷幻shaders.md
網格密度xs(8px) 到 xxl(40px), 每層混合architecture.md § 網格系統
座標空間笛卡爾、極座標、平鋪、旋轉、魚眼、莫比烏斯、域扭曲effects.md § 變換
回饋縮放隧道、彩虹軌跡、幽靈迴聲、旋轉曼陀羅、色彩演化composition.md § 回饋
遮罩圓形、環形、漸層、文字模板、動態光圈/擦除/溶解composition.md § 遮罩
轉場交叉淡入淡出、擦除、溶解、故障剪切、光圈、基於遮罩的揭示shaders.md § 轉場

按區段變化

永遠不要對整個影片使用相同的設定。對於每個章節/場景:

  • 不同的背景效果(或組合 2-3 種)
  • 不同的字元調色盤(配合氛圍)
  • 不同的色彩策略(或至少不同的色調)
  • 變化著色器強度(高峰期更多綻放,寧靜期更多顆粒)
  • 如果粒子活躍,使用不同粒子類型

專案專用發明

對於每個專案,至少發明以下其中之一:

  • 符合主題的自訂字元調色盤
  • 自訂背景效果(組合/修改現有構建模組)
  • 自訂色彩調色盤(符合品牌/氛圍的離散 RGB 集合)
  • 自訂粒子字元集
  • 新穎的場景轉場或視覺時刻

不要只是從目錄中挑選。目錄是詞彙 — 你來創作詩篇。

工作流程

步驟 1:創意願景

在任何程式碼之前,闡明創意概念:

  • 氛圍/氣氛:觀眾應該有什麼感受?充滿活力、冥想、混亂、優雅、不祥?
  • 視覺故事:在持續時間內發生了什麼?建立緊張感?轉變?溶解?
  • 色彩世界:暖色/冷色?單色?霓虹色?大地色系?主色調是什麼?
  • 字元紋理:密集資料?稀疏星星?有機點?幾何區塊?
  • 這個專案的不同之處:是什麼讓這個專案獨一無二?
  • 情感弧線:場景如何進展?以能量開場,建立高潮,然後結束?

將使用者的提示對應到美學選擇。一個「放鬆的 Lo-Fi 視覺化」需要的所有東西都與「故障的賽博龐克資料流」不同。

步驟 2:技術設計

  • 模式 — 上述 6 種模式之一
  • 解析度 — 橫向 1920x1080(預設)、直向 1080x1920、方形 1080x1080 @ 24fps
  • 硬體檢測 — 自動檢測核心/RAM,設定品質設定檔。請參閱 references/optimization.md
  • 區段 — 將時間戳記對應到場景函式,每個都有自己的效果/調色盤/色彩/著色器設定
  • 輸出格式 — MP4(預設)、GIF(640x360 @ 15fps)、PNG 序列

步驟 3:建立腳本

單一 Python 檔案。元件(附參考資料):

  1. 硬體檢測 + 品質設定檔 — references/optimization.md
  2. 輸入載入器 — 取決於模式;references/inputs.md
  3. 特徵分析器 — 音訊 FFT、影片亮度或合成
  4. 網格 + 渲染器 — 帶有位元圖快取的多密度網格;references/architecture.md
  5. 字元調色盤 — 每個專案多個;references/architecture.md § 調色盤
  6. 色彩系統 — HSV + 離散 RGB + 和諧生成;references/architecture.md § 色彩
  7. 場景函式 — 每個返回 canvas (uint8 H,W,3);references/scenes.md
  8. 色調映射 — 自適應亮度歸一化;references/composition.md
  9. 著色器管線 — ShaderChain + FeedbackBuffer;references/shaders.md
  10. 場景表 + 調度器 — 時間 → 場景函式 + 設定;references/scenes.md
  11. 並行編碼器 — 使用 ffmpeg 管道的 N 工作者片段渲染
  12. 主程式 — 協調完整管線

步驟 4:品質驗證

  • 先測試影格:在完整渲染之前,先在關鍵時間戳記渲染單個影格
  • 亮度檢查:canvas.mean() > 8 適用於所有 ASCII 內容。如果太暗,降低伽瑪值
  • 視覺連貫性:所有場景感覺像是同一個影片的一部分嗎?
  • 創意願景檢查:輸出是否與步驟 1 的概念匹配?如果看起來很普通,請返回

關鍵實作注意事項

亮度 — 使用 tonemap(),而不是線性乘數

這是 #1 的視覺問題。黑色上的 ASCII 本質上很暗。永遠不要使用 canvas * N 乘數 — 它們會剪裁高光。使用自適應色調映射:

def tonemap(canvas, gamma=0.75):
    f = canvas.astype(np.float32)
    lo, hi = np.percentile(f[::4, ::4], [1, 99.5])
    if hi - lo < 10: hi = lo + 10
    f = np.clip((f - lo) / (hi - lo), 0, 1) ** gamma
    return (f * 255).astype(np.uint8)

管線:scene_fn() → tonemap() → FeedbackBuffer → ShaderChain → ffmpeg

每個場景的伽瑪值:預設 0.75,曝光過度 0.55,海報化 0.50,明亮場景 0.85。對於暗色圖層,使用 screen 混合(而不是 overlay)。

字型儲存格高度

macOS Pillow:textbbox() 返回錯誤高度。使用 font.getmetrics():cell_height = ascent + descent。請參閱 references/troubleshooting.md。

ffmpeg 管道死結

永遠不要在長時間執行的 ffmpeg 中使用 stderr=subprocess.PIPE — 緩衝區在 64KB 時會填滿並死結。重定向到檔案。請參閱 references/troubleshooting.md。

字型相容性

並非所有 Unicode 字元都能在所有字型中渲染。在初始化時驗證調色盤 — 渲染每個字元,檢查是否為空白輸出。請參閱 references/troubleshooting.md。

逐片段架構

對於分段影片(引言、場景、章節),將每個片段渲染為單獨的片段檔案,以實現並行渲染和選擇性重新渲染。請參閱 references/scenes.md。

效能目標

元件預算
特徵提取1-5ms
效果函式2-15ms
字元渲染80-150ms(瓶頸)
著色器管線5-25ms
總計~100-200ms/影格

參考資料

檔案內容
references/architecture.md網格系統、解析度預設、字型選擇、字元調色盤(20+)、色彩系統(HSV + OKLAB + 離散 RGB + 和諧生成)、_render_vf() 輔助函式、GridLayer 類別
references/composition.md像素混合模式(20 種模式)、blend_canvas()、多網格構圖、自適應 tonemap()、FeedbackBuffer、PixelBlendStack、遮罩/模板系統
references/effects.md效果構建模組:值場生成器、色調場、雜訊/fBM/域扭曲、沃羅諾伊、反應擴散、細胞自動機、SDF、奇怪吸引子、粒子系統、座標變換、時間連貫性
references/shaders.mdShaderChain、_apply_shader_step() 調度、38 種著色器目錄、音訊反應式縮放、轉場、色調預設、輸出格式編碼、終端機渲染
references/scenes.md場景協議、Renderer 類別、SCENES 表、render_clip()、節拍同步剪輯、並行渲染、設計模式(圖層層次、方向弧線、視覺隱喻、構圖技巧)、每個複雜度等級的完整場景範例、場景設計檢查清單
references/inputs.md音訊分析(FFT、頻帶、節拍)、影片取樣、圖片轉換、文字/歌詞、TTS 整合(ElevenLabs、語音指派、音訊混合)
references/optimization.md硬體檢測、品質設定檔、向量化模式、並行渲染、記憶體管理、效能預算
references/troubleshooting.mdNumPy 廣播陷阱、混合模式陷阱、多處理/pickling、亮度診斷、ffmpeg 問題、字型問題、常見錯誤

創意發散(僅在使用者要求實驗性/創意/獨特輸出時使用)

如果使用者要求創意、實驗性、令人驚喜或非傳統的輸出,請選擇最適合的策略,並在生成程式碼之前推導其步驟。

  • 強制連結 — 當使用者想要跨領域靈感時(「讓它看起來有機」、「工業美學」)
  • 概念融合 — 當使用者命名兩個事物要結合時(「海洋遇見音樂」、「太空 + 書法」)
  • 迂迴策略 — 當使用者最大程度開放時(「讓我驚喜」、「我看過的東西」)

強制連結

  1. 選擇一個與視覺目標無關的領域(天氣系統、微生物學、建築學、流體動力學、紡織編織)
  2. 列出其核心視覺/結構元素(侵蝕 → 逐漸揭示;有絲分裂 → 分裂複製;編織 → 互鎖圖案)
  3. 將這些元素映射到 ASCII 字元和動畫模式
  4. 綜合 — 「侵蝕」或「結晶」在字元網格中看起來像什麼?

概念融合

  1. 命名兩個不同的視覺/結構領域
  2. 從每個領域中提取核心屬性(紋理、運動、節奏、張力)
  3. 找到它們重疊或可以融合的點
  4. 建立一個混合概念,保留兩個來源的本質(例如「液體幾何」、「呼吸的機械結構」、「生物構造」)

迂迴策略

從環境、上下文或先前提示(如果有)中提取一條隨機的、帶有限制性的指令,並將其作為設計約束應用。

Individual skills in this repo

This repo contains 14 individual skills — each has its own dedicated page.

delorenj/skills

Plan and generate terminal ASCII animations/screensaver-style output (FPS, refresh rules, loop policy, low-flicker guidance), with a static poster frame and an optional local demo script.

delorenj/skills

Plan, build and quality-check a premium short commercial for a real business (roofing, property, ecommerce, B2B software) using AI-generated footage, code-built motion (HTML/GSAP), selective Three.js and an independent-critic "Gauntlet" loop. Use when asked to make a launch-style / SaaS-style video, business ad, explainer, sample reel or pitch video, or to review and improve one. Encodes motion principles distilled from 28 professional launch films, a quality bar, audio rules and a business-offer playbook.

delorenj/skills

CSS animation adapter patterns for HyperFrames. Use when authoring CSS keyframes, animation-delay based timing, animation-fill-mode, animation-play-state, or CSS-only motion that HyperFrames must seek deterministically during preview and rendering.

delorenj/skills

Generate professional voiceovers using ElevenLabs AI. Use when the user needs to create voiceovers for videos, audio narration, or text-to-speech content. Supports multiple voices with character presets (narrator, salesperson, expert) for natural delivery. Includes single scene regeneration for fine-tuning.

delorenj/skills

HyperFrames CLI dev loop — `npx hyperframes` for scaffolding (init), validation (lint, inspect), preview, render, and environment troubleshooting (doctor, browser, info, upgrade). Use when running any of these commands or troubleshooting the HyperFrames build/render environment. For asset preprocessing commands (`tts`, `transcribe`, `remove-background`), invoke the `hyperframes-media` skill instead.

delorenj/skills

Asset preprocessing for HyperFrames compositions — text-to-speech narration (Kokoro), audio/video transcription (Whisper), and background removal for transparent overlays (u2net). Use when generating voiceover from text, transcribing speech for captions, removing the background from a video or image to use as a transparent overlay, choosing a TTS voice or whisper model, or chaining these (TTS → transcribe → captions). Each command downloads its own model on first run.

delorenj/skills

Install and wire registry blocks and components into HyperFrames compositions. Use when running hyperframes add, installing a block or component, wiring an installed item into index.html, or working with hyperframes.json. Covers the add command, install locations, block sub-composition wiring, component snippet merging, and registry discovery.

delorenj/skills

Create video compositions, animations, title cards, overlays, captions, voiceovers, audio-reactive visuals, and scene transitions in HyperFrames HTML. Use when asked to build any HTML-based video content, add captions or subtitles synced to audio, generate text-to-speech narration, create audio-reactive animation (beat sync, glow, pulse driven by music), add animated text highlighting (marker sweeps, hand-drawn circles, burst lines, scribble, sketchout), or add transitions between scenes (crossfades, wipes, reveals, shader transitions). Covers composition authoring, timing, media, and the full video production workflow. For dev-loop CLI commands (init, lint, inspect, preview, render) see the hyperframes-cli skill; for asset preprocessing commands (tts, transcribe, remove-background) see the hyperframes-media skill.

delorenj/skills

Manim CE animations: 3Blue1Brown math/algo videos.

delorenj/skills

Join a Google Meet or Zoom call as a video meeting agent via PikaStreaming. Trigger: user drops a Google Meet or Zoom link, or asks to join a meeting.

delorenj/skills

Translate an existing Remotion (React-based) video composition into a HyperFrames HTML composition. Use ONLY when the user explicitly asks to port, convert, migrate, translate, or rewrite a Remotion composition as HyperFrames (e.g. "port my Remotion project to HyperFrames"). Do NOT use when (a) authoring a NEW HyperFrames composition (even if A/B-testing a Remotion video); (b) Remotion is mentioned in passing; (c) Remotion code is shared as reference, not for translation; (d) the user wants "the same video as my Remotion one" without explicitly asking to migrate the source — treat as a fresh HyperFrames build. When in doubt, default to the `hyperframes` skill. Detects unsupported patterns (useState, useEffect side effects, async calculateMetadata, third-party React component libraries, `@remotion/lambda`) and recommends the runtime interop escape hatch instead of a lossy translation.

delorenj/skills

Generate speech using the self-hosted voxxy (vox) TTS service at https://vox.delo.sh. Use when the user asks to speak, say, narrate, synthesize speech, clone a voice, create a voice, add or register a voice, pipe TTS, or control voice qualities by description (e.g. "a young woman with a cheerful voice"). Handles HTTP API usage, voice profile management, description-based voice design, cloning, MCP registration, and integration patterns for new platforms.

delorenj/skills

Capture a website and create a HyperFrames video from it. Use when: (1) a user provides a URL and wants a video, (2) someone says "capture this site", "turn this into a video", "make a promo from my site", (3) the user wants a social ad, product tour, or any video based on an existing website, (4) the user shares a link and asks for any kind of video content. Even if the user just pastes a URL — this is the skill to use.

delorenj/skills

YouTube transcripts to summaries, threads, blogs.

相關技能