transloadit-media-processing
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTransloadit Media Processing
Transloadit媒体处理
Process, transform, and encode media files using Transloadit's cloud infrastructure.
Supports video, audio, images, and documents with 86+ specialized processing robots.
借助Transloadit的云基础设施处理、转换和编码媒体文件。支持视频、音频、图片和文档,配备86+个专用处理机器人。
When to Use This Skill
何时使用该工具
Use this skill when you need to:
- Encode video to HLS, MP4, WebM, or other formats
- Generate thumbnails or animated GIFs from video
- Resize, crop, watermark, or optimize images
- Convert between image formats (JPEG, PNG, WebP, AVIF, HEIF)
- Extract or transcode audio (MP3, AAC, FLAC, WAV)
- Concatenate video or audio clips
- Add subtitles or overlay text on video
- OCR documents (PDF, scanned images)
- Run speech-to-text or text-to-speech
- Apply AI-based content moderation or object detection
- Build multi-step media pipelines that chain operations together
当你需要完成以下操作时,可使用本工具:
- 将视频编码为HLS、MP4、WebM或其他格式
- 从视频中生成缩略图或动态GIF
- 调整图片大小、裁剪、添加水印或优化图片
- 在不同图片格式间转换(JPEG、PNG、WebP、AVIF、HEIF)
- 提取或转码音频(MP3、AAC、FLAC、WAV)
- 拼接视频或音频剪辑
- 为视频添加字幕或叠加文字
- 对文档(PDF、扫描图片)进行OCR识别
- 运行语音转文字或文字转语音
- 应用基于AI的内容审核或目标检测
- 构建可串联多个操作的多步骤媒体处理流程
Setup
设置步骤
Option A: MCP Server (recommended for Copilot)
选项A:MCP服务器(推荐给Copilot使用)
Add the Transloadit MCP server to your IDE config. This gives the agent direct access
to Transloadit tools (, , , etc.).
create_templatecreate_assemblylist_assembly_notificationsVS Code / GitHub Copilot ( or user settings):
.vscode/mcp.jsonjson
{
"servers": {
"transloadit": {
"command": "npx",
"args": ["-y", "@transloadit/mcp-server", "stdio"],
"env": {
"TRANSLOADIT_KEY": "YOUR_AUTH_KEY",
"TRANSLOADIT_SECRET": "YOUR_AUTH_SECRET"
}
}
}
}Get your API credentials at https://transloadit.com/c/-/api-credentials
将Transloadit MCP服务器添加到你的IDE配置中。这将让Agent可以直接访问Transloadit工具(、、等)。
create_templatecreate_assemblylist_assembly_notificationsVS Code / GitHub Copilot(或用户设置):
.vscode/mcp.jsonjson
{
"servers": {
"transloadit": {
"command": "npx",
"args": ["-y", "@transloadit/mcp-server", "stdio"],
"env": {
"TRANSLOADIT_KEY": "YOUR_AUTH_KEY",
"TRANSLOADIT_SECRET": "YOUR_AUTH_SECRET"
}
}
}
}Option B: CLI
选项B:CLI
If you prefer running commands directly:
bash
npx -y @transloadit/node assemblies create \
--steps '{"encoded": {"robot": "/video/encode", "use": ":original", "preset": "hls-1080p"}}' \
--wait \
--input ./my-video.mp4如果你偏好直接运行命令:
bash
npx -y @transloadit/node assemblies create \
--steps '{"encoded": {"robot": "/video/encode", "use": ":original", "preset": "hls-1080p"}}' \
--wait \
--input ./my-video.mp4Core Workflows
核心工作流程
Encode Video to HLS (Adaptive Streaming)
将视频编码为HLS(自适应流)
json
{
"steps": {
"encoded": {
"robot": "/video/encode",
"use": ":original",
"preset": "hls-1080p"
}
}
}json
{
"steps": {
"encoded": {
"robot": "/video/encode",
"use": ":original",
"preset": "hls-1080p"
}
}
}Generate Thumbnails from Video
从视频生成缩略图
json
{
"steps": {
"thumbnails": {
"robot": "/video/thumbs",
"use": ":original",
"count": 8,
"width": 320,
"height": 240
}
}
}json
{
"steps": {
"thumbnails": {
"robot": "/video/thumbs",
"use": ":original",
"count": 8,
"width": 320,
"height": 240
}
}
}Resize and Watermark Images
调整图片大小并添加水印
json
{
"steps": {
"resized": {
"robot": "/image/resize",
"use": ":original",
"width": 1200,
"height": 800,
"resize_strategy": "fit"
},
"watermarked": {
"robot": "/image/resize",
"use": "resized",
"watermark_url": "https://example.com/logo.png",
"watermark_position": "bottom-right",
"watermark_size": "15%"
}
}
}json
{
"steps": {
"resized": {
"robot": "/image/resize",
"use": ":original",
"width": 1200,
"height": 800,
"resize_strategy": "fit"
},
"watermarked": {
"robot": "/image/resize",
"use": "resized",
"watermark_url": "https://example.com/logo.png",
"watermark_position": "bottom-right",
"watermark_size": "15%"
}
}
}OCR a Document
对文档进行OCR识别
json
{
"steps": {
"recognized": {
"robot": "/document/ocr",
"use": ":original",
"provider": "aws",
"format": "text"
}
}
}json
{
"steps": {
"recognized": {
"robot": "/document/ocr",
"use": ":original",
"provider": "aws",
"format": "text"
}
}
}Concatenate Audio Clips
拼接音频剪辑
json
{
"steps": {
"imported": {
"robot": "/http/import",
"url": ["https://example.com/clip1.mp3", "https://example.com/clip2.mp3"]
},
"concatenated": {
"robot": "/audio/concat",
"use": "imported",
"preset": "mp3"
}
}
}json
{
"steps": {
"imported": {
"robot": "/http/import",
"url": ["https://example.com/clip1.mp3", "https://example.com/clip2.mp3"]
},
"concatenated": {
"robot": "/audio/concat",
"use": "imported",
"preset": "mp3"
}
}
}Multi-Step Pipelines
多步骤处理流程
Steps can be chained using the field. Each step references a previous step's output:
"use"json
{
"steps": {
"resized": {
"robot": "/image/resize",
"use": ":original",
"width": 1920
},
"optimized": {
"robot": "/image/optimize",
"use": "resized"
},
"exported": {
"robot": "/s3/store",
"use": "optimized",
"bucket": "my-bucket",
"path": "processed/${file.name}"
}
}
}可通过字段将多个步骤串联起来。每个步骤可引用上一个步骤的输出:
"use"json
{
"steps": {
"resized": {
"robot": "/image/resize",
"use": ":original",
"width": 1920
},
"optimized": {
"robot": "/image/optimize",
"use": "resized"
},
"exported": {
"robot": "/s3/store",
"use": "optimized",
"bucket": "my-bucket",
"path": "processed/${file.name}"
}
}
}Key Concepts
核心概念
- Assembly: A single processing job. Created via (MCP) or
create_assembly(CLI).assemblies create - Template: A reusable set of steps stored on Transloadit. Created via (MCP) or
create_template(CLI).templates create - Robot: A processing unit (e.g., ,
/video/encode). See full list at https://transloadit.com/docs/transcoding//image/resize - Steps: JSON object defining the pipeline. Each key is a step name, each value configures a robot.
- : Refers to the uploaded input file.
:original
- Assembly:单个处理任务。可通过(MCP)或
create_assembly(CLI)创建。assemblies create - Template:存储在Transloadit上的可复用步骤集合。可通过(MCP)或
create_template(CLI)创建。templates create - Robot:处理单元(例如、
/video/encode)。完整列表请访问https://transloadit.com/docs/transcoding//image/resize - Steps:定义处理流程的JSON对象。每个键为步骤名称,对应的值用于配置机器人。
- :指代上传的输入文件。
:original
Tips
小贴士
- Use with the CLI to block until processing completes.
--wait - Use values (e.g.,
preset,"hls-1080p","mp3") for common format targets instead of specifying every parameter."webp" - Chain to build multi-step pipelines without intermediate downloads.
"use": "step_name" - For batch processing, use to pull files from URLs, S3, GCS, Azure, FTP, or Dropbox.
/http/import - Templates can include for dynamic values passed at assembly creation time.
${variables}
- 在CLI中使用参数,可阻塞等待处理完成。
--wait - 针对常见格式目标,使用值(例如
preset、"hls-1080p"、"mp3"),而非手动指定所有参数。"webp" - 通过串联步骤,无需下载中间文件即可构建多步骤流程。
"use": "step_name" - 如需批量处理,可使用从URL、S3、GCS、Azure、FTP或Dropbox拉取文件。
/http/import - 模板可包含变量,用于在创建Assembly时传入动态值。
${variables}