Publish policies

Reference for Vision publish policies, including FPS and bitrate budgets, runtime control methods, auto-publish behavior, and WebGL-specific behavior.

ConvaiVisionPublisher manages the WebRTC video track that carries the camera feed from Unity to Convai. A publish policy controls the client-side frame rate and bitrate budget; it does not configure any AI model or backend vision provider.

Inspector reference

The Inspector is divided into two collapsible sections: FRAME SOURCE and PUBLISH POLICY.

FRAME SOURCE

Field
Type
Default
Description

Source

MonoBehaviour

(auto-discovered)

The IVisionFrameSource to publish. Leave blank to auto-discover from the same GameObject, children, or scene. Assign explicitly when multiple frame sources are present.

Track Name

string

"unity-scene"

The name of the WebRTC track as it appears in the LiveKit room. Change only if your backend routing requires a specific name.

PUBLISH POLICY

Field
Type
Default
Description

Mode

VisionPublishPolicy

AutoCompatible

Controls the client-side frame rate and bitrate budget. See Publish policies below.

Max Publish FPS

int (0–30)

0

Per-instance frame rate ceiling in fps. 0 uses the selected policy default.

Max Bitrate (bps)

int

0

Per-instance maximum bitrate in bits per second. 0 uses the selected policy default.

Publish policies

A publish policy is a client-side transport budget. It controls how many frames per second are sent and the maximum bitrate allocated to the video track.

Policy
FPS
Max bitrate
When to use

AutoCompatible

10

750 kbps

Default. Balanced budget compatible with the current backend processing rate. Use this unless you have a specific reason to change it.

HighResponsiveness

15

1 000 kbps

Scenes where faster visual updates improve AI response quality (fast-moving objects, gesture recognition). Higher network cost.

LowOverhead

5

350 kbps

High-volume deployments, mobile devices with limited bandwidth, or scenes where the visual context changes slowly.

Manual

(none)

(none)

Publishing does not start automatically on room connect. Call EnablePublishing(true) from a script to start. Use for session-gated or trigger-based capture.

To override the policy defaults for a specific instance without changing the policy, set Max Publish FPS or Max Bitrate (bps) in the Inspector. A value of 0 means "use the policy default".

Control publishing from scripts

Switch policy at runtime

Call SetPublishPolicy to change the transport budget while a session is running. The change takes effect on the next published frame.

Pause and resume with Manual policy

Manual policy is useful when visual context is only relevant during specific moments — for example, when the player is looking at a particular object.

Check publish state

Read IsPublishing to confirm a video track is actively being sent.

IsPublishing becomes true after ConvaiRoomManager connects with Connection Type set to Video, the frame source reaches the Ready state, and the coordinator successfully opens the WebRTC video track.

Auto-publish behavior

For AutoCompatible, HighResponsiveness, and LowOverhead, publishing begins automatically when the room connects. The publisher waits for the frame source to signal readiness before opening the track — no script is required.

The sequence on room connect:

  1. ConvaiRoomManager establishes a Video connection.

  2. ConvaiVisionPublisher starts and resolves the frame source.

  3. The frame source starts capture and signals Ready.

  4. The coordinator opens a WebRTC video track named videoTrackName.

  5. IsPublishing becomes true and the VideoTrackPublished domain event fires.

WebGL

On WebGL, no frame source component is required or used. ConvaiVisionPublisher captures the visible browser canvas automatically via canvas.captureStream() as soon as the room connects. The assigned Source field is ignored.

Behavior
Detail

Frame source

None required. Assigned frame source is ignored on WebGL.

Frame rate

Clamped to 15 fps regardless of selected policy.

Bitrate

Policy bitrate applies (no additional clamping).

HTTPS

Required in production. http://localhost is the only exception.

Next steps

Vision scripting APIVision debug previewTroubleshoot vision

Last updated

Was this helpful?