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

# Download Timeline Video

> Download a Timeline composition as a video file

Download a generated timeline stream as a downloadable video file in MP4 format. After creating a timeline, use this endpoint to export it for sharing or offline use.

<CodeGroup>
  ```python Python theme={null}
  import videodb
  from videodb.editor import Timeline, Track, Clip, VideoAsset

  conn = videodb.connect(api_key="your_api_key")

  # Create and generate a timeline (see Create Timeline v2)
  timeline = Timeline(conn)
  track = Track()
  video_asset = VideoAsset(id="m-abc123def", start=0)
  clip = Clip(asset=video_asset, duration=10)
  track.add_clip(0, clip)
  timeline.add_track(track)

  # Generate the stream
  stream_url = timeline.generate_stream()

  # Download the timeline as a video file
  download_result = timeline.download_stream(stream_url)

  print(f"Download URL: {download_result.get('download_url')}")
  print(f"Status: {download_result.get('status')}")
  ```

  ```javascript Node.js theme={null}
  import { connect, EditorTimeline, Track, Clip, EditorVideoAsset } from 'videodb';

  const conn = await connect({ apiKey: 'your_api_key' });

  // Create and generate a timeline (see Create Timeline v2)
  const timeline = new EditorTimeline(conn);
  const track = new Track();
  const videoAsset = new EditorVideoAsset({ id: 'm-abc123def', start: 0 });
  const clip = new Clip({ asset: videoAsset, duration: 10 });
  track.addClip(0, clip);
  timeline.addTrack(track);

  // Generate the stream
  const streamUrl = await timeline.generateStream();

  // Download the timeline as a video file
  const downloadResult = await timeline.downloadStream(streamUrl);

  console.log(`Download URL: ${downloadResult.downloadUrl}`);
  console.log(`Status: ${downloadResult.status}`);
  ```
</CodeGroup>

<Note>
  * Download requires a valid stream URL from a generated timeline
  * Downloads are processed asynchronously and return a download URL
  * Video format is MP4 with standard codec support
  * Downloaded files can be shared, archived, or used in other applications
  * Check the status field to track download progress
</Note>

<CardGroup cols={2}>
  <Card title="Create Timeline v2" icon="plus" href="/api-reference/timeline/create_timeline_v2">
    Generate timeline to download
  </Card>

  <Card title="Connection API" icon="link" href="/api-reference/authentication">
    API authentication and connection
  </Card>
</CardGroup>


## OpenAPI

````yaml POST /timeline_v2/download
openapi: 3.0.3
info:
  title: VideoDB Server API
  description: >
    VideoDB Server API for video, audio, and image processing with AI
    capabilities.

    This API provides comprehensive video management, search, indexing, and
    AI-powered features.
  version: 1.0.0
  contact:
    name: VideoDB Support
    url: https://videodb.io
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: https://api.videodb.io
    description: Production server
  - url: https://staging-api.videodb.io
    description: Staging server
security:
  - ApiKeyAuth: []
tags:
  - name: Authentication
    description: User authentication and API key management
  - name: Collections
    description: Collection management operations
  - name: Videos
    description: Video upload, processing, and management
  - name: Audio
    description: Audio management operations
  - name: Images
    description: Image management operations
  - name: Search
    description: Content search and indexing
  - name: AI Generation
    description: AI-powered content generation
  - name: Billing
    description: Billing and usage management
  - name: RTStream
    description: Real-time streaming operations
  - name: Utilities
    description: Utility endpoints
  - name: Meeting
    description: Meeting recording and management
  - name: Capture
    description: Capture session management for recording streams
  - name: Editor
    description: Timeline editor operations
  - name: Transcode
    description: Media transcoding operations
  - name: Assets
    description: Cross-collection asset listing
paths:
  /timeline_v2/download:
    post:
      summary: Download compiled timeline
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - timeline_id
              properties:
                timeline_id:
                  type: string
                  example: timeline-12345
                format:
                  type: string
                  enum:
                    - mp4
                    - webm
                    - avi
                  example: mp4
                quality:
                  type: string
                  enum:
                    - low
                    - medium
                    - high
                  example: high
      responses:
        '200':
          description: Download initiated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    AsyncResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        status:
          type: string
          enum:
            - processing
            - done
            - failed
          example: processing
        data:
          type: object
          properties:
            id:
              type: string
              example: job-123
            output_url:
              type: string
              example: https://api.videodb.io/async-response/job-123
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-access-token
      description: API key for authentication (sk-xxx format)

````