Communitygithub.com

0xsline/openchatcut

用于在 OpenChatCut 项目的素材库中获取或导入媒体资源,包括本地/附加视频、用户提供的路径、公共媒体 URL、网络视频/音频/图片资源、上传回退决策,以及在 import_media、download_media 或手动操作之间做出选择。

openchatcut 是什么?

该技能为 OpenChatCut 视频编辑器提供了全面的媒体资产管理功能。它支持三种核心导入路径:用户本地文件(通过编辑器 UI 拖放或上传)、公共 URL(通过 download_media 工具)以及外部主机传输(通过 import_media 创建上传会话)。导入流程会自动处理转码(≤1920 长边,浏览器友好编码,约 8Mbps)、音频提取和自动语音识别(ASR)。该技能强调从原始素材进行基于时间轴的编辑,禁止在导入前进行预拼接、预裁剪或预合成,以确保每个编辑步骤都可审查和可撤销。存储方面,媒体文件存储在本地磁盘 /media/uploads/ 目录,并可选择镜像到 Cloudflare R2 以实现跨设备同步。该技能要求开发者使用正确的工具方法(如 import_media 与 finalize_uploaded_asset),并避免直接操作文件路径或假定文件已就绪。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/0xsline/openchatcut/tree/HEAD/src/agent/skills/asset-import

在你喜欢的 AI 中提问

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

文档

素材导入

此版本在本地运行编辑器和媒体服务器。没有托管的导入 API、没有 CLI、也没有 OAuth:媒体通过编辑器 UI 或以下智能体工具进入项目。根据数据所在位置选择合适的路径。

路径 1 —— 用户的本地文件(首选)

请用户将文件拖入编辑器(预览画布或“我的素材”面板),或使用上传按钮。本地管道随后自动运行:流式写入 /media/uploads/、条件转码(≤1920 长边、浏览器友好编码、约 8Mbps)、音频提取以及自动转写(上传即启动 ASR)。请勿要求用户自行预转换、预裁剪或预转码——管道会自动处理。

智能体无法读取用户的文件系统。如果用户给了你一个 /Users/... 或 C:\... 路径,请告知他们将文件拖入编辑器;你无法获取该文件。

路径 2 —— 公共 URL(智能体驱动)

使用 download_media 传入单个 URL 或批量数组。服务端会获取文件,存储到 /media/uploads/ 下,并注册为素材库资源。对于用户指定的第三方素材或网络媒体,优先使用此方式。下载完成后,该素材的行为与其他媒体库素材一致。

路径 3 —— 外部主机传输

调用 import_media,传入 {"action":"create_session", "assetType":..., "filename":..., "contentType":..., "size":...}。该调用会返回一个绑定到当前项目、会话、素材身份、基文件名、POST 方法、MIME 类型和精确字节数的短期上传槽。主机端脚本可以按照声明的请求头向该精确 URL 上传数据。智能体的沙箱无法访问用户的本地主机,因此不要通过 run_code 尝试传输。

成功上传的响应会返回一个不透明的回执、回显的 assetType 以及上传后的路径。在需要精确的时长、尺寸、帧率或音频信息时,探测该上传路径,然后调用 finalize_uploaded_asset,传入回执、回显的 assetType、测量到的媒体元数据,以及音频/视频/GIF 的 durationInSeconds。服务端会解析权威的哈希值、路径、大小、文件名和素材 ID。Finalize 提交素材,但绝不会启动 ASR;将音频/视频素材放到轨道上后,如果需要转写,请单独调用 transcribe_track。在 finalize 成功之前,素材不存在且不可用。对于替换缺失素材的情况,请将现有的 assetId 传递给 import_media;如果是新素材则省略该参数。切勿自行构造 /media/uploads/... 路径,也切勿在上传响应之前声称数据已就绪。

编辑规范

对于多源剪辑,应从 OpenChatCut 时间轴上的原始素材构建可审查的作品。不要先将视频本地拼接、预裁剪、预合成、烧录字幕或展平处理再导入——请导入原始素材并在时间轴上完成所有合成操作,使每一步都可审查且可撤销。

对于代码类素材(如手动编写的动态图形),请使用 create-motion-graphics 技能(创建新素材用 create_motion_graphic_from_code,编辑现有素材则更新资产代码)—— 动态图形代码不是导入的文件。

存储说明

  • 数据存储在本地磁盘(/media/uploads/),直接通过 Range 请求提供。如果配置了 Cloudflare R2,上传内容会镜像到 R2,其他设备可从 R2 加载;未配置 R2 时项目仅限本地访问。
  • 仅限本地访问是有效的最终状态:预览、编辑和导出均从磁盘读取。云镜像仅在需要跨设备访问时需要。

Individual skills in this repo

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

0xsline/openchatcut

Connect an MCP-capable coding agent to OpenChatCut and edit local video projects. Use when the user asks to install, connect, or set up OpenChatCut; inspect or edit an OpenChatCut project; work with its timeline, transcript, captions, media, generation, motion graphics, audio, color, or export tools; or recover from an OpenChatCut MCP error.

0xsline/openchatcut

Use when a OpenChatCut video editing or creation workflow needs export, render, download, share, final delivery, subtitle-file export, render choice, local-only asset handling, or export fallback explanation.

0xsline/openchatcut

AI image generation via Fal.ai, gpt-image-2, nano-banana, MiniMax image-01, and xAI Grok Imagine. Use when the user wants to generate or create an image / picture / still.

0xsline/openchatcut

Use when a OpenChatCut tool call fails or returns an unexpected shape.

0xsline/openchatcut

Music generation via Mureka, MiniMax, Atlas Cloud, and Sonilo. Use for instrumentals, songs, soundtracks, track/stem generation, covers, or video-conditioned scoring of the finished cut through `submit_music`.

0xsline/openchatcut

OpenChatCut product knowledge — UI layout, editor features, and how generation providers are configured. Use when the user asks about the product interface, how to use a feature, where to find something, or needs GUI guidance for something the agent cannot do directly. Also use as fallback when a task fails and the user needs to complete it manually in the UI. NOT for live project-state queries ("where are my folders?", "what's on my timeline?", "where is clip X?") — those are answered by `read_project`, not by this skill.

0xsline/openchatcut

AI shader generator for WebGL video effects, transitions, masks, and color grading (LUT / 调色 / 电影感 / film look). Use when the user wants a video effect (滤镜 / 特效), a transition (转场 / crossfade / wipe / cube / 3d), a mask (蒙版 / 遮罩 / reveal), a zoom / push-in (推近 / 推镜头), or a color grade — try the built-in effects (zoom, builtin LUTs) before generating a new shader.

0xsline/openchatcut

Use when checking whether agent edits are reflected in the OpenChatCut project and editor.

0xsline/openchatcut

AI video generation via Fal.ai, Seedance 2.0, Kling, MiniMax Hailuo, xAI Grok Imagine, and OFox. Use when the user wants to generate a video clip — text-to-video, image-to-video, first/last-frame transitions, reference-guided generation, multi-shot, or generatively editing / extending an existing clip.

0xsline/openchatcut

Text-to-Speech (TTS), voiceover, narration placement/sync, and custom sound effects (SFX) generator. Use when the user wants generated speech from text, wants to add/replace/align narration or voiceover for an existing video/timeline, wants to keep existing voiceover synced after visual retiming edits, needs voice audition/selection, or explicitly wants a newly generated/custom sound effect that is not available in the Sound Effects library.

0xsline/openchatcut

Use when the agent should ask the user for structured input with an in-chat form, including single-select, multi-select, text fields, style pickers, or voice audition choices.

相关技能