# Render video

**Action ID:** `render_video`

## Description

Render video

## Connection

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

## Input Parameters

| Name          | Type          | Required | Default           | Description                                                        |
| ------------- | ------------- | :------: | ----------------- | ------------------------------------------------------------------ |
| video\_config | string (JSON) |     -    | (complex default) | Video configuration with layers, segments, animations, and effects |
| file\_name    | string        |     ✓    | -                 | File name for the rendered video                                   |

<details>

<summary>View JSON Schema</summary>

```json
{
  "description": "Render Video node input.",
  "properties": {
    "video_config": {
      "default": "{\"duration\":20,\"fps\":30,\"layers\":[{\"animation\":\"slide\",\"segments\":[{\"type\":\"VIDEO\",\"duration\":10,\"url\":\"https://photoshot-us.s3.us-east-1.amazonaws.com/next-s3-uploads/2809a214-98c1-4da7-83e6-0704df0c0257/sample-video.mp4\",\"volume\":1},{\"type\":\"IMAGE\",\"duration\":10,\"url\":\"https://cdn.pixabay.com/photo/2022/02/06/14/06/dog-6997211_1280.jpg\"}]},{\"animation\":\"none\",\"segments\":[{\"type\":\"CAPTION\",\"duration\":20,\"url\":\"https://agenticflow-video-templates.vercel.app/public/subtitles.srt\",\"animation\":\"box\",\"captionPosition\":\"bottom\",\"color\":\"#FFFFFF\",\"fontCase\":\"none\",\"fontFamily\":\"Montserrat\",\"fontSize\":48,\"fontStyle\":\"normal\",\"fontWeight\":\"400\",\"highlightedWordColor\":\"#04f827FF\",\"captionBackgroundColor\":\"#00000099\"}]}]}",
      "description": "Video configuration",
      "title": "Video configuration",
      "type": "string"
    },
    "file_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "File name",
      "title": "File name"
    }
  },
  "required": [
    "file_name"
  ],
  "title": "RenderVideoNodeInput",
  "type": "object"
}
```

</details>

## Output Parameters

| Name  | Type         | Description               |
| ----- | ------------ | ------------------------- |
| video | string (URL) | URL of the rendered video |

<details>

<summary>View JSON Schema</summary>

```json
{
  "description": "Render Video node output.",
  "properties": {
    "video": {
      "description": "Rendered video",
      "title": "Rendered video",
      "type": "string"
    }
  },
  "required": [
    "video"
  ],
  "title": "RenderVideoNodeOutput",
  "type": "object"
}
```

</details>

## How It Works

This node uses PixelML's video rendering engine to create videos from a configuration that defines layers, segments, animations, and effects. The video\_config JSON specifies how different media elements (videos, images, captions) should be combined, animated, and timed. The rendering engine processes each layer sequentially, applies animations and transitions, overlays captions with specified styling, and outputs a final rendered video file accessible via URL.

## Usage Examples

### Example 1: Simple Video with Image Transition

**Input:**

```
video_config: {
  "duration": 10,
  "fps": 30,
  "layers": [{
    "animation": "fade",
    "segments": [
      {"type": "VIDEO", "duration": 5, "url": "https://example.com/intro.mp4", "volume": 1},
      {"type": "IMAGE", "duration": 5, "url": "https://example.com/banner.jpg"}
    ]
  }]
}
file_name: "promo_video.mp4"
```

**Output:**

```
video: "https://pixelml.s3.amazonaws.com/renders/promo_video_abc123.mp4"
```

### Example 2: Video with Animated Captions

**Input:**

```
video_config: {
  "duration": 15,
  "fps": 30,
  "layers": [
    {
      "animation": "none",
      "segments": [{"type": "VIDEO", "duration": 15, "url": "https://example.com/background.mp4", "volume": 0.7}]
    },
    {
      "animation": "none",
      "segments": [{
        "type": "CAPTION",
        "duration": 15,
        "url": "https://example.com/subtitles.srt",
        "animation": "box",
        "captionPosition": "bottom",
        "color": "#FFFFFF",
        "fontSize": 36,
        "fontFamily": "Arial",
        "highlightedWordColor": "#FFD700",
        "captionBackgroundColor": "#000000AA"
      }]
    }
  ]
}
file_name: "subtitled_video.mp4"
```

**Output:**

```
video: "https://pixelml.s3.amazonaws.com/renders/subtitled_video_def456.mp4"
```

### Example 3: Multi-Segment Slideshow

**Input:**

```
video_config: {
  "duration": 20,
  "fps": 24,
  "layers": [{
    "animation": "slide",
    "segments": [
      {"type": "IMAGE", "duration": 5, "url": "https://example.com/photo1.jpg"},
      {"type": "IMAGE", "duration": 5, "url": "https://example.com/photo2.jpg"},
      {"type": "IMAGE", "duration": 5, "url": "https://example.com/photo3.jpg"},
      {"type": "IMAGE", "duration": 5, "url": "https://example.com/photo4.jpg"}
    ]
  }]
}
file_name: "slideshow.mp4"
```

**Output:**

```
video: "https://pixelml.s3.amazonaws.com/renders/slideshow_ghi789.mp4"
```

## Common Use Cases

* **Social Media Content**: Create engaging videos with captions, transitions, and effects for Instagram, TikTok, or YouTube
* **Marketing Videos**: Combine product images, demo videos, and promotional text into polished marketing materials
* **Educational Content**: Generate tutorial videos with subtitles, annotations, and visual demonstrations
* **Video Slideshows**: Transform collections of images into dynamic video presentations with transitions
* **Automated Content Generation**: Programmatically create videos from templates for personalized campaigns
* **Caption Overlays**: Add styled subtitles and captions to existing videos for accessibility and engagement
* **Video Compilation**: Merge multiple video clips and images into a single cohesive video

## Error Handling

| Error Type                 | Cause                                                           | Solution                                                                                       |
| -------------------------- | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| Invalid Configuration      | video\_config JSON has syntax errors or missing required fields | Validate JSON structure and ensure all required properties (duration, fps, layers) are present |
| Media URL Unreachable      | Image or video URLs in segments cannot be accessed              | Verify all media URLs are publicly accessible and return valid content                         |
| Invalid Duration           | Segment durations don't match total video duration              | Ensure sum of segment durations equals the total duration specified                            |
| Unsupported Format         | Media files are in unsupported formats                          | Use common formats like MP4 for video, JPG/PNG for images, and SRT for captions                |
| Rendering Timeout          | Video rendering takes too long to complete                      | Reduce video complexity, duration, or resolution; split into smaller videos                    |
| Missing PixelML Connection | PixelML connection not configured                               | Configure a valid PixelML connection in your workflow settings                                 |
| Caption File Error         | SRT file URL is invalid or malformed                            | Verify the SRT file is properly formatted and accessible via the provided URL                  |

## Notes

* **Configuration Complexity**: The video\_config parameter accepts complex JSON. Use a JSON validator to ensure correctness before rendering.
* **Layer Order**: Layers are rendered in the order specified. Later layers appear on top of earlier ones (useful for captions overlays).
* **FPS Setting**: Higher FPS (30-60) creates smoother videos but increases rendering time. Use 24-30 FPS for most content.
* **Animation Types**: Available animations include "fade", "slide", "none", and "box" (for captions). Choose based on desired visual effect.
* **File Naming**: Use descriptive file names to organize rendered videos. The output URL will include the file name.
* **Rendering Time**: Video rendering can take 1-5 minutes depending on duration and complexity. Plan workflow timing accordingly.
* **Media Accessibility**: All media URLs (images, videos, captions) must be publicly accessible for the rendering engine to fetch them.
* **Cost Considerations**: Video rendering consumes PixelML credits based on duration and complexity. Monitor usage to manage costs.


---

# 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/render_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.
