跳到正文
cccskills
免费在 GitHub 公开

iflytek-video-translate

Use when user asks to translate videos, dub video content, or localize videos into other languages. Translate videos with AI-powered dubbing using iFlytek (Xfei) Video Translation API. Supports video language translation, voice dubbing, multilingual video localization, 视频翻译, 视频配音, 视频本地化. Features task creation, task list, task details retrieval. Ideal for content creators and localization teams.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(4)

  • SKILL.md7.6 KB
  • _meta.json62 B
  • README.md2.7 KB
  • scripts/xfei_video_translate.py16.5 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Xfei Video Translation

Translate videos with AI-powered dubbing using iFlytek's Video Translation service.

API Endpoints

Base URL: https://spark-api-test.xf-yun.com/api/v1/video-translate

EndpointMethodDescription
/tasksPOSTCreate video translation task
/tasksGETList all tasks
/tasks/:taskIdGETGet task details

Features

  • Video Translation: Translate video audio to different languages
  • AI Dubbing: Generate natural-sounding voiceovers
  • Multi-language: Support for English, Chinese, Japanese, Korean, etc.
  • Task Management: Create tasks, list tasks, get task details
  • Lip Sync: Automatic face matching for translated audio

Usage Scenarios

Scenario 1: Create Video Translation Task

Submit a video for translation.

Use this when: User provides a video URL and wants to translate it.

# Create task - translate English video to Chinese
python3 scripts/xfei_video_translate.py --action create_task \
    --file_url "https://example.com/video.mp4" \
    --src_lang en --dest_lang zh

# Translate Chinese to English
python3 scripts/xfei_video_translate.py --action create_task \
    --file_url "https://example.com/video.mp4" \
    --src_lang zh --dest_lang en

# Translate Japanese to Chinese
python3 scripts/xfei_video_translate.py --action create_task \
    --file_url "https://example.com/video.mp4" \
    --src_lang ja --dest_lang zh

Scenario 2: List All Tasks

View all video translation tasks.

Use this when: User wants to see all translation tasks.

# List all tasks
python3 scripts/xfei_video_translate.py --action list_tasks

Scenario 3: Get Task Details

View detailed information about a specific task.

Use this when: User wants to check the status and details of a specific task.

# Get task details
python3 scripts/xfei_video_translate.py --action get_task \
    --task_id "xxx-xxx-xxx"

Setup

1. Install Dependency

pip install requests>=2.31.0

2. Configure Environment Variables

export IFLY_API_KEY="your_api_key"
export IFLY_API_SECRET="your_api_secret"

兼容说明:设置任意 IFLY_* 凭证变量(包括空值)后,仅使用该组,缺项报错;未设置标准组时,依次尝试 XFYUN_*、XFEI_*,不跨组拼接。旧前缀会在 stderr 输出一次不含凭证值的迁移提示。

Parameters

create_task (POST /tasks)

ParameterTypeRequiredDescription
--file_url / -ustringYesVideo file OSS URL (视频文件 OSS 地址)
--src_lang / -fstringYesSource language code (e.g., en, zh, ja, ko)
--dest_lang / -tstringYesTarget language code

list_tasks (GET /tasks)

No parameters required.

get_task (GET /tasks/:taskId)

ParameterTypeRequiredDescription
--task_id / -istringYesTask ID

Response Format

Standard response: {"code": 0, "message": "success", "request_id": "xxx", "data": {}}

create_task Response (data)

{
  "task_id": "xxx-xxx-xxx",
  "status": "waiting_parsing",
  "created_at": "2025-01-17T10:30:45Z"
}

list_tasks Response (data)

[
  {
    "task_id": "xxx-xxx-xxx",
    "task_name": "我的翻译任务",
    "status": "completed",
    "src_lang": "en",
    "dest_lang": "zh",
    "created_at": "2025-01-17T10:30:45Z",
    "updated_at": "2025-01-17T11:30:45Z"
  }
]

get_task Response (data)

{
  "task_id": "xxx-xxx-xxx",
  "task_name": "我的翻译任务",
  "status": "completed",
  "created_at": "2025-01-17T10:30:45Z",
  "updated_at": "2025-01-17T11:30:45Z",
  "task_params": {
    "file_url": "https://example.com/video.mp4",
    "src_lang": "en",
    "dest_lang": "zh"
  },
  "output": {
    "subtitle_url": "https://example.com/output.srt",
    "output_video_url": "https://example.com/output.mp4"
  }
}

Task Status Values

StatusDescription
runningTask in progress
completedTask completed successfully
failedTask failed
cancelledTask cancelled
waiting_manual_intervention_segmentWaiting for transcript editing
waiting_manual_intervention_refineWaiting for translation editing

Language Codes

CodeLanguage
zhChinese (中文)
enEnglish (英文)
jaJapanese (日文)
koKorean (韩文)
ruRussian (俄文)
frFrench (法文)
arArabic (阿拉伯语)
esSpanish (西班牙语)
yueCantonese (粤语)

Input Video Requirements

  • Format: MP4
  • Duration: Max 5 minutes
  • Resolution: 720p - 4k
  • FPS: Recommended 25
  • Audio: Single audio track only

Error Handling

ErrorCauseSolution
IFLY_API_KEY and IFLY_API_SECRET are requiredNo credentials configuredSet environment variables
--file_url is requiredNo video URL providedProvide valid OSS video URL
--task_id is requiredNo task ID providedProvide valid task ID
API error XXXXRequest failedCheck message in response

鉴权失败错误提示 (๑•̀ㅂ•́)و✧

哎呀呀~遇到鉴权错误啦! (⊙_⊙) 快来看看是哪里出问题了吧~

HTTP Code错误描述原因处理建议
401{"message":"Unauthorized"}缺少 authorization 参数哎呀~检查一下有没有正确带上传入的 authorization 参数哦~
401{"message":"HMAC signature cannot be verified"}签名参数解析失败嗯嗯~ (°∀°)ノ 检查一下各签名参数是否完整,确认 APIKey 是不是正确呀~
401{"message":"HMAC signature does not match"}签名校验失败嘿呀~ (。•́︿•̀。) 检查一下 APIKey/APISecret 是否正确呢~还要看看 host、date、request-line 拼接对不对哦~signature 的 Base64 长度正常应该是 44 字节呢~
403{"message":"HMAC signature cannot be verified, a valid date or x-date header is required"}时钟偏移校验失败嗯嗯? (⊙_⊙) 服务器时钟可能有偏差哦~偏差超过 300 秒就会被拒绝啦!快去校准一下时间吧~

小贴士 💡:

  • 如果遇到签名不匹配的错误,首先检查 APIKey 和 APISecret 是否正确~
  • 确保服务器的日期时间准确,偏差太大会导致 403 错误哦~
  • 签名中的 path 需要和实际请求的路径完全一致才可以呢~

Tips

  1. Video URL: Must be an OSS (Aliyun Object Storage Service) URL accessible by iFlytek
  2. Task status: Use get_task to check task progress
  3. Completed tasks: When status is "completed", the output_video_url contains the translated video
  4. Manual intervention: Some videos may require human review for transcript or translation

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

生成"黑墨手绘涂鸦"风格的动画架构图/流程图:米色纸面、针管笔墨线、极淡水洗色块、简笔涂鸦图标、序号章、连线上的流动圆点动画、图标微动效。产出单文件自包含动画 HTML(SVG+CSS),可一键导出无缝循环 GIF。当用户想画架构图、流程图、信息图、技术示意图、对比图、pipeline/workflow 可视化,或提到"手绘风""涂鸦风""动图""animated diagram""GIF 架构图"时使用;即使用户没明说要动画,做技术概念科普配图时也应优先考虑本 skill。

中文简介正在准备中。当前显示原文说明。

iflytek/iFly-Skills2122026年10月15日 更新

Use when user asks to review contracts, detect contract risks, or perform compliance checks. 合同智能审核 - 对合同扫描件、图片合同、双语合同进行完整审核。 覆盖 OCR 识别、条款分析、风险检测、合规校对、翻译摘要全流程。 适用于法务审核、采购合同审查、供应链合规检查等场景。 关键词:合同审核、风险检测、条款分析、合规校对、contract review、risk detection。

中文简介正在准备中。当前显示原文说明。

iflytek/iFly-Skills2122026年10月15日 更新

Use when user asks to synthesize speech, convert text to audio, or read text aloud. 讯飞超拟人语音合成 - 支持文本转语音、语音合成(发音人/语速/语调/音量/输出格式)。大模型语音合成技能。语音合成, 文字转语音, 超拟人, TTS.

中文简介正在准备中。当前显示原文说明。

iflytek/iFly-Skills2122026年10月15日 更新

Use when user asks to analyze an image, describe image contents, or answer questions about a picture. iFlytek Image Understanding (图片理解) — analyze and answer questions about images using Spark Vision model. WebSocket API, pure Python stdlib, no pip dependencies.

中文简介正在准备中。当前显示原文说明。

iflytek/iFly-Skills2122026年10月15日 更新

Use when user asks to recognize invoices, extract receipt data, or OCR bills and tickets. Recognize and extract structured data from invoices, receipts, and bills using iFlytek OCR API (科大讯飞票据识别). Supports VAT invoices, taxi receipts, train tickets, toll invoices, medical bills, bank receipts, and more.

中文简介正在准备中。当前显示原文说明。

iflytek/iFly-Skills2122026年10月15日 更新

ifly-pdf-image-ocr skill supporting both image OCR (AI-powered LLM OCR) and PDF document recognition. Use when user asks to OCR images, extract text from images/PDFs, convert PDF to Word/Markdown, or perform any OCR tasks on images or PDFs. Supports multi-language text extraction, document layout understanding, and various output formats.

中文简介正在准备中。当前显示原文说明。

iflytek/iFly-Skills2122026年10月15日 更新

查看 iflytek 的全部技能

报告此技能的问题