{ "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": "body", "tokenField": "token", "format": "Bearer r:{{jimengToken}}", "configFile": "~/.openclaw/voc-credentials.json", "currentToken": "Bearer r:f0333969e312a40e4703e8fe4ed1c600", "resolutionOrder": ["configFile", "currentToken"], "onMissing": { "action": "showPaymentQR", "qrCodeUrl": "https://app.fmode.cn/dev/apig-pay/?authid=T0iOotHcDX&fun_id=HOkkX72PMF", "paymentCheckEndpoint": "https://server.fmode.cn/api/apig/getApig", "pollingIntervalMs": 3000, "pollingTimeoutMs": 300000, "onPaymentSuccess": "retrySkillWithNewToken", "title": "鎵爜寮€閫氬嵆姊I瑙嗛鐢熸垚鏈嶅姟", "message": "请扫描下方二维码完成支付,支付成功后将自动获取新 Token 并继续执行。" }, "onBalanceInsufficient": { "action": "showPaymentQR", "qrCodeUrl": "https://app.fmode.cn/dev/apig-pay/?authid=T0iOotHcDX&fun_id=HOkkX72PMF", "paymentCheckEndpoint": "https://server.fmode.cn/api/apig/getApig", "pollingIntervalMs": 3000, "pollingTimeoutMs": 300000, "onPaymentSuccess": "retrySkillWithNewToken", "title": "即梦 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"] } ], "matchMode": "any", "trigger": "tokenConfig.onBalanceInsufficient" }, "segmentFailed": { "action": "markFailed", "description": "鍗曚釜鍒嗛暅娈电敓鎴愬け璐ユ椂鏍囪涓篺ailed锛屼笉闃诲鍏朵粬娈碉紝鏈€鍚庢眹鎬诲け璐ュ垪琛ㄤ緵閲嶈瘯" } }, "timeout": 600000, "retry": { "maxAttempts": 2, "delay": 3000, "backoffMultiplier": 2 } }