Video Layout

1 Introduction

  • When multiple users join a room, the platform can mix multiple audio/video streams into one stream, and then push it to CDN or for cloud recording.
  • When users publish live streaming in different rooms, the platform can also mix multiple audio/video streams from specified rooms into one stream for pushing to CDN or cloud recording.

2 Parameters

NameTypeRequiredSample ValueDescription
inputJSONArrayNo123456789Input parameter, optional for those using a layout template ID for mixing streams
outputJSONYes Output parameters
templateidnumberNo Layout template ID:
1- Horizontal Layout
2-Vertical Layout
3- Tiled Layout
4- Corner Layout
Only valid for stream mixing in a room.

2.1 Input Parameters

NameTypeRequiredSample ValueDescription
uidstringYes123456789Source stream user ID
roomidstringYes1001Room ID of source stream user ID
streamtypeintYes0Stream type: 0: audio/video, 1: video, 2: audio
zOrderintYes0Layer (0 indicates the bottommost layer; 1 is the first layer up from the bottom, and so on, up to 16 layers)
layoutXintYes0Top left corner x-coordinate (coordinate system: x-axis increases from left to right; y-axis increases downward)
Value range: (0-10000)
layoutYintYes0Top left corner y-coordinate; Value range: (0-10000)
layoutHintYes0Height in canvas; Value range: (0-10000)
layoutWintYes0Width in canvas; Value range: (0-10000)
cropintNo0Zooming display options
0: input stream display is centered and surrounded by a black border
1: the screen is filled as much as possible by centering and clipping
Value range: 0 or 1
cutoutXintNo0If input is a cutout from the original, the cutout area's x-coordinate in the original
Value range: (0-10000)
cutoutYintNo0If input is a cutout from the original, the cutout area's y-coordinate in the original
Value range: (0-10000)
cutoutHintNo0If input is a cutout from the original, the cutout area's height
Value range: (0-10000)
cutoutWintNo0If input is a cutout from the original, the cutout area's width
Value range: (0-10000)
alphafloatNo0.5The transparency level of the video frame, Value range: [0.0, 1.0]
"0.0"- Completely transparent
"1.0:"-Opaque

2.2 Output Parameters

NameTypeRequiredSample ValueDescription
streamtypeintYes0Stream type: 0: audio/video
videoheightintNo600Video height, a multiple of 8, value range: (0-10000)
videowidthintNo800Video width, a multiple of 8, value range: (0-10000)
videobitrateintNo800Video bit rate (kbps); Value range: (0-10000]
videofpsintNo24Video frame rate, value range: (0-60), default value: 15, unit: fps
videogopintNo72Video GOP in frames, which is a multiple of videofps
Value range: (0-1000), default value: 30, unit: fps
videoencodeintNo100Video encoding
100: H264
101: H265
default is H264; H265 not currently supported
audiobitrateintNo64Audio bit rate (kbps), filled with a fixed value of 64 and adjust situationally according to the audioencode value.
audiochannelintNo2Audio channels, filled with a fixed value of 2
audiosampleintNo44100Audio sampling rate, filled with a fixed value of 44100
audioencodeintNo1Audio code
1: AAC+
35: AAC (128 kbps)

2.3 Layout Template ID

2.3.1 Horizontal Layout

The first user appears in the larger upper window, while other users appear in small windows below. The smaller windows hover above the large-window picture. There may be two rows at most, each containing up to eight small windows, thus supporting the display of 17 users in total.

  • 2-5 windows are displayed like so:
    img
  • 6-7 windows are displayed like so:
    img
  • 8-9 windows are displayed like so:
    img
  • 9-17 windows are displayed like so:
    img

2.3.2 Vertical Layout

The first user appears in the large-window picture at the left side, with other users in the small-window pictures at the right side. Two rows of small windows can be provided at most, each of which can contain 8 pictures. In total, 17 user pictures can be supported in the small windows.

The large-window picture and the small-window pictures are separated.

  • 2-5 windows are displayed like so:
    img
  • 6-7 windows are displayed like so:
    img
  • 8-9 windows are displayed like so:
    img
  • 9-17 windows are displayed like so:
    img

2.3.3 Tiled Layout

Automatically adjust the size of each picture based on the number of users. The picture sizes of all users are the same, and 16 pictures (4 x 4) can be supported in total.

  • When the number of video pictures is 2, the effect is as follows:
    img
  • 3-4 windows are displayed like so:
    img
  • 5-9 windows are displayed like so:
    img
  • 10-16 windows are displayed like so:
    img

2.3.4 Corner Layout

The first user occupies the whole large window, and one small window hovers at each corner. This layout supports four small windows at most, and includes five pictures in total. At present, only a fixed layout is supported. The canvas size is 1280*720, and the size of each small window is 300*300. The effect is as follows: img

3. Notices

  • The layout template is not supported during cross-room stream mixing.
  • Contact customer support for customizing layout templates.

Was this page helpful?

Helpful Not helpful
Submitted! Your feedback would help us improve the website.
Feedback
Top
<