Skip to main content

Multi-Camera

Multi-Camera lets you cut between several camera angles while your viewers watch one continuous video. Each angle is a normal live stream. You decide which angle is on air, and every connected player follows within a moment, with no video mixer or production software involved.

Use it for a live casino table with wide, wheel and dealer cameras, sports with several camera positions, live auctions that show the lot from every angle, or events with stage, speaker and audience cameras.

How it works​

  1. Set up a stream group. You send the list of camera angles to the nanoStream Real-Time API. The API calls a stream group a room. It checks each stream and returns a ready-to-embed player URL.
  2. Embed the player. You put the player URL in an iframe. Viewers start on the default angle straight away.
  3. Switch angles. When you want to cut, your backend sends one call with the angle to put on air.
  4. Players follow. The API pushes the change to every connected player, and each one switches without a gap.

Built-in reliability:

  • No black screen. If a switch fails, the player retries and keeps playing the last good angle.
  • Instant start. Viewers see video as soon as the player loads, with no waiting screen.
  • Late joiners are in sync. A viewer who joins or reconnects gets the angle that is on air now.
  • Order is guaranteed. Every switch has a sequence number, so an old event never overwrites a newer one.
note

Multi-Camera switches the program for all viewers, driven by your backend. To let each viewer pick a stream themselves, see Multi-Player and the player's stream switching in Player features.

Before you start​

You needDetails
AccountAny free or production account. Multi-Camera is included on every account.
StreamsOne live stream per camera angle, up to 10. Create them in the setup, or use existing ones.
EncodersOne encoder per angle, sending to its stream. See RTMP ingest & encoder settings.
Token (API only)A bintu token, or your API key. See nanoStream Real-Time API.

Set it up​

There is no Dashboard setting for Multi-Camera; use the Builder Hub or the API.

Who can use it: free account or existing customer (Multi-Camera is available on every account during a promotional period; this may change). Guests see Set up multi-camera marked Sign in; clicking it opens the sign-in form. The Multi-Camera Preview under Demos works without an account.

The tool runs the whole flow on your own streams and logs every switch.

Builder Hub multi-camera setup: a program player showing the angle on air, three camera buttons (wide on air, close and dealer on standby) and the event log
Click a camera, or press 1–6, to cut: every viewer's player follows the angle on air.
  1. Open builder.nanocosmos.net, sign in, and choose Build › Stream › Set up multi-camera. The tool opens with your hub sign-in, so its Connect step is already done.
  2. Camera Angles: choose how many angles you need. Create new makes a fresh stream for each angle, with optional tags and transcoding; Use existing lets you pick streams your organisation already has (Refresh streams reloads the list). Click Configure Streams.
  3. Stream Group (Room): enter a Group Name, or leave it blank to have one generated, and click Create Stream Group. Reusing a name picks up an earlier group: its angles are replaced, and the angle on air stays on air.
  4. Control: the player shows what your viewers see. Click a camera, or press 1 to 6, to cut. The on-air angle is green, and the Event log lists every switch.
  5. Click Copy player link to get the link for your viewers. How it works & API shows the ingest details for each angle and the exact API calls for your group. Start one encoder per angle with those details.

What you get: a stream group (room) that holds your camera angles with one angle on air; a player link your viewers open to watch the program output (late joiners start on the angle that is on air now); and a log of every cut you made.

Just want to look first? On the tool page, See it with sample cameras opens the Multi-Camera Preview; guests and free accounts also find it under Demos. It shows four camera angles we stream, cut to one program output. Click an input, press 1 to 4, or use Take Next (Space). The bar above it reads Sample content: four camera angles we stream for this demo. Nothing there touches your account.

What can go wrong​

ProblemWhat to do
A tile or the program output stays blackThat angle isn't live yet. Start its encoder with the ingest details (in the Builder Hub under How it works & API).
The Builder Hub tool asks you to sign inYou're a guest. Sign in or create a free account; the Multi-Camera Preview works without one.
You want each viewer to choose their own angleMulti-Camera switches the program for everyone. Use Multi-Player instead.

API walkthrough​

Step 1: Set up a stream group​

Call POST /rooms/setup once per group, for example when a table opens. Give each angle a label and mark exactly one as active: that is what viewers see first.

curl -X POST https://real-time-api.nanostream.cloud/rooms/setup \
-H "Authorization: Bearer $BINTU_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"roomId": "roulette-7",
"streams": [
{ "label": "wide", "stream": "XXXXX-AAAAA", "active": true },
{ "label": "wheel", "stream": "XXXXX-BBBBB" },
{ "label": "dealer", "stream": "XXXXX-CCCCC" }
]
}'
const res = await fetch('https://real-time-api.nanostream.cloud/rooms/setup', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.BINTU_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
roomId: 'roulette-7',
streams: [
{ label: 'wide', stream: 'XXXXX-AAAAA', active: true },
{ label: 'wheel', stream: 'XXXXX-BBBBB' },
{ label: 'dealer', stream: 'XXXXX-CCCCC' },
],
}),
});
const { roomId, playerUrl } = await res.json();

Response (201 Created):

{
"roomId": "roulette-7",
"playerUrl": "https://…/player.html?roomId=roulette-7&token=…",
"streams": [
{ "label": "wide", "streamId": "951dfcca-…", "streamName": "XXXXX-AAAAA", "active": true },
{ "label": "wheel", "streamId": "a1b2c3d4-…", "streamName": "XXXXX-BBBBB", "active": false },
{ "label": "dealer", "streamId": "f0e1d2c3-…", "streamName": "XXXXX-CCCCC", "active": false }
]
}
FieldTypeRequiredDescription
roomIdstringNoYour name for the group. If left out, one is generated from your organisation and the default angle's label, so set your own when you run more than one group.
streamsarrayYes1–10 camera angles. Exactly one has active: true.
streams[].labelstringYesName of the angle, unique within the group (case-insensitive). You use it in every switch call.
streams[].streamstringYesStream name (XXXXX-YYYYY) or stream ID (UUID)
streams[].activebooleanNotrue for the angle viewers see first. Default false.
security.jwtokenstringNoPlayback token for organisations with secure playback. It is built into the player URL.

Step 2: Embed the player​

Put the playerUrl into an iframe. Don't build the URL yourself: it contains a signed token that lets the player receive switch events for this group only, so it is safe to give to viewers.

<iframe
src="PLAYER_URL_FROM_SETUP"
width="1280"
height="720"
frameborder="0"
allow="autoplay; fullscreen"
allowfullscreen>
</iframe>

The player starts muted with autoplay, uses fast start and the balancedadaptive latency mode. If you didn't pass a playback token to /rooms/setup, append &group.security.jwtoken=<YOUR_JWT> to the player URL for secure streams.

Step 3: Switch angles​

Call PUT /rooms/{roomId}/switch whenever you want to cut. Send the label to put on air in active, and the full set of angles in angles with every call.

curl -X PUT https://real-time-api.nanostream.cloud/rooms/roulette-7/switch \
-H "Authorization: Bearer $BINTU_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"active": "wheel",
"angles": {
"wide": "XXXXX-AAAAA",
"wheel": "XXXXX-BBBBB",
"dealer": "XXXXX-CCCCC"
}
}'
{ "ok": true, "roomId": "roulette-7", "active": "wheel", "seq": 1726900749616 }

Every player in the group switches to the wheel angle. seq is a sequence number (a timestamp in milliseconds) that players use to ignore out-of-date events.

API reference​

MethodPathCalled byPurpose
POST/rooms/setupYour backendSet up a stream group and get the player URL
PUT/rooms/{roomId}/switchYour backendChange the angle on air
GET/rooms/{roomId}/eventsThe playerReceive switch events (server-sent events)

Switch events​

The hosted player opens GET /rooms/{roomId}/events?token=<player token> on its own. It authenticates with the signed player token from the player URL, not your bintu token. Viewers never receive the full list of angles.

EventWhenData
sourceOn connect (if an angle is on air) and on every switchroomId, active, seq, source.streamname
waitingOn connect, if no switch has happened yetroomId
: pingEvery 20 secondsKeep-alive comment, no data
event: source
data: {"roomId":"roulette-7","active":"wheel","seq":1726900749616,"source":{"streamname":"XXXXX-BBBBB"}}

Errors​

All errors share one shape:

{ "error": { "code": "bad_request", "message": "exactly one stream must be active" } }
CodeStatusTypical cause
bad_request400No active angle or more than one; active isn't a key in angles
unauthenticated401Missing or invalid bintu token
forbidden403A stream doesn't belong to your organisation
stream_not_found404A stream wasn't found in your account
internal_error500Server error
bintu_error, vtrans_error502An upstream service returned an error. Retry.
upstream_unavailable504An upstream service couldn't be reached. Retry.

The full OpenAPI reference, where you can try every call, is at real-time-api.nanostream.cloud/docs.

Next steps​

tip

Try it in the Builder Hub: open Multi-Camera, group your own streams and cut between them live, or watch the Multi-Camera Preview without an account. Start for Free