Communitygithub.com

长视频片段

将开始帧和结束帧图像转换为视频片段,每个场景一个片段。询问用户是需要AI生成的视频片段还是仅使用图像(若仅用图像,则跳过此阶段)。如果选择生成片段,则会查找可用的视频生成工具(MCP、API、本地工具或Higgsfield等浏览器工具),或询问用户指定工具,然后生成片段;或者向用户提供一个文件夹,以及每个场景的详细专业提示词、片段文件名和开始/结束图像名称,让用户自行制作。应在long-video-keyframes之后使用,或当用户要求视频片段、图像转视频提示词或动画场景时使用。

长视频片段 是什么?

长视频工作流的第6阶段。该技能自动将开始帧和结束帧图像转换为每个视频场景对应的视频片段。它首先询问用户是否希望AI生成视频片段,还是仅使用图像(若仅为图像,则跳过此阶段)。若选择生成,它会查找可用的视频生成工具(通过MCP、API密钥、本地工具或Higgsfield等浏览器工具),并生成片段。它支持专业级提示词生成,包括摄像机运动、动作、灯光、风格和负面提示词,并输出结构化文件。若用户选择自行制作,则提供包含所有必要文件、提示词和图像名的完整文件夹。该技能适用于Claude Code等AI agent,作为参考文档使用的技能,不支持实时执行。

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/samanfirouzi/long-video-skill/tree/HEAD/skills/long-video-clips

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

长视频片段 是做什么的?

长视频工作流的第6阶段。输出:每个场景一个视频片段,或决定仅使用图像。

场景指脚本中的一个镜头(一个镜头,最多10秒),按视频全局顺序编号,如long-video-keyframes中所示。

开始前

  1. 在~/.long-video/projects/<slug>/中找到项目。需要状态为approved的video-script.md和film-style.md。
  2. 检查frames/和frame-prompts/index.md。开始帧和结束帧图像是片段的输入。如果缺失,说明情况并提供运行long-video-keyframes的选项。有些工具支持无开始帧的纯文本片段,但结果一致性较差。仅在用户同意后才继续使用这种方式。
  3. 加载项目配置:宽高比、分辨率、片段限制、视频提供商、批准级别、预算。
  4. 如果clips/或clip-prompts/已存在,询问:是继续(列出已完成的内容),还是重新开始。

第1步:询问用户需求

询问:“您是否需要AI为场景生成视频片段,还是视频仅使用您的图像?”

  • 创建视频片段。 继续第2步。
  • 仅使用图像。 跳过此阶段。在project.json中设置"clips_mode": "images-only"和"stage": "clips-skipped"。告知用户后续的装配阶段将根据脚本中的摄像机运动(推拉、平移、视差)对图像进行动画处理。如果后续阶段存在,则提供选项。停止。
  • 部分场景生成片段。 询问哪些场景需要片段(列表或范围,或规则如“仅动作场景”)。其他场景仅使用图像。将列表保存到project.json中,字段为clips_scenes。

第2步:谁制作片段

询问:“是Claude生成片段,还是您自己制作?”

  • Claude生成。 转到第3步。
  • 我自己制作。 转到第5步(为用户提供提示词)。
  • 两者都做。 编写所有提示词(第5步),并让Claude生成(第3步)。用户可根据偏好选择使用哪个结果。

第3步:查找视频生成器

阅读references/video-generation.md。简要说明:

  1. 如果配置中保存了方法(providers.video),则使用该方法。测试它。
  2. 查找本次会话中连接的用于生成视频的工具(MCP服务器或技能),包括Higgsfield、Runway、Kling、Veo、Luma、Pika、Sora等。
  3. 检查设备上的API密钥环境变量。仅输出“已设置”或“未设置”,绝不输出值。
  4. 检查本地生成器和GPU。
  5. 如果未找到任何内容,告知用户并询问:他们是否有API密钥(作为环境变量,绝不粘贴在聊天中)、可连接的MCP服务器或技能,或者在浏览器中使用的视频网站(例如Higgsfield)?或者选择“我自己制作”,然后转到第5步。

记录所选择工具的能力,因为这会影响提示词:

  • 接受开始图像
  • 接受结束图像(首帧和末帧控制)
  • 接受角色参考图像
  • 片段长度和最大长度
  • 分辨率和宽高比
  • 是否生成自己的音频或语音
  • 提示词长度限制
  • 每个片段的费用

以简短列表告知用户发现的内容。如果工具无法接受结束图像,说明情况:结束帧的提示词仅作为运动描述的指导。

第4步:生成片段

遵循references/video-generation.md中的顺序、检查和浏览器规则。关键点:

  1. 先编写提示词(第5步),因为生成器需要它们。
  2. 告知用户片段数量、总时长以及大致费用或时间。在开始前请求确认。提供仅生成部分范围的选项,例如场景1到10。
  3. 测试片段。 单独生成scene-001。从中显示帧。询问运动、风格和角色是否正确。在继续之前修正提示词。
  4. 按场景顺序生成。对于连续性场景,如果前一剪辑的实际最后一帧偏离了计划的结束帧,则使用该实际帧作为开始图像(参见参考中的ffmpeg命令)。
  5. 每个片段后检查时长、分辨率和外观。每个场景最多重试2次,之后标记为needs-manual。绝不静默重复生成调用,因为每次调用都可能消耗费用。
  6. 将每个片段保存为clips/scene-<number>_clip.<ext>。重拍文件保留为scene-<number>_clip_take2.<ext>。未经询问绝不覆盖文件。
  7. 浏览器生成:首先明确确认数量、时间、网站和下载文件夹。用户需登录。绝不输入密码或解决验证码。
  8. 一次性生成或逐个生成:询问用户。逐个生成时会显示每个片段的帧并等待审批。

如果生成失败或用户拒绝,则剩余场景回退到第5步。

第5步:为用户提供提示词

  1. 在项目文件夹中创建clips/(用于存放完成的视频)和clip-prompts/(用于存放提示词)。显示完整路径。
  2. 阅读references/clip-prompt-templates.md。为每20个场景编写一个提示词批处理文件(scenes-001-020.md),加上clip-prompts/index.md。
  3. 每个提示词的标头包含以下信息,确保不丢失:
    • 要保存的片段文件名:clips/scene-007_clip.mp4
    • 开始图像:frames/scene-007_start.png
    • 结束图像:frames/scene-007_end.png
    • 时长、宽高比和分辨率
  4. 询问:一次性处理,还是逐个处理。
    • 一次性处理。 显示文件夹路径和一个示例提示词。用户自行处理批处理文件。
    • 逐个处理。 显示第一个提示词及其文件名、开始图像和结束图像。等待用户告知片段已保存。检查文件是否以正确的名称存在于clips/中(并使用ffprobe检查时长)。然后显示下一个提示词。如果用户说“停止”,将位置保存到clips/status.md中。
  5. 提供随时检查文件夹的选项:将文件与索引进行比较,列出缺失、命名错误或时长错误的片段。

提示词质量

提示词必须专业且详细。每个提示词涵盖:

  • 摄像机:景别、角度、镜头、运动(含方向、速度和结束位置)
  • 动作:主体在片段几秒内逐拍的动作
  • 灯光:类型、方向、颜色、片段中的任何变化
  • 风格:锁定的艺术风格块和电影风格行
  • 不可改变的内容:角色外观、场景、调色板
  • 负面项、时长、宽高比

遵循模板。切勿将提示词缩短为几个词。

第6步:状态和完成

  1. 保持clips/status.md最新:
| 场景 | 文件 | 状态 | 时长 | 备注 |
|-------|------|--------|----------|------|
| 001 | scene-001_clip.mp4 | done | 6.0 s | |
| 002 | scene-002_clip.mp4 | needs-manual | | 漂移两次 |

状态值:pending、done、needs-manual、skipped。

  1. 更新project.json:提示词保存后设为"stage": "clips-prompts-done",当所有需要的片段存在且用户批准后设为"stage": "clips-done"。
  2. 告知用户clips/和clip-prompts/的路径,以及缺失的内容。
  3. 提供将当前工作生成器保存到配置中的选项(providers.video),仅保存方法和名称。
  4. 提供继续执行long-video-voice(旁白和角色语音)的选项。仅当用户同意后才启动。除非用户要求且该阶段存在,否则不启动任何其他后续阶段。

保存提示词前的自检

  • 每个需要的场景都有一个提示词,标头中包含片段名称、开始图像、结束图像、时长、宽高比和分辨率。
  • 提示词时长与脚本匹配,并尊重工具允许的长度和10秒限制。
  • 摄像机、灯光和风格与film-style.md和脚本镜头匹配。
  • 风格块和负面项逐字出现。
  • 如果说话模式为角色或混合,则在提示词中说明对话处理方式(参见模板)。
  • 片段文件名严格遵循规则。

规则

  • 未经批准的脚本,绝不开始。
  • 绝不跳过第1步。如果用户仅需图像,则跳过该阶段并说明。
  • 在用户同意数量和费用之前,绝不生成。
  • 绝不在聊天中询问API密钥。绝不输入密码或在浏览器中解决验证码。
  • 提示词批准后,绝不重命名提示词文件名或片段名称。
  • 保持聊天消息简短。将完整的提示词文本放在文件中,仅展示样本或当前提示词。

Individual skills in this repo

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

long-video-assets

Video and animation skill. Build the visual foundation for a long video from an approved story. Extracts the recurring characters, environments and key objects, helps the user choose one art style from suggested options (10 at a time, more on request), then writes image generation prompts for every character (portrait plus character sheet), environment and object, all sharing one locked style. Can also generate the images (installed tool, API, MCP or browser) or hand the user a folder and file names to fill. Use after lon

long-video-director

Turn an approved story into a shot-by-shot video script, acting as the director. Asks whether the video uses a narrator or characters who speak (or both), suggests professional filming choices (camera type, lenses, camera movement, lighting, color, pacing), saves them as a separate film style file, then writes a script that matches the project config. Outputs film-style.md and video-script.md. Use after long-video-story (and long-video-assets) are done, or when the user asks for the video script, shot list, camera style or lighting plan.

long-video-keyframes

Create the start and end frame image for every scene (clip) of the approved video script. Writes one image prompt per frame with a fixed file name that holds the scene number and start or end, makes a folder for the images, and can generate the images with an available image tool, or hand the prompts to the user all at once or one by one. Use after long-video-director, or when the user asks for start frames, end frames, keyframes or scene images.

long-video-niche-discovery

Find a differentiated video niche and a first video topic by applying seven discovery lenses (subject migration, angle inversion, hidden sub-niche, adjacent audience, format transplantation, perspective shift, cross-niche combination) to a niche, channel or video the user already likes. Returns the 10 strongest candidates, then episode topics for the chosen one. Called by long-video-story when the user picks the "niche" story style; also usable on its own.

long-video-publish

Prepare the YouTube packaging for the finished video: title options, a full description with chapters and credits, tags and hashtags, and thumbnail concepts with image prompts (made or handed over like the earlier image stages). Checks the text against YouTube limits and saves everything for the user to paste in. Use after long-video-render has produced the final video, or when the user asks for a YouTube title, description, tags, chapters or thumbnail.

long-video-render

Assemble the finished video and run the review loop. Builds the edit from the clips (or images with camera moves), voice, sound stems and captions, renders a low quality review version with scene numbers and time burned in so a client can review it, collects and applies changes (re-rendering reviews as often as needed), and when the user approves, renders the high quality final video. Uses a video editor with a CLI or MCP (FilmCraft, EffectCraft or another) if one is available and the user wants it, otherwise the bundled ffmpeg renderer. Use after long-video-sound, or when the user asks to render, assemble, export, preview or finalize the video.

long-video-sound

Video and animation skill. Create the sound effects, ambience and background music for the video and place them on the timeline. Plans the sound design from the approved script, sources or makes each sound (Openverse for openly licensed recordings and music, Earshot to make sounds from words and to listen to and judge sounds, Clipwing real-sfx to place real sounds on exact frames), records licences and credits, and mixes separate stems (effects, ambience, music) with the music ducked under speech. Or gives the user a fold

long-video-story

Agree on the story for a long video. The user either supplies a story or asks Claude to write one. When Claude writes, it first asks which story style to use (for example niche discovery, or a provocative-questions narration), runs that style's skill, and revises until the user approves. Use after long-video-setup, or when the user says "story for my video", "give me an idea", or wants to change an unapproved story. Ends only when the user explicitly approves the story.

long-video-voice

Create the spoken audio (narration and character voices) for the approved video script. First decides whether the video needs speech and asks the user to confirm. If yes, builds a voice cast (narrator plus each speaking character), makes a short sample of each voice with an available tool such as an ElevenLabs MCP and asks the user to approve the voices, then generates one audio file per spoken line with a name that holds the scene number and speaker. Or gives the user the lines, file names and folder to record or generate themselves. Use after long-video-clips (or long-video-keyframes), or when the user asks for narration, voiceover, voices or dialogue audio.

相关技能