> 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/pop-defaults.md).

# 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](/developer-documentation/platform/sources-and-options/options/region-of-interest.md) |
| `fps`                                                                                             | [Frame rate](/developer-documentation/platform/sources-and-options/options/frame-rate.md)                 |
| `motionDetect`, `motionSensitivity`, `motionThreshold`, `motionGap`, `motionGridX`, `motionGridY` | [Motion detection](/developer-documentation/platform/sources-and-options/options/motion-detection.md)     |
| `camera`                                                                                          | [Camera Calibration](/developer-documentation/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](/developer-documentation/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**](/developer-documentation/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](/developer-documentation/platform/sources-and-options/options.md) — what each option does
* [Pops](/developer-documentation/platform/pop.md) — how a Pop is composed
