Skip to content

Media AI Agent Quick Start โ€‹

Updated

Pass a video file and editing instructions, and the Vega Agent performs segment editing, subtitle processing, and rendering. The example below is a task that concatenates video A โ†’ video B.

1. Input Videos and Result โ€‹

The two videos are 3 seconds assets each extracted from a Vega Pro generated video.

Video A / Candy Village / 3 seconds

Video B / Character Close-up / 3 seconds

Production Instructions

text
After the full 3 seconds of video A, concatenate the full 3 seconds of video B.
Keep the original audio and do not add separate music or narration.
Add the subtitle "Sweet World" to A and "Today's Star" to B.
The finished video is 6 seconds, landscape 1920ร—1080.

Editing Result / A 0โ€“3 seconds โ†’ B 3โ€“6 seconds

Download Video A / Download Video B / Download Final Video

2. Attaching Videos to the Request โ€‹

Put the video address in the metadata.attachments array of mixcut_assets. When using two videos, add two entries, and specify the editing order in the production instructions.

json
{
  "type": "mixcut_assets",
  "metadata": {
    "attachments": [
      {"url": ""},
      {"url": ""}
    ]
  }
}
Asset You HaveHow to Pass It
Accessible video URL{"url":"video URL"}
Video registered in VOD{"fileId":"VOD file ID"} / a file in the same application as the API key
Video file on your PCUpload it to COS or VOD first, then pass the URL or fileId

Put only one of url or fileId in a single entry. Even if you put a PC file path in url, the file will not be uploaded.

3. Running the Example โ€‹

Issue a API key with the SubAppId of the VOD application you want to use, and set it in VOD_API_TOKEN. How to Obtain a Key

bash
export VOD_API_TOKEN='your issued ApiToken'
curl -fsS  -o agent-join-example.sh
bash agent-join-example.sh

The run script attaches the two videos above and sends the request with a new conversation / run ID each time. You can find the prompt and the attachment positions in the full request JSON.

4. Checking the Result โ€‹

During the run, the response and task status are output in order. Open the video URL included in the final message and the rendering tool result to check the result.

Next StepDocument
Editing with your own video / Subtitles / Voice configurationVideo โ†’ Vega Agent
Receiving results from the service / Restoring history / CancellingAPI Reference
Searching and asking questions in the video libraryMedia Understanding โ†’ Vega Agent

Built with VitePress ยท Deployed on Tencent EdgeOne Pages