Communitygithub.com

delorenj/skills - ASCII 视频制作管线

将视频/音频转换为彩色 ASCII MP4/GIF 图文的工具。

skills - ASCII 视频制作管线 是什么?

该技能提供了一套完整的 ASCII 艺术视频制作管线,支持视频、音频、图像或生成式输入,输出彩色 ASCII 字符视频(MP4、GIF、图像序列)。它涵盖了视频转 ASCII、音频响应式音乐可视化、生成式 ASCII 动画、混合视频+音频响应、文本/歌词叠加以及实时终端渲染等多种模式。管线遵循固定的6阶段架构(输入→分析→场景函数→色调映射→着色→编码),并提供了丰富的可调节审美维度(字符调色板、色彩策略、背景纹理、特效、粒子、着色器情绪等)。它特别强调创造性和美学一致性,要求每个项目都展现出独特的视觉概念和精心设计的场景变化,而非简单的技术堆砌。支持在开发者工具(如 Claude Code)中作为辅助角色使用,帮助用户快速构建高质量的 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
  • 硬件检测 — 自动检测核心/内存,设置质量配置文件。参见 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 步:质量验证

  • 先测试帧:在完整渲染之前,在关键时间戳渲染单帧
  • 亮度检查:所有 ASCII 内容的 canvas.mean() > 8。如果暗,降低 gamma
  • 视觉连贯性:所有场景是否感觉属于同一个视频?
  • 创意愿景检查:输出是否匹配第 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

每场景 gamma:默认 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 广播陷阱、混合模式陷阱、多进程/腌渍、亮度诊断、ffmpeg 问题、字体问题、常见错误

创意发散(仅在用户要求实验性/创意性/独特输出时使用)

如果用户要求创意性、实验性、令人惊讶或非常规的输出,选择最适合的策略,并在生成代码之前推理其步骤。

  • 强制连接 — 当用户需要跨领域灵感时(“让它看起来有机”,“工业美学”)
  • 概念融合 — 当用户命名两个事物进行组合时(“海洋遇见音乐”,“空间 + 书法”)
  • 迂回策略 — 当用户最大程度开放时(“让我惊喜”,“我从未见过的东西”)

强制连接

  1. 选择一个与视觉目标无关的领域(天气系统、微生物学、建筑学、流体动力学、纺织编织)
  2. 列出其核心视觉/结构元素(侵蚀 → 逐渐揭示;有丝分裂 → 分裂复制;编织 → 互锁图案)
  3. 将这些元素映射到 ASCII 字符和动画模式上
  4. 综合——“侵蚀”或“结晶”在字符网格中看起来像什么?

概念融合

  1. 命名两个不同/的视觉

…

[为翻译而截断]

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.

相关技能