← 返回
内容创作 Key 中文

magic-text2video

Create a text-to-video job from user-provided copy. Submits to the remote video service via one API key.
根据用户文案创建文本转视频任务,通过单一API密钥提交至远程视频服务。
zhangyuangao
内容创作 clawhub v1.0.2 1 版本 100000 Key: 需要
★ 0
Stars
📥 649
下载
💾 10
安装
1
版本
#latest

概述

Text to Video Skill

Create a video generation task from text. The job is submitted immediately; Polling to obtain task status and video URL.

When to Use

USE this skill when:

  • "把这段文字生成视频"
  • "帮我把这段文案做成视频"
  • "用这段文字生成一个视频"
  • User provides a script or paragraph and asks to turn it into video

When NOT to Use

DON'T use this skill when:

  • User asks for video editing, trimming, or effects → use video-editing tools
  • User asks for screen recording or capture → use recording tools
  • User asks only for video status of an existing job → explain where to find files instead

Prerequisites

export MAGIC_API_KEY="your-key"

MAGIC_API_KEY is required by the remote video service client.


Overall Flow (Agent Guidance)

  1. Extract the full text from the user's message, denoted as TEXT (i.e., the script to be used for video generation).
  2. Use the video-create subcommand to create a task, read the JSON from stdout, and extract the task_id.
  3. Explicitly inform the user of the task_id in the chat (optionally include the original JSON output for debugging).
  4. Use the video-wait subcommand with the task_id as --task-id, polling until successful.
  5. video-wait 的 stdout 中提取 video_url.
  6. Explicitly inform the user of the final video_url in the chat (you may also include the original output).

Python Client (Step-by-step with Chat Output)

Step 1: Create a video task and print the task_id to the chat

  1. Extract the text the user wants to generate a video from and assign it to TEXT.
    • If the text contains double quotes ", properly escape them before constructing the command (for example, by replacing " with \") to avoid shell parsing errors.
  1. Run the following command (executed by the agent/tool; {baseDir} will be replaced with the Skill directory):
python3 {baseDir}/scripts/media_gen_client.py video-create \
  --text  "TEXT"
  1. Read the stdout from this command. The expected output will be JSON, for example:
  2.    {
        "biz_code": 10000,
        "msg": "Success",
        "data": {
            "task_id": "2032443088023777280"
        },
        "trace_id": "664c6e22-1edd-11f1-bf4c-8262dce7d13f"
      }
    
  1. Parse the task_id from stdout (e.g., "abc-123"), and inform the user in the chat: "A text-to-video task has been created, task_id: abc-123. I will keep polling for the task status, and send you the video URL once it is ready."

Step 2: Poll the task until success and output video_url in the chat

  1. Use the task_id obtained in the previous step and refer to it as task_id.
  1. Run the following command to poll the task status (check every 10 seconds and wait up to 600 seconds); if it times out, wait a while and retry:
  2. python3 {baseDir}/scripts/media_gen_client.py video-wait --task-id YOUR_TASK_ID --poll 10 --timeout 600
    
  1. Read the stdout from this command. When the task succeeds, the script should output information including the video_url, for example:
  2.    {
        "biz_code": 10000,
        "msg": "Success",
        "data": {
            "task_id": "1234567890",
            "task_status": 2,
            "video_url": "https://www.magiclight.com/examplevideo.mp4"
        },
        "trace_id": "c89aeca8-1edd-11f1-bf4c-8262dce7d13f"
    }
    
  1. Parse the key fields from stdout:
    • status (e.g., 2)
    • video_url (e.g., "https://example.com/path/to/video.mp4")
  1. In the chat, respond to the user as follows:
    • Optionally (but recommended for debugging), first display the full JSON output inside a code block.
    • Then summarize the key information in natural language, for example:

> "Task completed ✅

> task_id: abc-123

> Video URL: https://example.com/path/to/video.mp4"

  1. If the stdout indicates that the task failed or timed out (for example, if the status is "failed" or there is no video_url):
    • Explain the reason for failure in the chat (include any error message, if available).
    • Inform the user that they can retry later, or check their input, quota, etc.

Expected Script Output Contract

  • The agent must always:
  • Parse the stdout JSON.
  • Clearly communicate the task_id and video_url to the user in the chat.
  • If necessary, optionally display the raw JSON output in a code block.

版本历史

共 1 个版本

  • v1.0.2 当前
    2026-03-19 07:59 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

content-creation

YouTube

byungkyu
使用托管OAuth集成YouTube Data API,支持搜索视频、管理播放列表、获取频道数据及评论互动,适用于用户需要时使用此技能。
★ 142 📥 41,077
content-creation

Humanizer

biostartechnology
消除AI写作痕迹,使文本更自然真实。基于维基百科"AI写作特征"指南,识别并修正夸张象征、宣传用语、肤浅-ing分析、模糊归因、破折号滥用、三项排比、AI词汇、负面平行结构及冗长连接词等模式。
★ 860 📥 199,873
content-creation

Baidu Wenku AIPPT

ide-rea
使用百度文库 AI 智能生成 PPT,自动根据内容选择模板。
★ 66 📥 46,208