Skip to main content

What is a track?

A track is a named media stream between your app and the model. Tracks carry video, audio, or any other data the model expects or produces. Every track has a name that both sides use to identify it.

Server-driven track configuration

Track configuration is server-driven. Each model declares the tracks it exposes in its schema, which is the same schema documented on each model’s reference page. Your app does not need to declare tracks up front; the SDK reads the schema and sets up the WebRTC connection accordingly. For the authoritative list of tracks a model exposes, see its Schema page in the Model API Reference. For example, Helios or LingBot. Every track has a name, a kind ("video" or "audio"), and a direction:
  • recvonly tracks are outputs from the model to your app (e.g. generated video).
  • sendonly tracks are inputs from your app to the model (e.g. webcam feed).
A model’s schema lists its tracks like this:
Schema (tracks)

Output tracks (model to app)

The SDK receives the model’s output tracks automatically. Read them by name once the track arrives.
If the model exposes multiple output tracks (e.g. a depth map or audio), they are all received automatically. The model emits frames to its output tracks the whole time the session runs; pausing and resuming only switches whether your client receives them, like subscribing and unsubscribing. By default every output is subscribed as soon as the connection is ready. In JavaScript, connect with autoResumeTracks: false to start unsubscribed, then call resumeTrack(name) / pauseTrack(name) to switch a track on or off; in Python, call track.resume() / track.pause() on the Track itself. See connect().
Python’s connect() has no auto_resume_tracks option — every output track always starts subscribed. Call track.pause() right after connect() if you need one unsubscribed from the start.

Input tracks (app to model)

Some models accept input tracks (e.g. a webcam feed for video-to-video transformation). Input tracks are explicit: the model receives nothing on a sendonly track until your app publishes a media track to it. Connecting alone never starts sending, so publish once the connection reaches ready. The JavaScript variant captures the webcam with getUserMedia; in React the WebcamStream component captures and publishes for you.
Call unpublishTrack(name) (or track.unpublish() / reactor.unpublish_track(name) in Python) to stop sending a track. Typically you do this on disconnect or when the source media stops.
In Python, a failed publish() does not clean up the session by itself — wrap the connected lifetime, publish included, in try/finally: await reactor.disconnect(), or a failure here can leave an orphaned session behind. See publish_track().
Only one connection may publish a given input track at a time. In a session shared by multiple connections, publishing a track that another connection already holds is rejected until that connection unpublishes it.

Naming convention

Here’s how track names map between the model and your app:
Track naming: model track names must match app track names
For output tracks, the SDK handles naming automatically. For input tracks (e.g. webcam), the track name you publish must match the attribute name defined in the model’s Python class.
If a track is not working, check that the track name you are using matches the model’s declared track name. See the model’s Schema page in the Model API Reference for the authoritative list.
Check the Model API Reference to see what tracks a model exposes. In Python, reactor.track(name) returns an object with publish(), push_frame(), on_frame(), and pause()/resume() that refuse whatever the track’s direction doesn’t allow, rather than silently doing nothing for a typo’d name. When you don’t want to hardcode the name, reactor.tracks filters by kind and direction instead: reactor.tracks.with_direction("recvonly").with_kind("video").one().