Skip to main content
View as Markdown

AI Composition - Avatar Videos

AI Composition​

The compose action uses AI to generate scenes from source video content. It analyzes captions and transcripts from the provided entries and creates a structured narration script.

Compose Scenes from Content​

curl -s -X POST "$AVATAR_API/video/compose" \
-H "Authorization: Bearer $KS" \
-H "Content-Type: application/json" \
-d "{
\"id\": \"$VIDEO_ID\",
\"formatType\": \"session-highlights\",
\"duration\": 120,
\"entryIds\": [\"$SOURCE_ENTRY_1\", \"$SOURCE_ENTRY_2\"],
\"userBrief\": \"Focus on the product roadmap announcements\",
\"generateName\": true
}"

Request fields:

FieldTypeRequiredDescription
idstringyesVideo project ID
formatTypestringyes"session-highlights" or "video-explainer" (see below)
durationnumberyesTarget video duration in seconds. Min: 1, max: 1200 (20 minutes)
entryIdsarrayyesKaltura entry IDs with captions to analyze
userBriefstringnoDescribes the video goals, style, or focus areas for the AI
generateNamebooleannoAuto-generate a video name from the content

Format types:

FormatSource ContentOutput
session-highlightsVideo captions onlyShort highlights video narrated by the avatar summarizing the key points
video-explainerVideo captions + documentsExplainer video combining multiple sources into a coherent narrative

The compose action:

  1. Transitions the video status to composing
  2. Extracts captions and documents from the source entries
  3. Uses AI (AWS Bedrock Claude) to generate a structured scene-by-scene narration
  4. Populates the video's scenes array with the generated content
  5. Transitions to composed on success, or compose-error on failure

Source entries require captions or transcripts — add them via REACH before composing. The API returns CAPTIONS_NOT_FOUND if text content is missing.

Response: Returns the video with status composing. Poll video.get until status changes to composed.