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

# Upload Video

> Ingest video, audio, and images from URLs or local files into VideoDB collections

## Quick Example

```python Python theme={null}
import videodb

conn = videodb.connect()
coll = conn.get_collection()

video = coll.upload("https://example.com/video.mp4")
print(video.id)  # m-xxx
```

```javascript Node.js theme={null}
import { connect } from 'videodb';

const conn = await connect();
const coll = await conn.getCollection();

const video = await coll.uploadURL({ url: "https://example.com/video.mp4" });
console.log(video.id);  // m-xxx
```

***

## Upload Methods

### From URL

Upload directly from any accessible URL (S3, YouTube, public links):

```python Python theme={null}
# Video
video = coll.upload(url="https://youtu.be/a9__D53WsUs")

# Audio
from videodb import MediaType
audio = coll.upload(
    url="https://example.com/podcast.mp3",
    media_type=MediaType.audio
)

# Image
image = coll.upload(
    url="https://example.com/frame.jpg",
    media_type=MediaType.image
)
```

```javascript Node.js theme={null}
import { MediaType } from 'videodb';

// Video
const video = await coll.uploadURL({ url: "https://youtu.be/a9__D53WsUs" });

// Audio
const audio = await coll.uploadURL({
    url: "https://example.com/podcast.mp3",
    mediaType: MediaType.audio
});

// Image
const image = await coll.uploadURL({
    url: "https://example.com/frame.jpg",
    mediaType: MediaType.image
});
```

### From Local File

Upload files from your local filesystem:

```python Python theme={null}
video = coll.upload(file_path="./meeting-recording.mp4")
```

```javascript Node.js theme={null}
const video = await coll.uploadFile({ filePath: "./meeting-recording.mp4" });
```

***

## Media Types

| Type | ID Prefix | Use Case |
| :- | :- | :- |
| Video | `m-xxx` | Primary content, full playback |
| Audio | `a-xxx` | Podcasts, voice recordings |
| Image | `img-xxx` | Thumbnails, frames |

***

## Upload Response

After upload, you receive a media object with:

| Property | Description |
| :- | :- |
| `id` | Unique identifier (m-xxx, a-xxx, img-xxx) |
| `collection_id` | Parent collection ID |
| `name` | File name |
| `length` | Duration in seconds (video/audio) |
| `stream_url` | HLS stream URL (video) |
| `player_url` | Web player URL (video) |

***

## Async Uploads with Callbacks

For production workflows, use callbacks to handle upload completion:

```python Python theme={null}
video = coll.upload(
    url="https://example.com/large-video.mp4",
    callback_url="https://your-backend.com/webhooks/upload"
)
```

```javascript Node.js theme={null}
const video = await coll.uploadURL({
    url: "https://example.com/large-video.mp4",
    callbackUrl: "https://your-backend.com/webhooks/upload"
});
```

Your webhook receives:

```json theme={null}
{
  "success": true,
  "data": {
    "id": "m-xxx",
    "collection_id": "c-xxx",
    "name": "large-video.mp4",
    "stream_url": "https://stream.videodb.io/...",
    "player_url": "https://console.videodb.io/player?url=..."
  }
}
```

***

## What You Can Build

> [card] [Faceless Video Creator](https://docs.videodb.io/examples-and-tutorials/content-factory/faceless-video-creator.md)
>
> Upload assets and compose complete AI-generated videos

> [card] [TikTok Lyric Videos](https://docs.videodb.io/examples-and-tutorials/content-factory/tiktok-lyric-video.md)
>
> Upload music and create viral vertical clips with synced lyrics

> [card] [Intro & Outro Automation](https://docs.videodb.io/examples-and-tutorials/programmatic-editing/intro-outro.md)
>
> Upload brand assets and automatically add to all videos

***

## Next Steps

> [card] [Create Collection](https://docs.videodb.io/pages/ingest/files-and-collections/create-collection.md)
>
> Organize uploads into collections

> [card] [Collection Patterns](https://docs.videodb.io/pages/ingest/files-and-collections/collection-patterns.md)
>
> Batching, retries, and production patterns


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.