Reframe a montage
The Aive API allows you to recompute a montage's video framing for a new target format — for example, converting a landscape montage to a vertical or square one.
Reframing a montage is a three-step process:
- Read the montage's current content.
- Set the desired format on that content, then call
reframeMontageContentto recompute the crop/pan of every video lane for it. - Save the reframed content by calling
updateMontage.
Prerequisites
Before reframing a montage:
- You know your workspace ID. Retrieving a workspace ID works exactly the same way as for scoring — follow steps 1 of Score a container if you haven't done so yet.
- You know the ID of the montage to reframe.
- You know the target format (width and height) you want to reframe the montage to.
Step 1 - Read the montage content
Query the montage by ID, selecting its content field.
Montage query
query MontageContent($id: ID!) {
montage(id: $id) {
content
}
}Montage variables
{
"id": "<montage_id>"
}Montage response
{
"data": {
"montage": {
"content": {
"lanes": [],
"timeMarkers": [],
"settings": {
"duration": "...",
"format": { "width": 1920, "height": 1080 },
"backgroundColor": "#000000",
"pointOfInterest": {},
"reframeParams": {
"removeBlackBars": true,
"scaleMode": "auto",
"laneItemResizeMode": "..."
}
}
}
}
}
}Keep the content value — you'll edit it in the next step and pass it to reframeMontageContent.
Step 2 - Set the target format and reframe
reframeMontageContent does not take a target format as one of its own arguments. Instead, the target format — and the reframe behavior applied to it — is read from the settings object inside the MontageContent you pass in. See the MontageContent reference for the full shape.
Before calling reframeMontageContent, take the content you read in Step 1 and set, on a copy of it:
settings.format— the new target{ width, height }.settings.reframeParams— optionally, adjustremoveBlackBarsandscaleModeif you want different cropping behavior for the new format.
Then call reframeMontageContent with the edited content. Aive recomputes the crop/pan of every video lane to match the new settings.format and returns the updated content.
ReframeMontageContent mutation
mutation ReframeMontageContent($input: ReframeMontageContentInput!) {
reframeMontageContent(input: $input) {
... on ReframeMontageContentResult {
content
}
}
}ReframeMontageContent variables
{
"input": {
"workspaceId": "<workspace_id>",
"content": "<content_with_updated_settings_format>",
"args": {}
}
}content is the MontageContent JSON object itself, not a string: replace the placeholder, quotes included, with the edited object. The same goes for the content of updateMontage and createMontage below.
ReframeMontageContent input parameters
| Parameter | Type | Description |
|---|---|---|
workspaceId | ID | The workspace you're working within. |
content | MontageContent | The montage content to reframe, with settings.format (and optionally settings.reframeParams) already set to the desired target format. |
args | Object | Required. Pass {} to keep each video lane's own blur settings. |
args.blur | BlurInput | Optional. Overrides the blur mode/radius used to fill the background behind reframed video lanes. When omitted, each video lane's own blurMode/blurRadius is used instead. |
args.blur.blurMode | Enum | One of none, cover, splitCover, splitContain. |
args.blur.blurRadius | Int | The blur radius to apply when blurMode is set. |
ReframeMontageContent response
{
"data": {
"reframeMontageContent": {
"content": {
"lanes": [],
"timeMarkers": [],
"settings": {
"format": { "width": 1080, "height": 1920 }
}
}
}
}
}reframeMontageContent is synchronous — the reframed content is returned directly in the mutation response. There is no job to poll and no webhook event to subscribe to.
Reframing does not save anything by itself — the montage you read in Step 1 is left untouched until you persist the result in the next step.
Step 3 - Save the reframed content
Call updateMontage with the content returned by reframeMontageContent to persist it as the montage's new content.
UpdateMontage mutation
mutation UpdateMontage($input: UpdateMontageInput!) {
updateMontage(input: $input) {
... on UpdateMontageResult {
ack
}
... on UpdateMontageError {
code
message
}
}
}UpdateMontage variables
{
"input": {
"id": "<montage_id>",
"content": "<reframed_montage_content>"
}
}UpdateMontage response
{
"data": {
"updateMontage": {
"ack": true
}
}
}You could also use the changed montage content to create a new montage, allowing in effect to create variants of a montage in different formats:
CreateMontage mutation
mutation CreateMontage($input: CreateMontageInput!) {
createMontage(input: $input) {
... on CreateMontageResult {
id
}
}
}CreateMontage variables
{
"input": {
"folderId": "<folder_id>",
"name": "<montage_name>",
"content": "<reframed_montage_content>"
}
}CreateMontage input parameters
| Parameter | Type | Description |
|---|---|---|
folderId | ID | The destination folder for the new montage. |
name | String | The name of the montage. |
content | MontageContent | The initial content, typically the value returned by reframeMontageContent. |
CreateMontage response
{
"data": {
"createMontage": {
"id": "<montage_id>"
}
}
}Errors
reframeMontageContent does not return a mutation-specific typed error — failures such as a missing permission or insufficient credits surface as standard errors.
updateMontage returns a typed error through its output union:
| Error code | Description |
|---|---|
MontageIsLocked | The montage is locked by a user other than its creator. Only the creator of a locked montage can still update it. |
See Error handling for how these errors are returned.
Best practices
- Always edit
settings.formaton the content itself before callingreframeMontageContent— the mutation's ownargsonly control blur/background-fill behavior, not the target format. - Treat the
MontageContentvalue as opaque beyond the fields you need to edit — pass everything else through unchanged. reframeMontageContentis synchronous, so there's no need to poll or wait for a webhook event before moving on toupdateMontage.- Always call
updateMontageafterwards —reframeMontageContentonly computes the new content, it does not save it. - Expect
updateMontageto fail withMontageIsLockedif another user currently has the montage locked; only the montage's creator can update it while it's locked.

