当用户要做这些事时使用本 Skill:
如果需求更接近“上传一段真人视频做对口型驱动”,优先使用 chanjing-avatar,不要混用。
本 Skill 自己包含本地配置和鉴权流程,不依赖其他 skill 的运行时脚本。
本 Skill 使用:
~/.chanjing/credentials.jsonCHANJING_CONFIG_DIR:使用 $CHANJING_CONFIG_DIR/credentials.jsonhttps://open-api.chanjing.cc当本地缺少 AK/SK 或 AK/SK 无效时,脚本默认返回登录引导信息,不自动打开浏览器。
如需本地自动开页,可显式设置: CHANJING_AUTO_OPEN_LOGIN=1。
https://www.chanjing.cc/openapi/login
common(公共数字人)或 customised(定制数字人)list_figures --source <common|customised>(建议 --json,公共源可加大 --page-size 或翻页)获取可用形象; 在候选内对比 name、各 figure 的 type 与分辨率、 audio_man_id、 audio_name(若有)与任务人设后再选定 person.id。 禁止 未比较就默认列表最前几项。figure_type(与所选 figures[].type 一致),例如 sit_body / whole_body / circle_view。无用户特殊要求时, 默认优先年轻、有活力的形象(名称/ audio_name 偏青年、学生、元气等);题材需要成熟或中老年气质时再改选。audio_man_idshow(保留字幕)或 hide(隐藏字幕)show 但没有提出自定义样式或位置需求,直接使用官方文档推荐默认值;只有在用户明确想调整字幕位置或样式时,才继续追问 subtitle_config 参数subtitle_config 相关参数upload_file 获取 file_idcreate_task 创建视频合成任务,得到 video_idpoll_task 轮询直到成功,得到 video_urldownload_result本 Skill 当前覆盖:
GET /open/v1/list_common_dpPOST /open/v1/list_customised_personPOST /open/v1/create_videoGET /open/v1/videoGET /open/v1/common/create_upload_urlGET /open/v1/common/file_detail脚本目录:
scripts/脚本说明chanjing-config写入/查看本地 app_id 与 secret_key,并清理旧 token 缓存chanjing-get-token从本地凭证获取有效 access_token(必要时自动刷新)_auth.py读取凭证、获取或刷新 access_token``list_figures按 `--source commonupload_file上传音频或背景素材,轮询到文件可用后输出 file_id``create_task创建视频合成任务;使用公共数字人时可补充 --figure-type ...,字幕支持 `--subtitle showpoll_task轮询视频详情直到完成,默认输出 video_url``download_result下载最终视频到 outputs/video-compose/
示例 1:公共数字人文本驱动
bash
# 1. 先列公共数字人
python scripts/list_figures --source common
# 2. 用公共数字人创建文本驱动视频
VIDEO_ID=$(python scripts/create_task \
--person-id "C-ef91f3a6db3144ffb5d6c581ff13c7ec" \
--figure-type "sit_body" \
--audio-man "C-0ae461135d8a4eb2b59c853162ea9848" \
--subtitle "show" \
--subtitle-x 31 \
--subtitle-y 1521 \
--subtitle-width 1000 \
--subtitle-height 200 \
--subtitle-font-size 64 \
--subtitle-stroke-width 7 \
--text "你好,这是一个蝉镜视频合成测试。")
# 3. 轮询到完成,拿到 video_url
python scripts/poll_task --id "$VIDEO_ID"
示例 2:定制数字人上传本地音频驱动
bash
python scripts/list_figures --source customised
AUDIO_FILE_ID=$(python scripts/upload_file \
--service make_video_audio \
--file ./input.wav)
VIDEO_ID=$(python scripts/create_task \
--person-id "C-ef91f3a6db3144ffb5d6c581ff13c7ec" \
--subtitle "hide" \
--audio-file-id "$AUDIO_FILE_ID")
python scripts/poll_task --id "$VIDEO_ID"
示例 3:显式下载最终视频
bash
python scripts/download_result \
--url "https://example.com/output.mp4"
下载是显式动作,不是默认动作:
poll_task 成功后应先返回 video_urldownload_result选择数字人时遵循这条规则:
list_figures --source commonlist_figures --source customised--figure-type <type>figure_type字幕遵循这条规则:
show 或 hidechanjing-one-click-video-creation 的 run_render.py 调用 create_task,以当次 workflow.json 根级 subtitle_required 为准( 默认 false → --subtitle hide; true → show 及推荐样式), 无需 为该一键成片路径再单独追问字幕开关,除非用户在需求里明确要求改字幕策略create_task --subtitle showcreate_task 在未传 --subtitle-color 时默认白字 color=#FFFFFF:1080p 为 x=31 y=1521 width=1000 height=200 font_size=64 stroke_width=7 asr_type=0;4K 画布为 x=80 y=2840 width=2000 height=1000 font_size=150 stroke_width=7 asr_type=0(两组均含 color=#FFFFFF)create_task --subtitle hide 或兼容旧用法 --hide-subtitle--subtitle-x / --subtitle-y / --subtitle-width / --subtitle-height / --subtitle-font-size / --subtitle-color / --subtitle-stroke-color / --subtitle-stroke-width / --subtitle-font-id / --subtitle-asr-typescreen_width / screen_height默认本地输出目录:
outputs/video-compose/更多接口细节见:
reference.mdexamples.md