> For the complete documentation index, see [llms.txt](https://docs.eyepop.ai/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/platform/sources-and-options/pop-defaults.md). Agents can also search and read this documentation through its [MCP server](https://docs.eyepop.ai/~gitbook/mcp).

# Pop Defaults

Set source options once on the Pop instead of repeating them on every source

Most source options describe the *scene* rather than the *request* — the region of a camera's frame that matters, the rate worth analyzing it at, whether to gate on motion. Repeating them on every source is noise, and one call that forgets them is a silent behavior change.

`defaults` puts them on the Pop instead. Every source the Pop processes takes them, and any source can still override them.

{% hint style="info" %}
Requires Python SDK and Node SDK **3.20.0** or newer.
{% endhint %}

### What can be defaulted

| Field                                                                                             | See                                                                                                     |
| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| `roi`                                                                                             | [Region of interest](https://docs.eyepop.ai/platform/sources-and-options/options/region-of-interest.md) |
| `fps`                                                                                             | [Frame rate](https://docs.eyepop.ai/platform/sources-and-options/options/frame-rate.md)                 |
| `motionDetect`, `motionSensitivity`, `motionThreshold`, `motionGap`, `motionGridX`, `motionGridY` | [Motion detection](https://docs.eyepop.ai/platform/sources-and-options/options/motion-detection.md)     |
| `camera`                                                                                          | [Camera Calibration](https://docs.eyepop.ai/platform/depth-and-world-coordinates/camera-calibration.md) |

Only options that describe the scene and the capture belong here. A source's identity and transport — its URL, whether it is live, its component parameters — are deliberately not defaultable: there is no sensible value for every source to share.

### Setting defaults

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

```python
from eyepop import EyePopSdk
from eyepop.data.types.asset import RectangleArea
from eyepop.worker.worker_types import InferenceComponent, Pop, SourceDefaults

pop = Pop(
    components=[InferenceComponent(ability="eyepop.person:latest")],
    defaults=SourceDefaults(
        fps="1/1",
        roi=RectangleArea(x=160, y=0, width=320, height=480),
        motionDetect=True,
        motionSensitivity=0.6,
    ),
)

with EyePopSdk.sync_worker(pop=pop) as endpoint:
    # takes fps, roi and motion detection from the Pop
    job = endpoint.load_from("rtsp://camera.example.com/stream1")
    while result := job.predict():
        print(result)
```

{% endtab %}

{% tab title="Node" %}

```typescript
import { AreaType, EyePop, PopComponentType } from '@eyepop.ai/eyepop'

const endpoint = await EyePop.workerEndpoint({
    pop: {
        components: [{ type: PopComponentType.INFERENCE, ability: 'eyepop.person:latest' }],
        defaults: {
            fps: '1/1',
            roi: { type: AreaType.RECTANGLE, x: 160, y: 0, width: 320, height: 480 },
            motionDetect: true,
            motionSensitivity: 0.6,
        },
    },
}).connect()

// takes fps, roi and motion detection from the Pop
const results = await endpoint.process({
    source: { url: 'rtsp://camera.example.com/stream1' },
})
```

{% endtab %}
{% endtabs %}

### Overriding per source

Defaults are merged **field by field**, and anything the source sets wins. A source that gives its own `fps` but no `roi` keeps its own frame rate and takes the Pop's region — it does not lose the whole block by setting one field of it. The region is one field whichever shape it is, so a Pop can default a [contour](https://docs.eyepop.ai/platform/sources-and-options/options/region-of-interest.md#a-contour) exactly as it defaults a rectangle, and a source overriding it replaces the whole region rather than merging points into it.

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

```python
with EyePopSdk.sync_worker(pop=pop) as endpoint:
    # the camera runs at the Pop's defaults
    camera = endpoint.load_from("rtsp://camera.example.com/stream1")

    # this one keeps the Pop's roi and motion settings, but runs faster
    fast = endpoint.load_from("rtsp://camera.example.com/stream2", fps="5/1")
```

{% endtab %}

{% tab title="Node" %}

```typescript
// the camera runs at the Pop's defaults
const camera = await endpoint.process({
    source: { url: 'rtsp://camera.example.com/stream1' },
})

// this one keeps the Pop's roi and motion settings, but runs faster
const fast = await endpoint.process({
    source: { url: 'rtsp://camera.example.com/stream2' },
    fps: '5/1',
})
```

{% endtab %}
{% endtabs %}

Merging happens server-side, so a source's options and the Pop's defaults are combined the same way from every SDK.

### When to use them

* **A Pop that serves one camera.** Its region and frame rate are properties of that installation, not of each frame. Put them on the Pop and every source is correct by construction — including sources submitted by code that does not know about the installation.
* **A** [**persistent Deployment**](https://docs.eyepop.ai/deploying/cloud/deployment.md)**.** The Pop is configured once and lives on; callers just push sources at it.
* **Many callers, one policy.** Changing the Pop changes every future source at once, rather than needing every call site updated.

Set options on the source instead when they genuinely differ per request — a prompt, a one-off crop, a video that should stream rather than buffer.

### Next steps

* [Source Options](https://docs.eyepop.ai/platform/sources-and-options/options.md) — what each option does
* [Pops](https://docs.eyepop.ai/platform/pop.md) — how a Pop is composed


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.eyepop.ai/platform/sources-and-options/pop-defaults.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
