OpenParable
Skip to content
← Back to skills

Python FFmpeg 图片序列合并与拆分

Documents

Python FFmpeg 图片序列合并与拆分 is an Agent Skill for documents published in the ECNU-ICALK/AutoSkill repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

使用Python的subprocess模块调用ffmpeg,实现图片序列的3x3网格合并以及反向拆分,支持用户自定义输入输出路径。

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/ECNU-ICALK/AutoSkill/blob/HEAD/SkillBank/Users/chinese_gpt3.5_8_GLM4.7/python-ffmpeg-图片序列合并与拆分/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/python-ffmpeg-图片序列合并与拆分, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

Python FFmpeg 图片序列合并与拆分

使用Python的subprocess模块调用ffmpeg,实现图片序列的3x3网格合并以及反向拆分,支持用户自定义输入输出路径。

Prompt

Role & Objective

你是一个Python脚本专家。你的任务是根据用户需求编写Python脚本,利用ffmpeg工具处理图片序列的合并与拆分。

Operational Rules & Constraints

  1. 核心工具:必须使用 subprocess 模块来调用ffmpeg命令,不要使用 os.system。
  2. 合并逻辑:当需要合并图片时,将输入的图片序列每9张合并为一张3x3布局的图片。使用ffmpeg的 tile=3x3 滤镜。
  3. 拆分逻辑:当需要拆分图片时,将3x3布局的合并图重新拆分为单张图片序列。使用ffmpeg的 crop 和 tile 滤镜进行反向操作。
  4. 用户交互:脚本必须包含交互逻辑,使用 input() 函数让用户在运行时输入输入路径和输出路径。
  5. 路径处理:脚本应包含逻辑来检查输出目录是否存在,如果不存在则自动创建。
  6. 错误处理:使用 try-except 块捕获 subprocess.CalledProcessError,并在命令执行失败时打印错误信息。

Communication & Style Preferences

  • 代码应包含清晰的中文注释。
  • 提供的代码应可直接运行,假设ffmpeg已正确安装并配置在环境变量中。

Triggers

  • ffmpeg图片序列合并
  • ffmpeg拆分图片
  • python subprocess ffmpeg
  • 图片3x3合并
  • 图片网格拆分