# Edit Video

**Action ID:** `edit_video`

## Description

Edit and modify existing AI-generated videos by applying change requests to video configuration and assets.

## Connection

| Name               | Description                                 | Required | Category |
| ------------------ | ------------------------------------------- | :------: | -------- |
| PixelML Connection | The PixelML connection to call PixelML API. |     ✓    | pixelml  |

## Input Parameters

| Name                       | Type   | Required | Default | Description                                                                                            |
| -------------------------- | ------ | :------: | ------- | ------------------------------------------------------------------------------------------------------ |
| brief                      | string |     ✓    | -       | Brief description of the video content and purpose                                                     |
| existing\_video\_config    | string |     ✓    | -       | The configuration data from the previously generated video                                             |
| existing\_video\_gen\_info | string |     ✓    | -       | The generation information from the previously created video                                           |
| change\_request            | string |     ✓    | -       | Description of the changes to apply to the existing video                                              |
| images                     | array  |     -    | null    | Optional list of image URLs to use for the edited video. If not provided, AI will find relevant assets |

<details>

<summary>View JSON Schema</summary>

```json
{
  "description": "Edit video node input.",
  "properties": {
    "brief": {
      "description": "Brief description of the video.",
      "title": "Brief",
      "type": "string"
    },
    "images": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "List of image URLs, used to create the video. If not provided, our AI will find the relevant assets to create the video.",
      "title": "Images"
    },
    "existing_video_config": {
      "title": "Existing Video Config",
      "type": "string"
    },
    "existing_video_gen_info": {
      "title": "Existing Video Gen Info",
      "type": "string"
    },
    "change_request": {
      "title": "Change Request",
      "type": "string"
    }
  },
  "required": [
    "brief",
    "existing_video_config",
    "existing_video_gen_info",
    "change_request"
  ],
  "title": "EditVideoNodeInput",
  "type": "object"
}
```

</details>

## Output Parameters

| Name             | Type   | Description                                         |
| ---------------- | ------ | --------------------------------------------------- |
| video\_config    | string | The updated configuration data for the edited video |
| video\_gen\_info | string | The generation information for the edited video     |

<details>

<summary>View JSON Schema</summary>

```json
{
  "description": "Create video node output.",
  "properties": {
    "video_config": {
      "title": "Video Config",
      "type": "string"
    },
    "video_gen_info": {
      "title": "Video Gen Info",
      "type": "string"
    }
  },
  "required": [
    "video_config",
    "video_gen_info"
  ],
  "title": "EditVideoNodeOutput",
  "type": "object"
}
```

</details>

## How It Works

This node takes an existing video's configuration and generation information, applies your requested changes, and generates updated configuration data for a modified video. The system analyzes the change request, determines which aspects of the video to modify (such as timing, transitions, images, or effects), and produces new configuration data that reflects these changes. The edited video configuration can then be used to generate the final video output.

## Usage Examples

### Example 1: Change Video Duration

**Input:**

```
brief: "Product showcase video"
existing_video_config: "{...previous config...}"
existing_video_gen_info: "{...previous gen info...}"
change_request: "Make the video 30 seconds instead of 60 seconds"
images: null
```

**Output:**

```
video_config: "{...updated config with 30s duration...}"
video_gen_info: "{...updated generation info...}"
```

### Example 2: Replace Images

**Input:**

```
brief: "Travel destination video"
existing_video_config: "{...previous config...}"
existing_video_gen_info: "{...previous gen info...}"
change_request: "Replace the beach images with mountain landscape images"
images: [
  "https://example.com/mountain1.jpg",
  "https://example.com/mountain2.jpg",
  "https://example.com/mountain3.jpg"
]
```

**Output:**

```
video_config: "{...config with new mountain images...}"
video_gen_info: "{...updated generation info...}"
```

### Example 3: Adjust Transitions

**Input:**

```
brief: "Corporate presentation video"
existing_video_config: "{...previous config...}"
existing_video_gen_info: "{...previous gen info...}"
change_request: "Change all transitions to fade effects and slow down the pace"
images: null
```

**Output:**

```
video_config: "{...config with fade transitions and slower timing...}"
video_gen_info: "{...updated generation info...}"
```

## Common Use Cases

* **Duration Adjustment**: Modify video length to meet specific time requirements
* **Content Updates**: Replace outdated images or footage with new content
* **Transition Changes**: Adjust transitions between scenes for better flow
* **Pacing Modifications**: Speed up or slow down video segments
* **Color Grading**: Apply different color filters or visual effects
* **Text Updates**: Modify on-screen text, captions, or titles
* **Asset Replacement**: Swap out specific images or video clips while keeping the overall structure

## Error Handling

| Error Type                  | Cause                                                    | Solution                                                                      |
| --------------------------- | -------------------------------------------------------- | ----------------------------------------------------------------------------- |
| Invalid Video Config        | Existing video configuration is malformed or corrupted   | Ensure you're using valid configuration data from a previous video generation |
| Missing Generation Info     | Required video generation information is not provided    | Provide the complete video\_gen\_info from the original video creation        |
| Incompatible Change Request | Requested changes conflict with existing video structure | Simplify the change request or create a new video instead of editing          |
| Image URL Error             | Provided image URLs are invalid or inaccessible          | Verify all image URLs are valid and publicly accessible                       |
| Processing Failed           | Video edit processing failed                             | Check input parameters and try again with a simpler change request            |
| Connection Error            | Cannot connect to PixelML API                            | Verify your PixelML connection settings and API key                           |

## Notes

* **Configuration Preservation**: Keep the video\_config and video\_gen\_info from previous video generation nodes to use with this edit node.
* **Iterative Editing**: You can chain multiple edit nodes together to apply changes step by step.
* **Change Request Clarity**: Write clear, specific change requests for best results. Vague requests may lead to unexpected outcomes.
* **Image Optimization**: When providing custom images, ensure they meet the quality and format requirements for video generation.
* **Processing Time**: Video editing may take several minutes depending on the complexity of changes requested.
* **Original Preservation**: The original video configuration is not modified; new configuration data is generated.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.agenticflow.ai/reference/nodes/edit_video.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
