Merge Video logo

Merge Video

Community
JianhuiWei7
merge-video

【视频拼接/合并工具】支持多视频自动统一分辨率、统一比例(无黑边裁剪)、统一帧率并平滑合并输出。当用户需要拼接、合并、组合多个视频文件(如.mp4)为单个文件时,必须立即调用此技能。

Overview

PublisherJianhuiWei7
RepositoryVideoWeaver
Skill namemerge-video
Stars
48
Forks
1
Bundled files
1
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by JianhuiWei7 on GitHub. Read the source before you install it.

Installation

Install the Merge Video AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/JianhuiWei7/VideoWeaver/tree/main/skills/merge-video
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/JianhuiWei7/VideoWeaver.git /tmp/VideoWeaver
mkdir -p .claude/skills
cp -r /tmp/VideoWeaver/skills/merge-video .claude/skills/merge-video
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Merge Video in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Merge Video on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Merge Video is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

前置依赖

  1. 安装依赖包:pip install moviepy opencv-python
  2. 本地环境建议已配置好 ffmpeg(虽然 moviepy 会尝试自动处理,但系统级 ffmpeg 会提升稳定性)。

支持模式

步骤1:合并多个视频 (Merge Videos)

执行合并脚本,支持以下两种模式和多种组合用法:

1. 自动适配合并模式

无需指定复杂参数,脚本会自动分析所有输入视频,计算出最常见的宽高比(Aspect Ratio)、分辨率和帧率(FPS),自动将所有非基准视频进行缩放、裁剪和重采样,最后合并为一个无缝衔接的视频。

2. 自定义输出模式

允许用户手动指定输出视频的保存路径,以及强制指定输出视频的目标帧率(FPS)。

典型使用案例

1. 基础视频合并(全自动设定)

最简单的用法,自动处理分辨率和比例差异,并在第一个视频同目录下自动生成 merged_video_随机数.mp4 文件。

bash
python merge-video/scripts/merge_videos.py \
  --video_paths "/path/to/video1.mp4" "/path/to/video2.mp4" "/path/to/video3.mp4"
2. 指定输出文件名合并

将多个视频合并,并明确指定最终输出的文件名。系统会自动将输出文件保存在输入视频列表的第一个视频所在的文件夹下。

bash
python merge-video/scripts/merge_videos.py \
  --video_paths "/path/to/part1.mp4" "/path/to/part2.mp4" \
  --output_filename "final_merged_output.mp4"
3. 指定目标帧率合并

强制以特定的帧率(例如 60 FPS)合并视频,即使原视频可能是 24 或 30 FPS。

bash
python merge-video/scripts/merge_videos.py \
  --video_paths "/path/to/clipA.mp4" "/path/to/clipB.mp4" \
  --target_fps 60 \
  --output_filename "smooth_output.mp4"

运行模式与日志监控

默认行为: 该脚本为前台同步执行(Blocking),在执行过程中会在终端直接输出处理日志和进度条(包含长宽比统一、分辨率转换、音频流处理等)。

任务监控流程:

  1. 提交任务:通过命令行执行脚本。
  2. 监控进度:合并过程可能需要较长时间(取决于视频体积和数量),可以通过终端的标准输出(stdout)查看当前处理的阶段。
  3. 完成状态:
    • 成功:日志末尾会输出 ✅ Videos merged successfully: [输出路径],并返回状态码 0。
    • 失败:日志末尾会输出 ❌ An error occurred during video merging: [错误信息]。

参数说明

参数名说明
--video_paths(必填)需要合并的视频文件路径列表,使用空格分隔多个路径。
--output_filename(选填)最终合并生成的视频文件名。请只提供文件名即可(如 "output.mp4"),无需完整路径,系统会自动使用第一个输入视频所在的目录作为最终保存位置。如果传入了完整路径,系统也只会提取其文件名。
--target_fps(选填)指定输出视频的帧率(如 24, 30, 60)。如果不填,将自动推导所有输入视频中最常用的帧率作为目标帧率。
参数配合说明
  • 脚本会自动处理有无音频流混合的情况(例如视频A有声音,视频B无声音)。处理后的无声视频段将被静音或安全跳过音频轨道处理,不会导致合并失败。
  • 若输入视频的比例差异过大(例如 16:9 与 9:16 混合),脚本会以出现次数最多的比例为基准,对其他视频进行中心裁剪缩放(无黑边),请注意这可能会裁掉部分画面边缘内容。

执行规范

  • 执行前检查:在执行合并前,确保传入的所有 --video_paths 对应的文件在本地确实存在。
  • 耗时预警:视频合并与转码属于 CPU/IO 密集型操作。当要合并的视频文件较大或较多时,你应当提前告知用户“⏳ 视频合并可能需要一些时间,请耐心等待...”。
  • 结果反馈:命令执行结束后,你需要检查输出日志。
    • 若成功,向用户汇报:"✅ 视频合并成功!已保存至:[输出路径]"。
    • 若失败,向用户汇报失败原因(如路径无效、格式不支持等),并提供可能的修复建议。
  • 清理机制:脚本内置了临时文件(如 _resized_*.mp4)的自动清理机制,通常不需要 Agent 手动介入清理。

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Merge Video AI skill do?

【视频拼接/合并工具】支持多视频自动统一分辨率、统一比例(无黑边裁剪)、统一帧率并平滑合并输出。当用户需要拼接、合并、组合多个视频文件(如.mp4)为单个文件时,必须立即调用此技能。

Why use Merge Video on TypingMind?

Because you install it once and use it with any model. Merge Video is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Merge Video in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/JianhuiWei7/VideoWeaver/tree/main/skills/merge-video. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Merge Video?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Merge Video?

As many as you like. As long as a model supports skills, you can use Merge Video with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Merge Video AI skill free?

It is published on GitHub by JianhuiWei7. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇