JianYing Pro (剪映) Native Draft Export Skill
This skill provides an automated, hardware-native bridge to generate and deploy production-grade JianYing Pro macOS (11.4+) project drafts directly from video files, audio tracks, and subtitle scripts.
It completely solves the "media missing / permission denied" sandbox prompt by packaging projects under the Self-Contained Draft Architecture.
Quick Reference
1. One-Line CLI Export & Instant Open
python3 scripts/export_draft.py \
--video "/path/to/my_video.mp4" \
--name "My Project Name" \
--cover "/path/to/cover.jpg" \
--subtitles "/path/to/subtitles.json" \
--open
| Parameter | Short | Required | Description |
|---|---|---|---|
--video | -v | Yes | Absolute path to the source video file |
--name | -n | No | Project name in JianYing (defaults to video filename) |
--cover | -c | No | Cover thumbnail image (.jpg / .png) |
--subtitles | -s | No | Subtitle file (.json or .srt) |
--duration | -d | No | Video duration in seconds (auto-probed if omitted) |
--open | -o | No | Immediately restart/launch JianYing Pro and open draft |
2. Python API Usage
from pathlib import Path
import sys
# Add skill scripts directory
sys.path.insert(0, "/path/to/jianying-draft-export/scripts")
from draft_builder import JianyingDraft
# 1. Initialize draft
draft = JianyingDraft(name="My High-Level Short Video", width=1920, height=1080)
# 2. Set video source (probes duration automatically)
draft.set_video("/path/to/rendered_video.mp4")
# 3. Attach cover image
draft.set_cover("/path/to/cover.jpg")
# 4. Add subtitles programmatically with dual-color highlighting
draft.add_subtitle(
text="Large language models have strict anti-cheating mechanisms. Self-praise on a single dimension is called 'lone evidence' by the algorithm.",
start_sec=8.13,
end_sec=16.46,
highlight="lone evidence" # Highlight word will be rendered in pure gold [1.0, 0.84, 0.0] with black strokes
)
# Or load from an external JSON / SRT file:
# draft.load_subtitles("/path/to/subtitles.json")
# 5. Compile, auto-copy to self-contained draft, and launch app
draft.save_and_inject(open_app=True)
3. Subtitle JSON Format
The subtitle parser accepts either standard .srt files or a JSON list:
[
{
"start": 0.0,
"end": 7.68,
"text": "In 2026, the harshest reality for physical stores is not that the neighbor is lowering prices, but that when customers ask AI which store nearby is good, your store simply doesn't exist.",
"hl": "doesn't exist"
},
{
"start": 8.13,
"end": 16.46,
"text": "Large language models have strict anti-cheating mechanisms. Self-praise on a single dimension is called 'lone evidence' by the algorithm. Single evidence is not established, and is directly excluded.",
"hl": "directly excluded"
}
]
hl: Optional substring that will be given high-contrast gold highlight styling with thick black borders.
4. Architecture: Why macOS Sandbox Needs "Self-Contained Drafts"
macOS App Sandbox restricts VideoFusion-macOS.app from accessing files in ~/Desktop/, ~/.gemini/, or arbitrary directories.
❌ External Path Mode (Broken):
~/Desktop/IP/video.mp4 -----> JianYing Pro [Sandbox EACCES] -----> "media missing / permission denied" popup
✅ Self-Contained Draft Mode (This Skill):
~/Movies/JianyingPro/User Data/Projects/com.lveditor.draft/<Project>/video.mp4
└─> JianYing Pro [Full Native Read/Write] ──> Zero Prompt, Instant Playback!
See macos_sandbox_bypass.md for deeper technical analysis.
5. Verification & Troubleshooting
To inspect whether a draft was created and decrypted properly:
python3 scripts/verify_draft.py "Project Name"
If libjycodec.dylib needs recompilation (e.g. on a new architecture):
bash scripts/compile_dylib.sh