> ## Documentation Index
> Fetch the complete documentation index at: https://docs.narrative.video/llms.txt
> Use this file to discover all available pages before exploring further.

# Prepare Video

> Merge multiple episodes into a continuous video with smart transitions

## POST /api/v1/hooks/prepare

Prepare multiple episode files into a continuous video with smart transitions. The AI analyzes episode boundaries, removes freeze frames, and eliminates overlapping recap content for seamless playback.

### Parameters

| Parameter | Type    | Required | Description                                       |
| --------- | ------- | -------- | ------------------------------------------------- |
| videos    | File\[] | Yes      | Episode video files to merge (mp4, mov, avi, mkv) |

### Response

| Field                  | Description                                                |
| ---------------------- | ---------------------------------------------------------- |
| continuous\_video\_url | URL to the merged continuous video                         |
| transcript\_url        | URL to the transcript JSON file with word-level timestamps |
| total\_duration\_sec   | Total duration of the continuous video in seconds          |
| episodes\_processed    | Number of episodes that were merged                        |

### Example Request

```bash theme={null}
curl -X POST https://api.usenarrative.ai/api/v1/hooks/prepare \
  -H "Content-Type: multipart/form-data" \
  -F "videos=@episode-1.mp4" \
  -F "videos=@episode-2.mp4" \
  -F "videos=@episode-3.mp4"
```

### Example Response

```json theme={null}
{
  "continuous_video_url": "https://cdn.usenarrative.ai/prepared/continuous_abc123.mp4",
  "transcript_url": "https://cdn.usenarrative.ai/prepared/transcript_abc123.json",
  "total_duration_sec": 5234.5,
  "episodes_processed": 3
}
```

### Notes

* Supports common video formats: mp4, mov, avi, mkv
* AI automatically detects and removes freeze frames between episodes
* Overlapping recap content at episode starts is intelligently trimmed
* The transcript includes word-level timestamps for precise hook generation
* Use the returned URLs with the Generate Hook endpoint


## OpenAPI

````yaml POST /api/v1/hooks/prepare
openapi: 3.0.3
info:
  title: Hooks API
  description: AI-powered social media hook generation and video analysis
  version: 1.0.0
servers:
  - url: https://api.usenarrative.ai
    description: Production
security: []
paths:
  /api/v1/hooks/prepare:
    post:
      tags:
        - Hooks
      summary: Prepare Video
      description: >-
        Prepare multiple episode files into a continuous video with smart
        transitions. Removes freeze frames and overlapping content between
        episodes.
      operationId: prepareVideo
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PrepareVideoRequest'
      responses:
        '200':
          description: Video prepared successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PrepareVideoResponse'
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    PrepareVideoRequest:
      type: object
      properties:
        videos:
          type: array
          items:
            type: string
            format: binary
          description: Episode video files to merge into continuous video
      required:
        - videos
    PrepareVideoResponse:
      type: object
      properties:
        continuous_video_url:
          type: string
          format: uri
          description: URL to the merged continuous video
          example: https://cdn.usenarrative.ai/prepared/continuous_abc123.mp4
        transcript_url:
          type: string
          format: uri
          description: URL to the transcript JSON file
          example: https://cdn.usenarrative.ai/prepared/transcript_abc123.json
        total_duration_sec:
          type: number
          description: Total duration of the continuous video in seconds
          example: 5234.5
        episodes_processed:
          type: integer
          description: Number of episodes that were merged
          example: 3
      required:
        - continuous_video_url
        - transcript_url
        - total_duration_sec
        - episodes_processed
    Error:
      type: object
      properties:
        detail:
          type: string
          description: Error message
          example: Invalid video URL provided

````