# item.crossfade

> Sets a matching fade-out and fade-in on two overlapping visual items of different tracks.

Source: https://alexgalhardo.github.io/vukem-video/docs/reference/commands/item.crossfade

The item that leaves gets a fade transition out and the item that arrives a fade transition in, both of the given length, plus the matching audio fades for clips. The two items must overlap by at least that length, and the arriving item must start after the leaving one.

## Arguments

| Argument | Type | Required | Description |
| --- | --- | --- | --- |
| `duration` | `string` | yes | Length of the crossfade, at least 1 frame. |
| `from_item_id` | `string` | yes | The item that leaves. |
| `to_item_id` | `string` | yes | The item that arrives. |

## Example

As one operation of an `edit` batch (the `edit` tool of MCP, `vukem-video edit --ops`, or `POST /api/v1/projects/{id}/edit`):

```json
{
  "op": "item.crossfade",
  "args": {
    "duration": "1s",
    "from_item_id": "itm_m1n2p3q4r5",
    "to_item_id": "itm_s6t7v8w9x0"
  }
}
```

## Errors

[`E_VALIDATION`](/docs/reference/error-codes#e_validation), [`E_INVALID_TIME`](/docs/reference/error-codes#e_invalid_time), [`E_NOT_FOUND`](/docs/reference/error-codes#e_not_found), [`E_TYPE_MISMATCH`](/docs/reference/error-codes#e_type_mismatch), [`E_INVALID_STATE`](/docs/reference/error-codes#e_invalid_state)

## Scope and phase

Scope `edit`, phase `alpha`. Run `vukem-video command:help item.crossfade` for the same description from the binary.
