editor
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseThe CLI is self-describing and ships its own API reference. Use , , and to enumerate every command, argument, and option, and treat live help as authoritative rather than working from memory.
dapi --helpdapi <group> --helpdapi <group> <command> --help该CLI工具自带说明文档和API参考。使用、以及来查看所有命令、参数和选项,并且应以实时帮助信息为准,而非凭记忆操作。
dapi --helpdapi <group> --helpdapi <group> <command> --helpFootage analysis
素材分析
How to understand source material before editing it. Inspect only the modalities the decision turns on — speech, action, music, graphics, or atmosphere may lead, so there is no fixed priority. Sample the picture against what the audio tells you.
- Always probe first. reports the container and its tracks, telling you up front whether the file has a video track, an audio track, or both. Everything after branches on that.
dapi media probe <id|path> - Get the lay of the land. Render a (audio) and a
dapi media waveform(video) for a fast, cheap overview of where the loud and quiet stretches fall, and where the visual scene changes are. A filmstrip shows coarse structure and scene state, not crop, framing, readability, or an exact cut frame.dapi media filmstrip - Listen to the audio. Run with a prompt tailored to the context (what you actually need to know), and explicitly ask the model to include timestamps in its answer. See media-listen.md for prompt patterns.
dapi media listen - Transcribe speech. For speech, prints the full transcript with word-level start/end times directly — read any segment straight from it.
dapi media transcribe - Sample the video against the audio. Use to pull frames. When the audio has already pointed you at specific moments, feed those timestamps straight in from the transcript or listen output, e.g.
dapi media grab. When you need a visual pass without such cues, reach for-t '00:32' '00:45' ...: it scans the footage and keeps only the frames where the picture settles into a new visual state, dropping near-duplicates.--auto
如何在编辑前理解原始素材。只需检查影响决策的模态因素——语音、动作、音乐、图形或氛围都可能是关键,因此没有固定的优先级。结合音频信息来采样画面。
- 始终先探测。 会报告容器及其轨道,提前告知你文件是否包含视频轨道、音频轨道,或是两者都有。后续所有操作都以此为基础展开。
dapi media probe <id|path> - 整体概览。 生成(音频波形)和
dapi media waveform(视频胶片条),快速低成本地了解音频的高低音段落分布,以及视觉场景的变化位置。胶片条展示的是大致结构和场景状态,而非裁剪、构图、可读性或精确的剪辑帧。dapi media filmstrip - 分析音频内容。 结合上下文(你实际需要了解的信息)编写提示词,运行,并明确要求模型在回答中包含时间戳。提示词模板可参考media-listen.md。
dapi media listen - 语音转写。 针对语音内容,会直接输出包含单词级起止时间的完整转录文本——你可以直接从中读取任意片段。
dapi media transcribe - 结合音频采样视频。 使用提取帧。当音频已经指向特定时刻时,直接从转录文本或listen命令的输出中传入这些时间戳,例如
dapi media grab。当没有此类线索需要视觉遍历素材时,使用-t '00:32' '00:45' ...参数:它会扫描素材,只保留画面进入新视觉状态的帧,剔除近似重复的帧。--auto
Editing workflow
编辑工作流
- Write the brief first. For anything nontrivial, capture the edit as a markdown file: it is the plan every mount works toward and the thing to check the result against.
- Lay down the A-roll. Assemble the primary footage as JSX and it. Get the spine of the edit right before anything else.
dapi mount - Layer the rest on top. Once the A-roll holds, add B-roll and secondary assets (sound effects, captions, overlays) with further mounts or .
dapi node insert
- 先撰写编辑概要。对于任何非简单任务,将编辑方案记录为Markdown文件:这是所有挂载操作的目标,也是检查最终结果的依据。
- 搭建主素材轨道(A-roll)。将主要素材组装为JSX并使用挂载。先确保编辑的核心框架正确,再进行其他操作。
dapi mount - 叠加其余内容。A-roll确定后,通过更多挂载操作或添加副素材轨道(B-roll)和次要资源(音效、字幕、叠加层)。
dapi node insert
Compositing
合成
- Chrome, scaffolding, and ornament all draw from a visual budget whose default balance is ; prefer not to use them. A cut, hold, or change of size can separate two ideas as clearly as a divider without adding visual clutter. An element earns its place by deepening the story, guiding attention, or expanding imagination, never by filling space.
0 - Video is its own medium, with its own rules; it is not a website, poster, slide, or UI. It is watched, not read.
- Let visuals, sound, and voice carry context; let text punctuate rather than explain. Do not add copy, eyebrows, labels, underlines, or brand color highlights unless the brief or explicit video guidance calls for them; examples alone are not instructions.
- Choose easing from the intended weight, energy, and continuity of the action.
- 边框、框架和装饰元素都占用视觉预算,默认平衡值为;建议尽量避免使用。剪辑、定格或尺寸变化可以像分隔符一样清晰区分两个想法,且不会增加视觉杂乱。元素的存在价值在于深化故事、引导注意力或拓展想象空间,而非填充空白。
0 - 视频是独立的媒介,有其自身规则;它不是网站、海报、幻灯片或UI界面。视频是用来观看的,而非阅读。
- 让视觉、声音和旁白传递背景信息;让文本起到强调作用而非解释说明。除非编辑概要或明确的视频指导要求,否则不要添加文案、眉栏、标签、下划线或品牌色高亮;示例本身不构成指令。
- 根据动作的预期权重、能量和连贯性选择缓动效果。
Verification
验证
How to confirm a change actually produced what you intended. A clean or does not guarantee a correct-looking composition.
mountinsert- Use to see what the viewer actually gets.
dapi node capture - Reconcile captured frames with the brief, and the brief with these guidelines.
- Verify after every stage, not only at the end — build the composition incrementally so a problem is caught next to the change that caused it.
- Scale verification to the change. A small or incremental tweak the user asked for needs no visual confirmation so the user gets the result back fast and can keep iterating.
- Fix the largest viewer-facing problem before polishing details, and recheck related moments after structural changes, since pacing, continuity, emphasis, and meaning are relational.
- Use or
screenshotto debug issues.logs - DO NOT export/render the scene for visual confirmation — is equivalent to a render but far more efficient. Rendering to a video should be a user-triggered action unless explicitly requested in the prompt.
dapi node capture
如何确认修改确实达到了预期效果。顺利完成或操作并不保证合成效果正确。
mountinsert- 使用查看观众实际看到的内容。
dapi node capture - 将捕获的帧与编辑概要核对,同时确保编辑概要符合这些准则。
- 在每个阶段后都进行验证,而非仅在最后——逐步构建合成内容,以便在问题出现时就能定位到导致问题的修改操作。
- 根据修改规模调整验证方式。对于用户要求的小幅度或增量调整,无需视觉确认,这样用户可以快速获得结果并继续迭代。
- 在打磨细节前先解决最影响观众体验的问题,结构调整后重新检查相关片段,因为节奏、连贯性、重点和含义都是相互关联的。
- 使用或
screenshot命令调试问题。logs - 不要为了视觉确认而导出/渲染场景——与渲染效果等效,但效率高得多。除非提示中明确要求,否则渲染视频应该是用户触发的操作。
dapi node capture
Best practices
最佳实践
- Wrap entities in tags wherever the parent tag supports it — A-roll, B-roll, and other clips belong in sequences so the timeline stays structured rather than a flat, messy pile. (
<sequence>does not support sequences.)<html> - Use the built-in tags for the media a composition is made of (audio, video, images, captions).
- For anything 3D, use Three.js drawn into a tag.
<surface> - For motion graphics, overlays and UI-heavy graphics, use the tag.
<html> - Add auto captions last, after everything else is assembled, so they transcribe the finished audio at its final placement.
- Open the application in the background for tasks that don't require an editing UI.
- Only render (export) the result when prompted.
- Start with a fresh project.
- 只要父标签支持,就将内容包裹在标签中——主素材轨道、副素材轨道和其他剪辑都应放在序列中,这样时间线会保持结构化,而非杂乱无章的扁平堆叠。(
<sequence>标签不支持序列。)<html> - 使用合成内容所用媒体对应的内置标签(音频、视频、图像、字幕)。
- 对于3D内容,使用Three.js绘制到标签中。
<surface> - 对于动态图形、叠加层和UI密集型图形,使用标签。
<html> - 在所有内容组装完成后再添加自动字幕,这样字幕会根据最终位置的成品音频进行转写。
- 对于不需要编辑UI的任务,在后台运行应用程序。
- 仅在用户提示时才渲染(导出)结果。
- 从全新项目开始。
Docs
文档
- Installation guide, read when dapi is unavailable
- An API reference for the JSX syntax
- 安装指南,当dapi无法使用时阅读
- JSX语法的API参考
Examples
示例
Read worked example(s) that match your context.
阅读与你的场景匹配的实践示例。
Video editing
视频编辑
- Long-form talking head
- Podcast clipping
- 长镜头访谈
- 播客剪辑
Prompts
提示词
- Writing prompts for
dapi media listen
- 为编写提示词
dapi media listen
JSX
JSX
- Basics on how to structure a composition
- Driving values from composition time with
useTicker - Animating with an anime.js timeline
- Using an element as the scene root
<html> - Embedding an overlay inside a canvas scene
<html> - Applying a WGSL shader to a video with shader paint
- Rendering a custom WebGPU pass into a
<canvas> - Rendering a Three.js scene into a
<canvas> - Generating images and video with
generate
- 合成内容的基础结构
- 使用根据合成时间驱动数值
useTicker - 使用anime.js时间轴制作动画
- 使用元素作为场景根节点
<html> - 在Canvas场景中嵌入叠加层
<html> - 使用着色器绘制将WGSL着色器应用于视频
- 将自定义WebGPU通道渲染到中
<canvas> - 将Three.js场景渲染到中
<canvas> - 使用生成图像和视频
generate