> For the complete documentation index, see [llms.txt](https://docs.eyepop.ai/developer-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.eyepop.ai/developer-documentation/platform/sources-and-options/options/video-mode.md).

# Video Mode

Process an uploaded video while it uploads, or after

An **uploaded** video is buffered in full before processing starts. That is the safe default, but it means the first prediction waits for the last byte. `stream` mode processes the video while it is still uploading, so predictions start arriving almost immediately.

| Mode               | Behavior                                      |
| ------------------ | --------------------------------------------- |
| `buffer` (default) | Upload completes, then the video is processed |
| `stream`           | Video is processed as it uploads              |

This is a property of the **source** rather than of the request, because it only means anything for uploaded video. Fetched URLs and live streams are always processed as they arrive.

Buffering has to hold the whole video, so it is capped at **1 GiB**. A larger upload is rejected with a `400`. `stream` mode has no such cap, because nothing is held — it is the answer for a video too big to buffer, as well as for one you do not want to wait for.

{% hint style="info" %}
On an on-premise instance the cap is yours to set: `max-upload-buffer` in `eyepop-instance.yml`, in bytes, defaulting to `1073741824` (1 GiB). In the cloud the 1 GiB default applies and cannot be changed.
{% endhint %}

{% tabs %}
{% tab title="Python" %}

```python
from eyepop.worker.worker_types import VideoMode

job = endpoint.upload("clip.mp4", video_mode=VideoMode.STREAM)
while result := job.predict():
    print(result)
```

{% endtab %}

{% tab title="Node" %}

```typescript
import { VideoMode } from '@eyepop.ai/eyepop'

const results = await endpoint.process({
    source: { path: 'clip.mp4', videoMode: VideoMode.STREAM },
})
```

{% endtab %}
{% endtabs %}
