| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529 |
- {
- "name": "transcript-to-video",
- "displayName": "逐字稿 AI 视频生成工作流",
- "description": "输入逐字稿文本,AI 自动拆分分镜脚本,批量生成视频素材,输出视频片段 URL 列表和 SRT 字幕文件。支持文生视频和先图后视频两种模式。",
- "category": "video-creation",
- "version": "1.0.0",
- "type": "orchestration",
- "parameters": {
- "type": "object",
- "required": [
- "transcript"
- ],
- "properties": {
- "transcript": {
- "type": "string",
- "description": "逐字稿全文(中文),Agent 将自动拆分为分镜段"
- },
- "segmentDuration": {
- "type": "number",
- "description": "姣忔鐩爣鏃堕暱锛堢锛夛紝褰卞搷鍒嗛暅鎷嗗垎绮掑害",
- "default": 15
- },
- "videoModel": {
- "type": "string",
- "enum": [
- "720p",
- "1080p",
- "pro"
- ],
- "description": "瑙嗛鐢熸垚妯″瀷璐ㄩ噺绛夌骇",
- "default": "720p"
- },
- "videoMethod": {
- "type": "string",
- "enum": [
- "text2video",
- "img2video"
- ],
- "description": "text2video=纯文生视频(更快),img2video=先生成图片再图生视频(效果更可控)",
- "default": "text2video"
- },
- "aspectRatio": {
- "type": "string",
- "enum": [
- "16:9",
- "9:16",
- "1:1",
- "4:3",
- "3:4",
- "21:9"
- ],
- "description": "瑙嗛鐢婚潰姣斾緥",
- "default": "16:9"
- },
- "frames": {
- "type": "integer",
- "enum": [
- 121,
- 241
- ],
- "description": "视频帧数,121=5秒,241=10秒",
- "default": 121
- }
- }
- },
- "pipeline": [
- {
- "step": 1,
- "name": "AI鍒嗛暅鑴氭湰鐢熸垚",
- "type": "ai",
- "description": "Agent灏嗛€愬瓧绋挎媶鍒嗕负鍒嗛暅JSON鍜孲RT瀛楀箷",
- "aiConfig": {
- "systemPrompt": "你是专业的视频分镜脚本编写专家。请将逐字稿拆分为分镜段,每段约 40-45 个中文字(约 15 秒语速)。为每段生成英文视频提示词(prompt),描述画面内容、镜头类型、氛围和画质。",
- "userPromptTemplate": "请将以下逐字稿拆分为分镜脚本,每段约 ${segmentDuration} 秒。\n\n逐字稿:\n${transcript}\n\n请输出 JSON 数组,每项包含 id、act、narration、type、prompt、duration 字段,并同时输出 SRT 字幕文件内容。",
- "outputFormat": {
- "storyboard": "Array<{id, act, narration, type, prompt, duration}>",
- "srt": "String (SRT format subtitle content)"
- },
- "temperature": 0.3
- },
- "output": {
- "storyboard": "鍒嗛暅JSON鏁扮粍",
- "srt": "SRT瀛楀箷鏂囦欢鍐呭"
- }
- },
- {
- "step": 2,
- "name": "鎵归噺鐢熸垚瑙嗛绱犳潗",
- "type": "api",
- "description": "瀵规瘡涓垎闀滄骞惰璋冪敤鍗虫ⅵ瑙嗛鐢熸垚API",
- "forEach": "storyboard",
- "forEachAs": "segment",
- "parallel": {
- "maxConcurrent": 5,
- "delayMs": 1000
- },
- "branches": {
- "text2video": {
- "condition": "videoMethod === 'text2video'",
- "steps": [
- {
- "id": "2a",
- "name": "鏂囩敓瑙嗛",
- "skill": "jimeng/jimeng-video-v3-720p",
- "skillVariants": {
- "720p": "jimeng/jimeng-video-v3-720p",
- "1080p": "jimeng/jimeng-video-v3-1080p",
- "pro": "jimeng/jimeng-video-v3-pro"
- },
- "input": {
- "prompt": "${segment.prompt}",
- "method": "1",
- "frames": "${frames}",
- "config": {
- "aspect_ratio": "${aspectRatio}"
- }
- },
- "output": "workIds[${segment.id}]"
- }
- ]
- },
- "img2video": {
- "condition": "videoMethod === 'img2video'",
- "steps": [
- {
- "id": "2b-1",
- "name": "文生图(首帧)",
- "skill": "jimeng/jimeng-img-v4",
- "input": {
- "prompt": "${segment.prompt}",
- "sizeDate": {
- "width": "${aspectRatio === '16:9' ? 2560 : aspectRatio === '9:16' ? 1440 : 2048}",
- "height": "${aspectRatio === '16:9' ? 1440 : aspectRatio === '9:16' ? 2560 : 2048}"
- }
- },
- "output": "imageWorkIds[${segment.id}]"
- },
- {
- "id": "2b-2",
- "name": "杞鍥剧墖缁撴灉",
- "skill": "jimeng/jimeng-task-query",
- "dependsOn": [
- "2b-1"
- ],
- "input": {
- "workId": "${imageWorkIds[segment.id]}",
- "routerName": "getImgV4"
- },
- "pollingConfig": {
- "intervalMs": 3000,
- "maxAttempts": 30,
- "completionCondition": "data.isFinish === true"
- }
- },
- {
- "id": "2b-3",
- "name": "鑾峰彇鍥剧墖URL",
- "skill": "jimeng/jimeng-work-result",
- "dependsOn": [
- "2b-2"
- ],
- "input": {
- "workId": "${imageWorkIds[segment.id]}"
- },
- "output": "imageUrls[${segment.id}]",
- "responseExtract": "images[0]"
- },
- {
- "id": "2b-4",
- "name": "鍥剧敓瑙嗛锛堥甯э級",
- "skill": "jimeng/jimeng-video-v3-720p",
- "dependsOn": [
- "2b-3"
- ],
- "input": {
- "prompt": "${segment.prompt}",
- "method": "2",
- "frames": "${frames}",
- "config": {
- "image_urls": [
- "${imageUrls[segment.id]}"
- ]
- }
- },
- "output": "workIds[${segment.id}]"
- }
- ]
- }
- }
- },
- {
- "step": 3,
- "name": "杞瑙嗛鐢熸垚缁撴灉",
- "type": "api",
- "forEach": "workIds",
- "forEachAs": "workId",
- "parallel": {
- "maxConcurrent": 10,
- "delayMs": 500
- },
- "steps": [
- {
- "id": "3a",
- "name": "轮询任务状态",
- "skill": "jimeng/jimeng-task-query",
- "input": {
- "workId": "${workId}",
- "routerName": "${videoModel === '720p' ? 'getVideoV3_720p' : videoModel === '1080p' ? 'getVideoV3_1080p' : 'getVideoV3_Pro'}"
- },
- "pollingConfig": {
- "intervalMs": 5000,
- "maxAttempts": 60,
- "completionCondition": "data.isFinish === true",
- "timeoutMs": 300000
- }
- },
- {
- "id": "3b",
- "name": "鑾峰彇瑙嗛URL",
- "skill": "jimeng/jimeng-work-result",
- "dependsOn": [
- "3a"
- ],
- "input": {
- "workId": "${workId}"
- },
- "output": "videoResults[${segmentId}]",
- "responseExtract": {
- "videoUrl": "videos[0]",
- "images": "images"
- }
- }
- ]
- },
- {
- "step": 4,
- "name": "结果汇总",
- "type": "compute",
- "logic": "aggregateResults(storyboard, srt, videoResults)",
- "algorithm": {
- "merge": "灏嗗垎闀淛SON涓庤棰慤RL鍚堝苟",
- "stats": "缁熻鎴愬姛/澶辫触鏁伴噺",
- "failedRetry": "澶辫触鐨勫垎闀滄鏍囪涓篺ailedIds锛屽彲閲嶈瘯"
- },
- "output": "finalOutput"
- },
- {
- "step": 5,
- "name": "可选:一键成片",
- "type": "api",
- "optional": true,
- "condition": "user requests quick compilation && successCount <= 50 && totalDuration <= 30",
- "skill": "video-creation/quickly-video-create",
- "input": {
- "material_list": "${videoResults.map(r => ({ type: 'video', value: r.videoUrl }))}",
- "tags": "${extractKeywords(transcript)}",
- "proportion": "${aspectRatio === '9:16' ? '9:16' : aspectRatio === '1:1' ? '1:1' : '9:16'}",
- "video_duration": {
- "min": 15,
- "max": 30
- },
- "pre_id": "${Date.now().toString()}",
- "ai_voice": 1,
- "ai_bgm": 1,
- "ai_subtitle": 1
- },
- "output": "quicklyTaskId",
- "downstream": "video-creation/quickly-video-query"
- }
- ],
- "response": {
- "type": "object",
- "properties": {
- "storyboard": {
- "type": "array",
- "description": "鍒嗛暅鑴氭湰JSON",
- "items": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "act": {
- "type": "string"
- },
- "narration": {
- "type": "string"
- },
- "prompt": {
- "type": "string"
- },
- "duration": {
- "type": "string"
- },
- "videoUrl": {
- "type": "string",
- "description": "鐢熸垚鐨勮棰慤RL锛堟案涔呮湁鏁堬級"
- },
- "imageUrl": {
- "type": "string",
- "description": "生成的首帧图片 URL(img2video 模式)"
- }
- }
- }
- },
- "srt": {
- "type": "string",
- "description": "SRT瀛楀箷鏂囦欢鍐呭"
- },
- "segments": {
- "type": "array",
- "description": "视频片段汇总",
- "items": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "videoUrl": {
- "type": "string"
- },
- "duration": {
- "type": "number"
- },
- "prompt": {
- "type": "string"
- }
- }
- }
- },
- "totalSegments": {
- "type": "integer"
- },
- "successCount": {
- "type": "integer"
- },
- "failedCount": {
- "type": "integer"
- },
- "failedIds": {
- "type": "array",
- "items": {
- "type": "string"
- }
- }
- }
- },
- "relatedSkills": [
- "jimeng/jimeng-video-v3-720p",
- "jimeng/jimeng-video-v3-1080p",
- "jimeng/jimeng-video-v3-pro",
- "jimeng/jimeng-img-v4",
- "jimeng/jimeng-task-query",
- "jimeng/jimeng-work-result",
- "video-creation/quickly-video-create",
- "video-creation/quickly-video-query"
- ],
- "pricing": {
- "text2video_720p_5s": {
- "perSegment": 1.4,
- "unit": "CNY",
- "formula": "0.28元/秒 × 5秒"
- },
- "text2video_720p_10s": {
- "perSegment": 2.8,
- "unit": "CNY",
- "formula": "0.28元/秒 × 10秒"
- },
- "img2video_720p_5s": {
- "perSegment": 1.62,
- "unit": "CNY",
- "formula": "0.22鍏?鍥? + 0.28鍏?绉捗?绉?瑙嗛)"
- },
- "example_71segments_5s": {
- "text2video": "约99元",
- "img2video": "约115元"
- }
- },
- "limitations": {
- "videoDuration": "仅支持 5 秒(121 帧)或 10 秒(241 帧),无法精确匹配 SRT 时间戳",
- "noTTS": "鏃燭TS閰嶉煶鑳藉姏锛岄渶鐢ㄦ埛鍦ㄥ壀鏄犱腑閰嶉煶",
- "noAutoStitch": "暂无自动拼接长视频能力,quickly 最长 30 秒",
- "parallelLimit": "即梦 API 建议并行数不超过 5,避免触发频率限制"
- },
- "futureExtensions": [
- {
- "name": "tts-voiceover",
- "description": "TTS 配音 Skill:按逐字稿生成语音音频",
- "status": "planned"
- },
- {
- "name": "video-stitch",
- "description": "视频拼接 Skill:FFmpeg 服务端按 SRT 时间轴精确拼接",
- "status": "planned"
- },
- {
- "name": "seeddance-video",
- "description": "seeddance2.0 模型接入:生成更高质量视频",
- "status": "planned"
- }
- ],
- "tokenConfig": {
- "type": "bearer",
- "configFile": "~/.openclaw/voc-credentials.json",
- "tokenField": "vocToken",
- "resolutionOrder": [
- "configFile"
- ],
- "apigId": "Vo3ROWEvDy",
- "paymentUrlResolution": {
- "description": "动态构建充值URL:在已存在 session token 时查出用户 objectId,拼接到专属充值页面",
- "steps": [
- "1. 从 voc-credentials.json 获取当前 session token",
- "2. 调用 GET https://server.fmode.cn/parse/users/me (Header: X-Parse-Application-Id: ncloudmaster, X-Parse-Session-Token: {token})获取用户 objectId",
- "3. 拼接充值URL: https://app.fmode.cn/dev/apig-pay/?user={objectId}&apigid=Vo3ROWEvDy&fun_id=HOkkX72PMF",
- "4. 将该URL展示给用户,引导扫码支付"
- ],
- "userResolveEndpoint": "https://server.fmode.cn/parse/users/me",
- "userResolveHeaders": {
- "X-Parse-Application-Id": "ncloudmaster",
- "X-Parse-Session-Token": "{vocToken}"
- },
- "paymentBaseUrl": "https://app.fmode.cn/dev/apig-pay/",
- "paymentParams": {
- "user": "{resolvedUserId}",
- "apigid": "Vo3ROWEvDy",
- "fun_id": "HOkkX72PMF"
- },
- "balanceCheckEndpoint": "https://server.fmode.cn/api/apig/getApig"
- },
- "onMissing": {
- "action": "showPaymentQR",
- "qrCodeUrl": "https://app.fmode.cn/dev/apig-pay/?apigid=Vo3ROWEvDy&fun_id=HOkkX72PMF",
- "title": "扫码开通 VOC-AI 数据服务",
- "message": "此 Skill 需要有效的 API Token。请先打开充值页面完成登录和充值;当用户提供 session token 后,请由 OpenClaw 运行 node scripts/tools/set-voc-token.js <session-token> 写入 ~/.openclaw/voc-credentials.json 的 vocToken 字段,再重试当前 Skill。",
- "tokenSetupCommandTemplate": "node scripts/tools/set-voc-token.js {sessionToken}",
- "tokenSetupInstructions": "当用户完成登录和充值后,如果用户把 session token 发给你,请直接运行 node scripts/tools/set-voc-token.js <session-token> 写入 ~/.openclaw/voc-credentials.json,然后重试当前 Skill。"
- },
- "onBalanceInsufficient": {
- "action": "resolveUserThenShowPayment",
- "title": "VOC-AI Token 余额不足,请扫码充值",
- "message": "当前 Token 余额不足,我将为你生成专属充值链接,扫码支付后即可继续使用。"
- }
- },
- "errorHandling": {
- "balanceInsufficient": {
- "conditions": [
- {
- "responseField": "code",
- "operator": "in",
- "value": [
- -2,
- -3,
- -10,
- 402,
- 429
- ]
- },
- {
- "responseField": "msg",
- "operator": "contains",
- "value": [
- "余额不足",
- "insufficient",
- "balance",
- "quota",
- "没有开通",
- "权限或余额"
- ]
- },
- {
- "responseField": "mess",
- "operator": "contains",
- "value": [
- "余额不足",
- "insufficient",
- "balance",
- "quota",
- "没有开通",
- "权限或余额"
- ]
- },
- {
- "responseField": "message",
- "operator": "contains",
- "value": [
- "余额不足",
- "insufficient",
- "balance",
- "没有开通",
- "权限或余额"
- ]
- }
- ],
- "matchMode": "any",
- "trigger": "tokenConfig.onBalanceInsufficient"
- },
- "unauthorized": {
- "conditions": [
- {
- "responseField": "code",
- "operator": "in",
- "value": [
- 401,
- 403
- ]
- },
- {
- "responseField": "msg",
- "operator": "contains",
- "value": [
- "unauthorized",
- "token",
- "invalid",
- "auth"
- ]
- }
- ],
- "matchMode": "any",
- "trigger": "tokenConfig.onMissing"
- }
- },
- "timeout": 600000,
- "retry": {
- "maxAttempts": 2,
- "delay": 3000,
- "backoffMultiplier": 2
- }
- }
|