本文へ移動
cccskills
無料GitHub で公開

jianying-editor

剪映 (JianYing) AI自动化剪辑的高级封装 API (JyWrapper),提供开箱即用的 Python 接口,支持录屏、素材导入、字幕生成、Web 动效合成及项目导出。

全面适配 MacOS (Apple Silicon/Intel) 与 Windows,支持 v5.9+ (draft_info.json) 架构、工程自修复、智能配音字幕及录屏变焦。

インストール方法を見る

含まれるファイル(184)

  • SKILL.md9.7 KB
  • .editorconfig230 B
  • .github/pull_request_template.md538 B
  • .github/workflows/ci.yml1.9 KB
  • .gitignore307 B
  • .pre-commit-config.yaml450 B
  • assets/artistEffect/7127669365423508767/ac476c738e3109c848bfe76f9df8eced/config.json109 B
  • assets/artistEffect/7127669365423508767/ac476c738e3109c848bfe76f9df8eced/content.json283 B
  • assets/artistEffect/7127669365423508767/ac476c738e3109c848bfe76f9df8eced/effect.prefab3.4 KB
  • assets/artistEffect/7127669365423508767/ac476c738e3109c848bfe76f9df8eced/image/1.png23.3 KB
  • assets/artistEffect/7127669365423508767/ac476c738e3109c848bfe76f9df8eced/image/1.png.meta262 B
  • assets/artistEffect/7127669365423508767/ac476c738e3109c848bfe76f9df8eced/main.scene4.3 KB
  • assets/artistEffect/7127669365423508767/ac476c738e3109c848bfe76f9df8eced/material/effect.material440 B
  • assets/artistEffect/7127669365423508767/ac476c738e3109c848bfe76f9df8eced/material/shadow.material493 B
  • assets/artistEffect/7127669365423508767/ac476c738e3109c848bfe76f9df8eced/rt/outputTex.rt417 B
  • assets/artistEffect/7127669365423508767/ac476c738e3109c848bfe76f9df8eced/sticker.config374 B
  • assets/artistEffect/7127669365423508767/ac476c738e3109c848bfe76f9df8eced/texture/lieheng.png17.5 KB
  • assets/artistEffect/7127669365423508767/ac476c738e3109c848bfe76f9df8eced/texture/lieheng.png.meta262 B
  • assets/artistEffect/7127669365423508767/ac476c738e3109c848bfe76f9df8eced/xshader/depth.frag200 B
  • assets/artistEffect/7127669365423508767/ac476c738e3109c848bfe76f9df8eced/xshader/effect.frag12.5 KB
  • assets/artistEffect/7127669365423508767/ac476c738e3109c848bfe76f9df8eced/xshader/effect.vert956 B
  • assets/artistEffect/7127669365423508767/ac476c738e3109c848bfe76f9df8eced/xshader/effect.xshader2.8 KB
  • assets/artistEffect/7127669365423508767/ac476c738e3109c848bfe76f9df8eced/xshader/shadow.xshader2.8 KB
  • assets/artistEffect/7187739440347958589/266eb863a42498a72c5c67bb8845c24c/config.json109 B
  • assets/artistEffect/7187739440347958589/266eb863a42498a72c5c67bb8845c24c/content.json304 B
  • assets/artistEffect/7187739440347958589/266eb863a42498a72c5c67bb8845c24c/effect.prefab3.0 KB
  • assets/artistEffect/7187739440347958589/266eb863a42498a72c5c67bb8845c24c/image/红碎屑.png8.5 KB
  • assets/artistEffect/7187739440347958589/266eb863a42498a72c5c67bb8845c24c/image/红碎屑.png.meta262 B
  • assets/artistEffect/7187739440347958589/266eb863a42498a72c5c67bb8845c24c/main.scene3.9 KB
  • assets/artistEffect/7187739440347958589/266eb863a42498a72c5c67bb8845c24c/material/effect.material440 B
  • assets/artistEffect/7187739440347958589/266eb863a42498a72c5c67bb8845c24c/material/shadow.material493 B
  • assets/artistEffect/7187739440347958589/266eb863a42498a72c5c67bb8845c24c/rt/outputTex.rt417 B
  • assets/artistEffect/7187739440347958589/266eb863a42498a72c5c67bb8845c24c/sticker.config374 B
  • assets/artistEffect/7187739440347958589/266eb863a42498a72c5c67bb8845c24c/texture/122.texture318.1 KB
  • assets/artistEffect/7187739440347958589/266eb863a42498a72c5c67bb8845c24c/texture/lieheng.png17.5 KB
  • assets/artistEffect/7187739440347958589/266eb863a42498a72c5c67bb8845c24c/texture/lieheng.png.meta262 B
  • assets/artistEffect/7187739440347958589/266eb863a42498a72c5c67bb8845c24c/xshader/depth.frag200 B
  • assets/artistEffect/7187739440347958589/266eb863a42498a72c5c67bb8845c24c/xshader/effect.frag13.0 KB
  • assets/artistEffect/7187739440347958589/266eb863a42498a72c5c67bb8845c24c/xshader/effect.vert956 B
  • assets/artistEffect/7187739440347958589/266eb863a42498a72c5c67bb8845c24c/xshader/effect.xshader2.8 KB
  • assets/artistEffect/7187739440347958589/266eb863a42498a72c5c67bb8845c24c/xshader/shadow.xshader2.8 KB
  • assets/artistEffect/7351316503771368713/95cd57a11522b49969efe0210afb1044/1709118789822.png126.6 KB
  • assets/artistEffect/7351316503771368713/95cd57a11522b49969efe0210afb1044/config.json143 B
  • assets/artistEffect/7351316503771368713/95cd57a11522b49969efe0210afb1044/cover_icon.png11.8 KB
  • assets/artistEffect/7351316503771368713/95cd57a11522b49969efe0210afb1044/effectStyle.json3.5 KB
  • assets/audio.mp3127.8 KB
  • assets/click_marker.png754 B
  • assets/cover.png1.1 MB
  • assets/subtitle.srt239 B
  • assets/video.mp42.9 MB
  • assets/使用思路.jpg206.6 KB
  • assets/快速上手.png68.5 KB
  • assets/片段特效_annotation.jpg12.6 KB
  • CHANGELOG.md2.7 KB
  • CONTRIBUTING.md823 B
  • data/cloud_music_library.csv255.6 KB
  • data/cloud_sound_effects.csv2.4 KB
  • data/cloud_text_styles.csv438 B
  • data/cloud_video_assets.csv86.8 KB
  • data/filters.csv32.2 KB
  • data/jy_cached_audio.csv263 B
  • data/text_animations.csv6.1 KB
  • data/transitions.csv18.6 KB
  • data/tts_speakers.csv7.7 KB
  • data/video_intro_animations.csv7.6 KB
  • data/video_outro_animations.csv6.1 KB
  • data/video_scene_effects.csv62.3 KB
  • docs/agent-playbook.md2.2 KB
  • docs/api.md3.1 KB
  • docs/images/donate/alipay.jpg107.7 KB
  • docs/images/donate/wechat.png135.1 KB
  • docs/minimal-command-sop.md2.1 KB
  • examples/_bootstrap.py2.1 KB
  • examples/all_elements_regen.py2.4 KB
  • examples/auto_exposure_align_demo.py1.5 KB
  • examples/cloud_video_music_tts_demo.py2.0 KB
  • examples/compound_clip_demo.py1.9 KB
  • examples/my_first_vlog.py1.3 KB
  • examples/robust_auto_export.py19.7 KB
  • examples/simple_clip_demo.py1.3 KB
  • examples/video_transcribe_and_match.py6.1 KB
  • examples/web_to_video_intro_demo.py3.2 KB
  • index.html30.2 KB
  • LICENSE1.5 KB
  • prompts/movie_commentary.md1.2 KB
  • prompts/readme_to_tutorial.md3.0 KB
  • pyproject.toml262 B
  • README.md15.5 KB
  • references/AVAILABLE_ASSETS.md70.2 KB
  • references/draft_folder.py176 B
  • references/full_feature_showcase.py7.9 KB
  • references/jianying_controller.py190 B
  • references/README.md29.6 KB
  • references/script_file.py174 B
  • references/video_analysis_template.py4.0 KB
  • requirements.txt191 B
  • rules/audio-voice.md1.9 KB
  • rules/cli.md1.3 KB
  • rules/core.md3.0 KB
  • rules/effects.md2.0 KB
  • rules/generative.md1.4 KB
  • rules/keyframes.md2.5 KB
  • rules/media.md3.2 KB
  • rules/recording.md2.2 KB
  • rules/setup.md2.1 KB
  • rules/text.md4.4 KB
  • rules/web-vfx.md2.4 KB
  • scripts/api_validator.py4.5 KB
  • scripts/asset_search.py6.1 KB
  • scripts/auto_exporter.py4.2 KB
  • scripts/build_cloud_music_library.py8.0 KB
  • scripts/build_cloud_text_styles_library.py6.0 KB
  • scripts/cloud_manager.py13.8 KB
  • scripts/core/media_ops.py10.0 KB
  • scripts/core/mocking_ops.py4.9 KB
  • scripts/core/project_base.py8.2 KB
  • scripts/core/text_ops.py8.8 KB
  • scripts/core/vfx_ops.py2.5 KB
  • scripts/draft_inspector.py6.6 KB
  • scripts/jy_wrapper.py2.5 KB
  • scripts/movie_commentary_builder.py3.5 KB
  • scripts/smart_rough_cut.py5.7 KB
  • scripts/smart_zoomer.py9.2 KB
  • scripts/sync_jy_assets.py6.4 KB
  • scripts/universal_tts.py7.5 KB
  • scripts/utils/cli_protocol.py427 B
  • scripts/utils/config.py551 B
  • scripts/utils/constants.py1.2 KB
  • scripts/utils/env_setup.py1.3 KB
  • scripts/utils/errors.py301 B
  • scripts/utils/formatters.py9.0 KB
  • scripts/utils/logging_utils.py731 B
  • scripts/utils/media_normalizer.py3.5 KB
  • scripts/utils/skill_path.py2.3 KB
  • scripts/vendor/pyJianYingDraft/__init__.py9.5 KB
  • scripts/vendor/pyJianYingDraft/animation.py5.1 KB
  • scripts/vendor/pyJianYingDraft/assets/__init__.py1.2 KB
  • scripts/vendor/pyJianYingDraft/assets/draft_info_template.json3.5 KB
  • scripts/vendor/pyJianYingDraft/assets/draft_meta_info.json1.3 KB
  • scripts/vendor/pyJianYingDraft/assets/draft_settings_template90 B
  • scripts/vendor/pyJianYingDraft/assets/key_value_template.json3 B
  • scripts/vendor/pyJianYingDraft/audio_segment.py8.5 KB
  • scripts/vendor/pyJianYingDraft/draft_folder.py6.3 KB
  • scripts/vendor/pyJianYingDraft/effect_segment.py1.2 KB
  • scripts/vendor/pyJianYingDraft/exceptions.py679 B
  • scripts/vendor/pyJianYingDraft/jianying_controller.py9.9 KB
  • scripts/vendor/pyJianYingDraft/keyframe.py5.9 KB
  • scripts/vendor/pyJianYingDraft/LICENSE10.5 KB
  • scripts/vendor/pyJianYingDraft/local_materials.py12.1 KB
  • scripts/vendor/pyJianYingDraft/metadata/__init__.py1.3 KB
  • scripts/vendor/pyJianYingDraft/metadata/audio_scene_effect.py24.3 KB
  • scripts/vendor/pyJianYingDraft/metadata/effect_meta.py5.5 KB
  • scripts/vendor/pyJianYingDraft/metadata/filter_meta.py212.8 KB
  • scripts/vendor/pyJianYingDraft/metadata/font_meta.py109.3 KB
  • scripts/vendor/pyJianYingDraft/metadata/mask_meta.py922 B
  • scripts/vendor/pyJianYingDraft/metadata/speech_to_song.py960 B
  • scripts/vendor/pyJianYingDraft/metadata/text_intro.py20.5 KB
  • scripts/vendor/pyJianYingDraft/metadata/text_loop.py13.0 KB
  • scripts/vendor/pyJianYingDraft/metadata/text_outro.py13.7 KB
  • scripts/vendor/pyJianYingDraft/metadata/tone_effect.py9.0 KB
  • scripts/vendor/pyJianYingDraft/metadata/transition_meta.py76.4 KB
  • scripts/vendor/pyJianYingDraft/metadata/video_character_effect.py127.8 KB
  • scripts/vendor/pyJianYingDraft/metadata/video_group_animation.py17.3 KB
  • scripts/vendor/pyJianYingDraft/metadata/video_intro.py21.9 KB
  • scripts/vendor/pyJianYingDraft/metadata/video_outro.py17.5 KB
  • scripts/vendor/pyJianYingDraft/metadata/video_scene_effect.py583.9 KB
  • scripts/vendor/pyJianYingDraft/script_file.py41.4 KB
  • scripts/vendor/pyJianYingDraft/segment.py11.3 KB
  • scripts/vendor/pyJianYingDraft/template_mode.py8.2 KB
  • scripts/vendor/pyJianYingDraft/text_segment.py21.0 KB
  • scripts/vendor/pyJianYingDraft/time_util.py3.1 KB
  • scripts/vendor/pyJianYingDraft/track.py4.4 KB
  • scripts/vendor/pyJianYingDraft/util.py2.1 KB
  • scripts/vendor/pyJianYingDraft/video_segment.py22.6 KB
  • scripts/vendor/README.md1.2 KB
  • scripts/web_recorder.py3.9 KB
  • SECURITY.md543 B
  • tests/test_wrapper.py13.6 KB
  • tools/check_repo_hygiene.py944 B
  • tools/recording/recorder_config.json34 B
  • tools/recording/recorder.py15.8 KB
  • tools/validate_data_schema.py2.4 KB
  • usage.md5.4 KB
  • VERSION6 B

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

JianYing Editor Skill

Use this skill when the user wants to automate video editing, generate drafts, or manipulate media assets in JianYing Pro.

Agent execution playbook: docs/agent-playbook.md Minimal command SOP: docs/minimal-command-sop.md Natural language usage guide: usage.md Draft inspector CLI: python <SKILL_ROOT>/scripts/draft_inspector.py list --limit 20 python <SKILL_ROOT>/scripts/draft_inspector.py summary --name "DraftName" python <SKILL_ROOT>/scripts/draft_inspector.py show --name "DraftName" --kind content --json For generic editing requests, always follow the "Quick Edit Runtime Template" and "Acceptance Checklist" in that playbook.

🚨 重要开发原则 (CRITICAL DEVELOPER RULES)

  1. 脚本位置:禁止在 Skill 内部目录创建剪辑脚本。所有的剪辑逻辑实现代码(.py 脚本)必须存放在用户当前项目的根目录(或子目录,如 scripts/),以保持 Skill 库的纯净和可移植性。
  2. 版本与架构:
    • 双平台适配:已全面支持 MacOS (路径探测/录屏) 与 Windows。
    • Auto-healing:支持 v5.9+ (draft_info.json)。若草稿损坏或版本冲突,使用 overwrite=True 初始化 JyProject 可触发自动修复。
  3. 配乐选择:
    • 简单演示使用默认音乐。实际项目,应优先检索并推荐 data/cloud_music_library.csv 中的相关曲目,或根据视频主题(如“科技”、“温暖”)进行关键词过滤。
    • 询问用户:“我发现了几首符合主题的云端音乐,要不要试试?(如:Illuminate - 科技感)”。

规则指南 (Rules)

Read the individual rule files for specific tasks and constraints:

🎯 Agent Quick Routing

  • 云端视频 + 云端音乐:rules/media.md + rules/audio-voice.md -> examples/cloud_video_music_tts_demo.py
  • 智能配音与字幕 (Script-to-Video):rules/text.md + rules/audio-voice.md -> 核心 API add_narrated_subtitles
  • 旁白与字幕对齐:rules/text.md + rules/audio-voice.md -> examples/cloud_video_music_tts_demo.py
  • 录屏与智能变焦:rules/recording.md -> tools/recording/recorder.py
  • 批量导出/无头导出:rules/core.md + rules/cli.md -> examples/robust_auto_export.py
  • 影视解说生成:rules/generative.md -> scripts/movie_commentary_builder.py

📖 经典示例 (Examples)

Refer to these for complete workflows:

🧠 提示词与集成工具 (Prompts & Integrated Tools)

Use these templates and scripts for complex tasks:

  • Asset Search: Find filters, transitions, and animations by Chinese/English name:
    python <SKILL_ROOT>/scripts/asset_search.py "复古" -c filters
    
  • Movie Commentary Builder: Generate 60s commentary videos from a storyboard JSON:
    python <SKILL_ROOT>/scripts/movie_commentary_builder.py --video "video.mp4" --json "storyboard.json"
    
  • Sync Native Assets: Import your favorited/played BGM/Styles from JianYing App to the Skill:
    python <SKILL_ROOT>/scripts/sync_jy_assets.py
    # Index cloud materials from your existing drafts
    python <SKILL_ROOT>/scripts/build_cloud_music_library.py
    python <SKILL_ROOT>/scripts/build_cloud_text_styles_library.py
    
  • README to Tutorial: Convert a project's README.md into a full installation tutorial video script:
    • Read prompt: prompts/readme_to_tutorial.md
    • Inject content into {{README_CONTENT}} variable
  • Screen Recorder & Smart Zoom: Record your screen and auto-apply zoom keyframes:
    python <SKILL_ROOT>/tools/recording/recorder.py
    # Web preview capture (high performance)
    python <SKILL_ROOT>/scripts/web_recorder.py --url "http://localhost:3000" --duration 5
    # Or apply zoom to existing video:
    python <SKILL_ROOT>/scripts/jy_wrapper.py apply-zoom --name "Project" --video "v.mp4" --json "e.json"
    
  • Draft Inspector: Examine draft structure and metadata (v5.9+ support):
    python <SKILL_ROOT>/scripts/draft_inspector.py list --limit 20
    python <SKILL_ROOT>/scripts/draft_inspector.py summary --name "DraftName"
    
  • Auto Exporter: Headless export of a draft to MP4/SRT:
    python <SKILL_ROOT>/scripts/auto_exporter.py "DraftName" "output.mp4" --res 1080 --fps 60
    # For SRT only:
    python <SKILL_ROOT>/scripts/jy_wrapper.py export-srt --name "DraftName"
    
    Note: MP4 auto export uses Windows UI Automation. On macOS, generate the draft and export it manually from JianYing.
  • Template Clone & Replacer: 安全克隆模板并批量替换物料 (防止损坏原模板):
    # 克隆模板生成新项目
    python <SKILL_ROOT>/scripts/jy_wrapper.py clone --template "酒店模板" --name "客户A_副本"
    
  • API Validator: Run a quick diagnostic of your environment:
    python <SKILL_ROOT>/scripts/api_validator.py
    

🚀 快速开始示例

import os
import sys

# 1. 环境初始化 (必须同步到脚本开头,支持 Win/Mac)
current_dir = os.path.dirname(os.path.abspath(__file__))
env_root = os.getenv("JY_SKILL_ROOT", "").strip()
# 探测 Skill 路径 (支持 Antigravity, Trae, Claude 等)
skill_root = next((p for p in [
    env_root,
    os.path.join(current_dir, ".agents", "skills", "jianying-editor"),
    os.path.join(current_dir, ".agent", "skills", "jianying-editor"),
    os.path.join(current_dir, ".trae", "skills", "jianying-editor"),
    os.path.join(current_dir, ".claude", "skills", "jianying-editor"),
    os.path.join(current_dir, "skills", "jianying-editor"),
    os.path.abspath(".agents/skills/jianying-editor"),
    os.path.abspath(".agent/skills/jianying-editor"),
    os.path.abspath(".trae/skills/jianying-editor"),
    os.path.abspath(".claude/skills/jianying-editor"),
    os.path.abspath("skills/jianying-editor"),
    os.path.dirname(current_dir)
] if p and os.path.exists(os.path.join(p, "scripts", "jy_wrapper.py"))), None)

if not skill_root: raise ImportError("Could not find jianying-editor skill root.")
sys.path.insert(0, os.path.join(skill_root, "scripts"))
from jy_wrapper import JyProject

if __name__ == "__main__":
    # 2. 初始化工程 (支持 v5.9+ 及自修复)
    project = JyProject("New AI Video", overwrite=True)
    assets_dir = os.path.join(skill_root, "assets")

    # 3. 智能配音与字幕 (One-click Script-to-Video)
    project.add_narrated_subtitles(
        text="欢迎使用剪映自动化 Skill。这是一个全面适配 MacOS 的进阶版本。",
        speaker="zh_female_xiaopengyou"
    )

    # 4. 导入额外素材
    project.add_media_safe(os.path.join(assets_dir, "video.mp4"), "0s")
    project.add_media_safe(os.path.join(assets_dir, "audio.mp3"), "0s", track_name="Audio")

    # 5. 添加带动画的标题
    project.add_text_simple("剪映自动化开启", start_time="1s", duration="3s", anim_in="复古打字机")

    project.save()

🛠️ 初始化与项目规范 (Initialization & Project Rules)

在初始化 JyProject 时,请务必根据主视频素材的比例设置分辨率。默认值为横屏 (1920x1080)。

🚨 脚本存放位置规范

禁止在 Skill 安装目录下创建你的业务剪辑脚本。

  • 正确做法:将你的剪辑 Python 脚本放在项目的根目录。
  • 原因:Skill 目录应该只包含工具集源码,便于后续 git pull 升级。业务代码混入会导致版本管理混乱。

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

このスキルの問題を報告する