web_capture
Capture any HTTPS page — dashboards, scoreboards, lower thirds — as a video source. Supports cookie auth, HTTP basic auth, and waiting for DOM readiness.
Example — public page
Section titled “Example — public page”curl -X POST "https://api.avflow.dev/v1/jobs" \ -H "Authorization: Bearer ${AVFLOW_API_KEY}" \ -H "Content-Type: application/json" \ -d '{ "name": "overlay-capture", "sources": [{ "name": "board_src", "type": "web_capture", "config": { "url": "https://app.example.com/scoreboard", "viewport": { "width": 1920, "height": 1080 }, "fps": 5, "waitForSelector": { "selector": "#ready", "timeout": 10000 } } }], "nodes": [], "sinks": [{ "name": "preview", "type": "rtmp_push", "inputs": ["board_src"], "config": { "urls": ["rtmp://live.example.com/app/key"], "encoding": { "videoCodec": "h264" } } }] }'Example — authenticated page (cookies)
Section titled “Example — authenticated page (cookies)”{ "name": "dash_src", "type": "web_capture", "config": { "url": "https://app.example.com/dashboard", "cookies": [ { "name": "session", "value": "<session-value>", "domain": "app.example.com", "path": "/" } ], "viewport": { "width": 1280, "height": 720 }, "fps": 5 }}Config
Section titled “Config”| Field | Type | Default | Description |
|---|---|---|---|
url | string | required | Page URL (HTTPS). |
viewport | object | see below | Capture viewport. See viewport. |
fps | int | 5 | Capture rate. Full-page paths capped lower (CPU-heavy); element capture allows up to 60. |
captureElement | string | — | CSS selector for element-level capture (el.captureStream). When set, getDisplayMedia is skipped. |
captureAudio | bool | false | Capture page audio when available. |
cookies | array | — | HTTP cookies. See cookies. |
authenticate | object | — | HTTP Basic auth. See authenticate. |
setExtraHTTPHeaders | map | — | Extra request headers (string → string). |
gotoOptions | object | — | page.goto options. See gotoOptions. |
waitForSelector | object | — | Wait for a CSS selector before capture. See waitForSelector. |
waitForTimeout | int | — | Extra delay after load (ms). |
bestAttempt | bool | true | Soft-fail awaited events (goto waitUntil, waitForSelector) instead of failing the source. |
viewport
Section titled “viewport”| Field | Type | Default | Description |
|---|---|---|---|
width | int | path-dependent | Viewport width. Full-page: filled / clamped to max 1920×1080. Element capture: 0 keeps the element’s intrinsic size; non-zero scales via OffscreenCanvas. |
height | int | path-dependent | Viewport height (same rules as width). |
deviceScaleFactor | number | — | Device pixel ratio (screencast / EmulateViewport). |
hasTouch | bool | — | Emulate touch events. |
isLandscape | bool | — | Screen orientation landscape flag. |
isMobile | bool | — | Mobile user-agent / metrics emulation. |
gotoOptions
Section titled “gotoOptions”| Field | Type | Default | Description |
|---|---|---|---|
waitUntil | string | string[] | ["load"] | Navigation lifecycle events: load, domcontentloaded, networkidle0, networkidle2 (case-insensitive). A single string is accepted and normalized to a one-element array. Other values are rejected. |
timeout | int | — | Navigation timeout in ms (max 60000). |
referer | string | — | HTTP Referer header. |
referrerPolicy | string | — | Referrer-Policy for the navigation. |
authenticate
Section titled “authenticate”| Field | Type | Description |
|---|---|---|
username | string | HTTP Basic username (both fields required to enable). |
password | string | HTTP Basic password. |
cookies
Section titled “cookies”Each entry:
| Field | Type | Description |
|---|---|---|
name | string | Cookie name (required). |
value | string | Cookie value (required). |
domain | string | Cookie domain. |
path | string | Cookie path. |
url | string | Associated URL (Puppeteer / CF style). |
expires | number | Expiry as Unix timestamp (seconds). |
httpOnly | bool | HttpOnly flag. |
secure | bool | Secure flag. |
sameSite | string | Strict | Lax | None. |
waitForSelector
Section titled “waitForSelector”| Field | Type | Default | Description |
|---|---|---|---|
selector | string | required | CSS selector to wait for. |
timeout | int | — | Wait timeout in ms. |
visible | bool | — | Require the element to be visible. |
hidden | bool | — | Require the element to be hidden. |
Capture modes
Section titled “Capture modes”| Mode | When | Notes |
|---|---|---|
| Display capture | captureElement empty (local Chrome) | getDisplayMedia; viewport sizes Xvfb / EmulateViewport. |
| Element stream | captureElement set | el.captureStream(fps); viewport is optional scale target. |
| CDP screencast | Remote headless without element selector | Page.captureScreenshot poll; JPEG ≈ width×deviceScaleFactor by height×deviceScaleFactor; typically no audio. |
Pricing
Section titled “Pricing”Tiered by resolution×fps (30/60 buckets) at 1.5× stream-source rates. Source pricing.