Skip to main content
This page covers how cloud recording and stream mixing work as a whole. For the parameters and response structure of each endpoint, see Meeting recording and live streaming.
To pull the meeting’s video out for playback (HTTP-FLV / RTSP) or push it to a live streaming platform (RTMP / RTMPS), see the Media output guide: when the meeting has a stream mixing task, use video=mcu for the composite video; you can also take any single user’s video.

One task, three capabilities

task_type is a bit mask. Each of the three independent capabilities takes one bit; add the values of the ones you want at the same time: So 3 = video recording + stream mixing, and 7 = all three.
Don’t treat 3 as a separate “hybrid mode” type. Earlier docs listed the values as “1 recording, 2 mixing, 3 hybrid”, which was wrong—it left out audio recording and misrepresented how the values combine.
The former type 8 (live stream) has been removed; passing 8 or a combination that includes 8 returns parameter error 10070 (invalid request parameters). For live streaming, use 2 (stream mixing) plus Media output to pull or push. At upgrade time, the task_type of historical tasks has 8 replaced with 2 (for example, 9 → 3).

Some tasks start automatically

This is where SMeeting differs most from the underlying SRTC: not every recording needs you to call start manually. When the first person enters the meeting, the server decides whether to start a task based on the meeting’s own settings: If live streaming is enabled in your deployment, a regular meeting with auto_record on also mixes streams and actually starts 3 (video recording + stream mixing), so the composite video can be pulled or pushed directly. This switch is set by the deployment, not by the API. If you’re not sure, ask us. Automatically started tasks use the meeting’s own layout_data (passed when creating or modifying the meeting) for the layout; if none is set, the server’s default layout is used (auto by default). So: set auto_record to true when you create the meeting, and you don’t need to manage starting and stopping recording in your business logic. Calling start manually is for cases like “deciding to record partway through the meeting”.

Calling start again for the same meeting updates the task instead of creating one

A meeting has only one in-progress task per type. Calling start again with different parameters changes the existing task (for example, switching the layout). It doesn’t create another task or a second recording file.

Key differences between video recording and live streaming

For live pulling and pushing, see the Media output guide. The layout_data.push_url push parameters of mcu/start have been removed; use stream/push/start instead.
To get playback URLs, wait for the mcu_record_done callback. Don’t request them as soon as the task ends—transcoding usually isn’t finished yet.

Choosing a layout

layout_data.layout determines the video layout. There are two kinds:
  • auto (automatic layout): only members with video get a view; the grid is picked by headcount and switches as people come and go. Works for most cases. div_list has no effect under auto
  • Fixed layouts: the structure does not change with headcount, and you can use div_list to pin specific people to specific views (see the next section)
If layout is omitted, the server’s default layout is used (auto by default; the deployer can change it). Fixed layouts at a glance (the number in each view is its index idx; blue marks the large view):
A value not in this table does not return an error; it is silently treated as auto. N in grids_N is not continuous (there is no 7 or 11), so check the table before spelling it out.
The watermark and name labels can fall back to defaults; the layout cannot. When layout_data omits watermark / tag, watermark_type / window_tag_type from the recording settings are used. The layout, however, is not taken from that configuration—if you need a fixed layout, pass it in layout_data.layout every time you start a task.

Pinning members to specific views

layout_data.div_list only works with fixed layouts. Each element pins one view:
  • cells[0].idx: the view index, starting at 0, in the same order as <td> cells in an HTML table (left to right, top to bottom); see the table above for the index of the large view. It must be less than the layout’s view count
  • uids[0]: the person pinned to this view (use the user_id). If that person is not in the meeting, the view stays empty for them
  • When cells[0].bind_share is true, the view always shows the current screen share (regardless of who is sharing; uids is ignored). When no one is sharing, the view stays empty
  • Only the first entry of cells and of uids in an element is used; extras are ignored. To pin several views, put several elements in div_list
How the remaining views are filled depends on polling_dur: So if you want a fixed layout with “a few people pinned and everyone else arranged automatically”, you must set polling_dur; otherwise only the pinned views show video. Typical use: “main speaker pinned to the large view, screen share pinned to one small view, everyone else rotating through the remaining small views”:

Active speaker view and speaker highlight

Two switches, both set per task (pass them when starting the task or when changing the layout mid-session). They are independent and can be used together:
  • Active speaker view: mark a view in div_list with "bind_speaker": true, and that view automatically shows whoever is currently speaking, switching as the speaker changes. Only works with fixed layouts; at most one such view per layout; it cannot be the same view as bind_share; no uids needed for it
  • Speaker highlight: when layout_data.speaker_border is true, the view of the person currently speaking gets a green border. Works with both automatic and fixed layouts
Switching rhythm of the active speaker view (fixed, not configurable):
  • A person must keep speaking for about 1.5 seconds before being switched in; coughs and short interjections do not trigger a switch
  • Once switched in, they stay for at least 3 seconds; while the person in the view is still speaking, no one else can replace them
  • It usually takes 2–3 seconds from someone starting to speak to their video appearing (a person not shown in any other view needs their video pulled first; until then the view keeps showing the previous person, so there is no black flash)
  • Before anyone has spoken, the view shows an “Active speaker” placeholder; after that it keeps the last person who spoke until the next speaker is switched in. If that person leaves the meeting, the view returns to the placeholder
  • If the speaker is also pinned to another view, both views show them; without a camera, their avatar and name are shown
Typical use: “4-view grid, the first 3 views pinned to 3 guests, the 4th view automatically showing whoever is speaking, with speaker highlight on”:
Who is speaking is determined by the server from the speech levels reported by each client. Requires server v1.14.0 and compositing service 1.4.0 or later; SIP / H.323 endpoints joining through the device gateway need device gateway 1.8.0 or later to be recognized as speakers. Apps whose media route is a third-party CDN do not support these two features.
In a fixed layout, an invalid combination (more than one active speaker view, the same view as bind_share, or a view index that is negative, out of range, or repeated) returns error code 1043. In an automatic layout div_list is ignored entirely, so bind_speaker is ignored too and no error is returned.

Behavior when no one is in the meeting

layout_data.nobody_text determines what happens when no one is in the meeting:
  • Empty → recording pauses (recommended, to avoid long stretches of black video)
  • Text set → recording continues and shows the text

Watermark and member name labels

  • watermark.type: 0 default, 1 none, 2 single row, 3 multiple rows. If watermark.text is empty, the meeting title is used as the watermark
  • The position of member name labels is written as a combination of letters: L left, R right, T top, B bottom, which can be combined (LB = bottom left). Empty means no labels
  • Leave font size, color, and outline at their defaults; set them only when you have specific visual requirements

Full sequence

One recording produces multiple files

Recording is not “one recording, one file”. Two situations split it into multiple files:
  • The recording is longer than the segment limit (1 hour by default): when transcoding after the task ends, it is split into rolling segments by duration, with continuous time between segments
  • The underlying recording stops automatically partway through because there has been no audio or video for 30 seconds, and is then restarted: a new segment starts, with a time gap between segments
So keep three things in mind when integrating:
  1. Get URLs by record_id, not task_id. The mcu_record_done callback is sent per file, so one recording sends several, each with its own record_id. task_id identifies the whole task and only locates the task.
  2. vods-url returns all segments of the meeting in one call, sorted by segment number. Each segment includes record_id / seq / began_at / duration / offset_ms. For continuous playback, play in seq order and use offset_ms to build the progress bar.
  3. There is a time gap between a reason=2 segment and the previous one (recording was interrupted). Continuous playback jumps there, so it’s worth showing a hint in your UI.
The four vods-url fields url / size / mcu_at / mcu_dur keep their meaning (mcu_at is this segment’s start time, mcu_dur is this segment’s duration). If you already integrated with these fields, you don’t need to change anything.
Recording files start transcoding and uploading only after the task ends. So there is a wait between stopping the recording and being able to play it, and longer for long recordings. To tell when a recording is playable, rely on the mcu_record_done callback (is_last is true on the last one), not on the task status changing to “ended”.

Billing note

Video recording, stream mixing, and audio recording (as well as pushes) are server-side capabilities that incur ongoing costs. Leaving auto_record on means every meeting is recorded— confirm that’s what you want before going live. For manually started tasks, it’s best to explicitly call stop in your meeting-ending flow.