Function description
One-click invocation of the Chanjing API to complete voiceover TTS, digital human synthesis, text-to-video, and local packaging; integrates ffmpeg / ffprobe for concatenation, transcoding, and track alignment. For orchestration and security details, see §3–§8 and templates/;Final video commandsee §5。
Runtime dependencies
Binaries or equivalent wrappers that must be available (for specific invocation methods, see §5、run_render.py):
- ffmpeg: concatenation, transcoding, packaging
- ffprobe: metadata such as duration, resolution, rotation (aligned with the digital human track)
- chan-skill(or directly
pythonunder the same repository to invoke sub-skill scripts): driveschanjing-tts、chanjing-video-compose、chanjing-ai-creationand other CLIs
Environment variables and machine-readable declarations
- Environment variable key names and descriptions:
manifest.yaml(environmentsection) and this document - Key names, default values, credential model, binaries, compliance
permissions、clientPermissions、agentPolicy:manifest.yaml
§3.2 table is explanatory material to accompany run_render.py for reading; if it conflicts with manifest.yaml , manifest.yaml shall prevail。
Usage commands
- ClawHub(slug is subject to the registry and often matches the skill package name):
clawhub run chanjing-one-click-video-creation - Direct connection from this repository:
python scripts/run_render.py --input workflow.json --output-dir ./outputs/run1(in the skill directory or withSKILLS_DIR/CHANJING_ONE_CLICK_VIDEO_SKILLS_ROOT/CHAN_SKILLS_DIRfor use)
Quick reference
| Content | Location |
|---|---|
Workflow,duration_sec、null/merge, topic validation |
§4.1 |
Segmentation, odd-even shots,scenes[]、scene_count/video_type;first shot voiceover ≤20 characters (hard) |
storyboard_prompt.md "Text segmentation" at the beginning of the piece;script_prompt.md first-shot voiceover;video_brief_plan.md |
Rendering technique, status,partial/success, hard constraints |
render_rules.md §1–§4;§7、§8 |
ref_prompt / text prompt |
storyboard_prompt.md + history_storyboard_prompt.md;§4.2 pointer |
| Request body fields and defaults | §6 |
run_render.py, subprocess CLI |
§5 |
| Security, credentials, trust boundaries, policy | manifest.yaml + §3.1(§3.1 does not repeat the manifest table) |
| Environment variables, binaries, side effects, persistence | §3.2 |
Conflict: for rendering implementation, render_rules.md shall prevail;ref_prompt for provisions, storyboard_prompt.md / history_storyboard_prompt.md shall prevail (§4.2 summary pointer).run_render.py implements only §5 + render_rules.md, adding no business rules. Execution: manually orchestrate sub-skills, only run_render, or mix them.
1. What it does
- Topic or full text →
video_plan, full voiceover text, storyboard - TTS: prefer the whole segment; if overly long, merge in small batches by storyboard (for details and character counts, see
render_rules.md§3·C.4) - Cut audio by shot
- Digital human storyboard:
chanjing-video-compose(audio-driven) - AI storyboard:
ref_prompt→chanjing-ai-creation→ composite with in-shot audio - Packaging: align the common digital human track → ffmpeg concat → local mp4
2. When to use / when not to use
| Suitable | When a finished video is needed; voiceover and visual mixed editing; when the user explicitly wants to generate a short video |
| Not suitable | Only copy/title; no video requested; only editing existing materials |
3. Prerequisites
- Authentication:
chanjing-credentials-guard; See credential paths and fields atmanifest.yaml、§3.1; when there are no credentials, the subprocess canopen_login_page.py - Plan/Script/storyboard: local Agent logic,no need forexternal LLM API key (the required path of this skill does not depend on an external LLM)
- Local binaries and repository layout:§3.2(
ffmpeg/ffprobe、SKILLS_DIR, etc.) - Digital humans and voice timbres:Do notuse environment variables or cache files in the repository to store cross-task "default"
audio_man/person_id/figure_type. For each task, atworkflow.jsonroot level explicitly fill in; have the Agent according tovideo_plan(such asvideo_type), the spoken persona and topic semantics, calllist_voices.pyandlist_figures.py(--sourceto retrievecommon/customised, etc., consistent with this task) after selection write in;audio_manshould match the selected image'saudio_man_id. - Public digital human selection (prohibited: "only take the first few items in the list"): must use
list_figures.py --source common --jsonto fetch candidates (if necessary increase--page-sizeor paginate, covering enough entries), within the candidatescompare item by itembefore finalizing:name、figures[].type(→figure_type)、figures[].width/height(aspect ratio consistent with D.1c ),audio_man_id、audio_name(if any) andvideo_plan/spoken persona(gender, temperament, industry, age impression) match.Default preference for young, energetic images: when the name oraudio_namecontains positive signals such as youth/girl/boy/lady/student/vitality/youthful/young, prioritize; only when the topic or user explicitly requests a mature, authoritative, middle-aged or elderly temperament, then choose the corresponding persona. For custom sourcecustomisedlikewise comparename、width/height、audio_man_id, etc., do not take the top of the page without comparison.
3.1 Security, credentials and trust boundaries
Environment variables and binaries are based on manifest.yaml and §3.2 . When reviewing, you can refer to description and manifest.yaml(including agentPolicy)。
- Capabilities and pipeline: step-level description see §1;
run_renderresponsibilities and subprocess see §5(the chain is not repeated here). - Primary credential / path / primaryEnv: see
manifest.yaml; path and write-back behavior also see §3.2 persistence table "credential status" andCHANJING_OPENAPI_CREDENTIALS_DIR(compatibleCHANJING_CONFIG_DIR)。 - Sensitive and compliance: do not echo the full key,do not
credentials.jsoncommit to the version repository; permission suggestion0700/0600(configuration scripts should set it as much as possible). - Trust and outbound behavior: HTTPS, fetching media by returned URL,
--output-dirwriting to disk and other details see §3.2"Typical side effects" and the persistence table; you must judge for yourself whether to trust the Chanjing host and links. - Browser: when credentials are missing,
webbrowser.open/open_login_page.pysee §3.2 same table. - Agent policy:
manifest.yamlinagentPolicy(not always, do not modify other skills).
3.2 Runtime contract (environment variables, binaries, side effects and disk writes)
Aligned with scripts/run_render.py and the behavior of sub-skills in the same repository; consistent with the YAML at the beginning of the document,manifest.yaml . If juxtaposed with other product documentation,use this repository's source code,manifest.yaml This document prevails。
Environment variables (common)
Names are based on repository root 合规规则.md §3 ; the followingrecommended namestake effect in the code,old names remain compatible(see manifest.yaml and each sub-skill description).
| Variable | Required | Default / Description |
|---|---|---|
CHANJING_OPENAPI_BASE_URL |
Optional | Default https://open-api.chanjing.cc; compatible with CHANJING_API_BASE。 |
CHANJING_OPENAPI_CREDENTIALS_DIR |
Optional | Default ~/.chanjing;credentials.json directory; compatible with CHANJING_CONFIG_DIR。 |
SKILLS_DIR |
Depends on layout | Platform reserved; repository root containing skills/chanjing-tts etc. When unset, tries in order CHANJING_ONE_CLICK_VIDEO_SKILLS_ROOT、CHAN_SKILLS_DIR, then infers from run_render.py from the script pathfour levels up. |
CHANJING_ONE_CLICK_VIDEO_REF_PROMPT_MAX_CHARS |
Optional | Default 8000; upper limit for the entire ref_prompt ; compatible with AI_VIDEO_PROMPT_MAX_CHARS。 |
CHANJING_ONE_CLICK_VIDEO_CREATION_MODEL_CODE |
Optional | Default text-to-video model_code; compatible with AI_VIDEO_MODEL。 |
Note: Some external documents mention variables such as
FIRST_DIGITAL_HUMAN_MAX_CHARS(character limit for the first digital human storyboardvoiceover), whichthe currentrun_render.pyin this repository does not read; if the source code later adds the correspondingos.environ, this table should be updated accordingly.
External binaries
| Binary | Required | Purpose |
|---|---|---|
ffmpeg |
Running one-click video run_render.py is required |
Concatenating, transcoding, muxing audio and video, etc. It may be skipped when orchestrating pure APIs and not executing this rendering script. |
ffprobe |
Same as above | Reads media resolution, duration, rotation metadata, etc., for alignment with the digital human track. |
Typical side effects when executing scripts (by category)
| Type | Description |
|---|---|
| Outbound HTTPS | ChanJing Open API (CHANJING_OPENAPI_BASE_URL / compatible with CHANJING_API_BASE), as well as fetching materials such as video_url / audio URLs returned by the API/CDN. |
| Local files | run_render.py --output-dir commonly found under:final_one_click.mp4、workflow_result.json、work/(intermediate audio, segmented video, concat lists, etc.); the specifics depend on the current command and templates/render_rules.md . |
| Subprocesses | ffmpeg / ffprobe;run_render invokes, via subprocess , Python CLIs in directories such as skills/chanjing-tts、chanjing-video-compose、chanjing-ai-creation under the same repository. |
| Browser | When credentials are missing or guided login is required, the authentication chain may trigger webbrowser.open or execute chanjing-credentials-guard for open_login_page.py(consistent with the _auth.py behavior of each skill). |
Scope of persistent changes and user controllability
The following are, for this skill,expected side effects; the write location can be controlled via paths and environment variables, rather than implicitly polluting unrelated directories.
| Category | What is written | Typical location | How the user controls it |
|---|---|---|---|
| Credential state | Written via configuration app_id / secret_key、refreshed access_token、 expire_in etc. |
CHANJING_OPENAPI_CREDENTIALS_DIR/credentials.json(default ~/.chanjing/credentials.json; compatible CHANJING_CONFIG_DIR) |
Set the recommended name or the old name; or migrate/delete the file;do notcommit the secret key to the repository. |
| One-click video artifacts | final_one_click.mp4、workflow_result.json、work/ etc. |
specified by run_render.py --output-dir (commonly the outputs/<任务名>/) |
choose an explicit --output-dir; after the task ends, keep or delete the directory as needed. |
| Other download-type scripts(sub-skill) | synthesized results, etc. to local | Each skill's download_result.py etc.: by default mostly under the current working directory outputs/<产品线>/, or --output absolute path |
Execute under the expected cwd, or always pass --output; see the corresponding skill's SKILL.md。 |
| Temporary/process files | TTS merging, segmentation, pre-upload caching, etc. | Mostly under the above output-dir under the work/ or script-agreed subdirectory |
Managed together with the output directory. |
Credential file: for path and read/write semantics, see the Credential status row above; for initial configuration, see skills/chanjing-credentials-guard/SKILL.md。
4. Rule compilation
4.1 Workflow orchestration
Merge:null = no overwrite. Order: default base → non- null overwrite → boolean/integer correction. For field defaults, see §6; defaults not expanded in the table are read by run_render.py(and subprocesses) according to implementation and environment variables (excludingvoice/digital human:audio_man、person_id/avatar_id、figure_type only from workflow.json, see §3)。
duration_sec: planning reference, not an ffmpeg limit.Final video durationis based on TTS+ffprobe .scene_count see video_brief_plan.md; segmentation and number of AI clips depend on actual measurements and subtitle timeline (render_rules.md §3·C.5). It is prohibited to trim finalized voiceover to pad the duration (unless the user requests it).
Topic: reject after removing whitespace if <5 characters, or placeholder strings (e.g. "hello", "test"); expansion allowed; in strict mode, fail if ambiguous.
Steps:1) Plan → video_brief_plan(if failed, all fail; for template see video_brief_plan.md)2) Script(hook / first paragraph aligned with first shot:≤20 characters hard limit, see script_prompt.md) 3) Storyboard: semantic segmentation;storyboard_prompt.md(first storyboard voiceover same hard limit as above); non-contemporary history_storyboard_prompt.md;DH chanjing-video-compose,AI chanjing-ai-creation; TTS/multi-segment AI/mux render_rules.md §3、§5 4) Render:render_rules.md §3(including §3·C.6)、§4(Tables 4–6);ref_prompt for QC see storyboard_prompt.md / history_storyboard_prompt.md(§4.2); retry/partial render_rules.md §1 5) Success:render_rules.md §1
Render only:run_render.py + full_script + scenes[]。Order: Plan → Script → Storyboard → Render (for which template each stage uses, see the steps listed above).
4.2 Text-to-video prompt (ref_prompt) — pointer
Single source of truth for provisions(revisions are subject to the template; this document does not repeat the D.1–D.4 table text):
| Scope | Template |
|---|---|
Contemporary-oriented,D.0 context defaults and civilization-circle inference, D.1 length,D.1a、D.1b(prone to hallucination, shared by all skills), D.2 contemporary, manual visual_prompt, D.3, D.4 contemporary assembly and 7 elements / theme clusters / single-shot assembly / self-check |
templates/storyboard_prompt.md → "Text-to-video prompt words (contemporary ground truth)" |
| D.2 non-contemporaryrouting, historicalprocess layer、civilizational circle and national consistency, placeholder discipline, and connection notes with D.3/D.4 | templates/history_storyboard_prompt.md |
| ethnicity,historical/non-contemporary Chinese stylingand English phrases when characters appear | templates/visual_prompt_people_constraint.md(explicit ethnic anchoring,historical / non-contemporarysection; also render_rules.md §4 Tables 4–6) |
still indexed only here: long audio multi-segment render_rules.md §3·C.6; word count limit CHANJING_ONE_CLICK_VIDEO_REF_PROMPT_MAX_CHARS(compatible with AI_VIDEO_PROMPT_MAX_CHARS). When the template conflicts with the render_rules.md implementation, render_rules.md prevails.
5. Automated orchestration (run_render.py)
dependency: authentication;SKILLS_DIR / CHANJING_ONE_CLICK_VIDEO_SKILLS_ROOT / CHAN_SKILLS_DIR(§3);chanjing-tts / chanjing-video-compose / chanjing-ai-creation
responsibility:① TTS+audio_task_state; for batch merging and single-batch word count limit see render_rules.md §3·C.4(TTS_BATCH_MAX) ② segmentation (render_rules.md §3·C.5)③ when there is an AI shot, first complete the first digital human and ffprobe(including rotate) → then submit text-to- aspect_ratio/clarity(see render_rules.md §3·C.6、debug.ai_video_submit_params) ④ poll in parallel with the remaining DH/AI ⑤ align the AI track to that reference ffprobe ⑥ ffmpeg concat ⑦ multi-segment text-to-video in ref_prompt then append English layering; total length is constrained by CHANJING_ONE_CLICK_VIDEO_REF_PROMPT_MAX_CHARS(compatible with AI_VIDEO_PROMPT_MAX_CHARS)
not done: no plan/script/storyboard generated; no automatic non-contemporary/contemporary; do not use list_tasks.py contemporary secondary (render_rules.md §4 Table item 8)
manual orchestration: must still satisfy render_rules.md §3、§4 and §5; §3 refinements (such as silencedetect、minterpolate, reference track bitrate, swapping the image for the same set of segmented audio, silence between TTS batches, etc.)all retained。
input MVP
| field | required | description |
|---|---|---|
full_script |
yes | with each shot voiceover concatenated according to scene_id ,norm consistent |
scenes |
yes | scene_id(integer or pure numeric string, in ascending numeric order),voiceover、use_avatar; AI shot ref_prompt(storyboard_prompt.md / history_storyboard_prompt.md; §4.2); optional subtitle |
audio_man |
yes | should be consistent with the audio_man_id of the selected digital human image |
person_id/avatar_id |
conditional | required if there is a DH shot |
figure_type |
no | with the current list_figures.py consistent with the figure_type of the selected image row (required in the case of public multi-form) |
subtitle_required |
no | default false; when true, burn subtitles on digital human shots (--subtitle show) |
speed/pitch |
no | default 1/1 |
ai_video_duration_sec |
no | 5 or 10, default 10 |
model_code |
no | default CHANJING_ONE_CLICK_VIDEO_CREATION_MODEL_CODE(compatible with AI_VIDEO_MODEL) or minmax-h3-t2v; creation_type=4; do not pass ref_img_url |
max_retry_per_step |
no | default 1 (§6) |
python scripts/run_render.py --input workflow.json --output-dir ./outputs/run1
output:final_one_click.mp4;workflow_result.json;work/
6. Input (request body)
norm: remove \r, leading/trailing whitespace; empty→empty string; consistent with run_render.py consistent. Voiceover: first full_script, then script→copy_text→input_script→content first non-empty. No topic: first sentence substitutes for topic (truncate at sentence-ending punctuation within 40 characters, otherwise 24 characters).null/merge §4.1。
| field | required | description |
|---|---|---|
topic |
condition | if none, see first-sentence rule; recommend ≥5 characters |
industry/platform/style |
no | industry empty; platform/style:DEFAULT_* or douyin/观点型口播 |
duration_sec |
no | DEFAULT_DURATION or 60; planning reference |
use_avatar |
no | default true |
avatar_id/voice_id |
no | empty;must notuse environment variables as fallback for voice or digital human; must specify in workflow.json write audio_man/person_id(and when there is a DH shot, the figure_type), and the Agent calls per task list_voices.py and list_figures.py(source consistent with video_plan / user specification)compare name, form, aspect ratio,audio_name etc., thenselect;forbiddento take the first few items in the list without comparison;default preference for young digital humans(see §3) |
subtitle_required |
no | default false (digital human finished video does not burn in subtitles;run_render pass hide) |
cover_required |
no | default true |
strict_validation/allow_auto_expand_topic/max_retry_per_step |
no | true/false/1 |
full_script |
no | default empty |
script_title/script_hook/script_cta |
no | default empty |
script/… |
no | see voiceover order above |
7. Output JSON
| key | meaning |
|---|---|
status |
success / partial / failed |
video_plan |
Plan |
script_result |
title、hook、full_script、cta |
storyboard_result.scenes[] |
scene_id、duration_sec、voiceover、subtitle、visual_prompt、use_avatar |
render_result |
video_file、scene_video_urls、render_path、degrade_log |
| other | error、debug… |
rendering without degradation: if any step fails, interrupt immediately; do not automatically switch to DH-only or AI-only finished video.partial: not success (e.g. run_render exception still writes workflow_result.json);notindicates allowing the above degradation,notexempt from storyboard_prompt.md·D.1b type quality check. Success degrade_log=[]; on failure, retain produced copy and storyboard as much as possible.
8. Hard constraints
table in templates/render_rules.md §4; cross-reference with ref_prompt see storyboard_prompt.md / history_storyboard_prompt.md(§4.2 pointer). This section is the anchor.
9. Limits
- local mp4; do not upload
- AI single segment usually 5–10s; long voiceover multiple segments
- finished video duration = total TTS track; may be inconsistent with
duration_secmismatch - TTS: whole-track priority, merge fewer batches when too long; single-batch limit and merge strategy (including
TTS_BATCH_MAX) based onrender_rules.md§3·C.4 shall prevail - text generation failure may be platform/model; try increasing
max_retry_per_step, shortref_prompt, split shots; checkworkflow_result.json