When multiple users publish live streaming in different rooms or in one room, the platform can also mix multiple audio/video streams from specified rooms into one path for pushing to CDN or to the cloud for recording.
When starting to mix streams through RESTful API, you can set the display position, video screen size, watermark, background and SEI of the user's video screen by selecting the layout templateid or custom options to achieve the best display effect.
Notices:
Call startrecord
to start record task and set templateid and output in mixconfig parameters.
Notices: Watermark (time stamp, text or picture), background or SEI can be set when you fill the values of watermark, background, base64seidata in output .
(Optional) In order to update layout, you can call updatemixrecord
to update mixconfig parameters .
Features | Implementation |
---|---|
Layout template | Layout template ID: 1-Horizontal, 2-Vertical, 3-Tiled, 4-Corner, 5-5 Users Horizontal |
Watermark | Watermark (time stamp, text or picture) can be set when you fill the values of watermark in output . |
Background | Background can be set when you fill the values of background in output . |
SEI | SEI can be set when you fill the values of base64seidata in output . |
The first user appears in the large-window picture at the upper side, with other users in the small-window pictures at the lower side. The small-window pictures hover above the large-window picture. 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.
- For the large image, if the aspect ratio of the picture is inconsistent with the aspect ratio of the video stream, the output video will be scaled without cropping.
- For small pictures, if the aspect ratio of the picture is inconsistent with the aspect ratio of the video stream, the output video will be cropped to fill the small picture.
- If a user only publishes audio, it will not occupy the layout position.
The effect is as below:
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.
- For the large picture, if the aspect ratio of the picture is inconsistent with the aspect ratio of the video stream, the output video will be scaled without cropping.
- For small pictures, if the aspect ratio of the picture is inconsistent with the aspect ratio of the video stream, the output video will be cropped to fill the small picture.
- If a user only publishes audio, it will not occupy the layout position.
The effect is as below:
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.
- If the aspect ratio of the picture is inconsistent with the aspect ratio of the video stream, the output video will be cropped to fill the picture.
- If a user only publishes audio, it will not occupy the layout position.
The effect is as below:
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 distance between the small window and the large window is 10 pixels.
- For the large picture, if the aspect ratio of the picture is inconsistent with the aspect ratio of the video stream, the output video will be scaled without cropping.
- For small pictures, if the aspect ratio of the picture is inconsistent with the aspect ratio of the video stream, the output video will be cropped to fill the small picture.
- If a user only publishes audio, it will not occupy the layout position.
The effect is as below:
The first user occupies the whole large window, other users arrange and display the small window screens below, supporting totally 4 small windows at most, and the small window screens are floating above the large window screen. 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 distance between the small window and the large window is 16 pixels.
- For the large picture, if the aspect ratio of the picture is inconsistent with the aspect ratio of the video stream, the output video will be scaled without cropping.
- For small pictures, if the aspect ratio of the picture is inconsistent with the aspect ratio of the video stream, the output video will be cropped to fill the small picture.
- If a user only publishes audio, it will not occupy the layout position.
The effect is as below:
Call startrecord
to start record task and set intput and output in mixconfig parameters.
Notices: Watermark (time stamp, text or picture), background or SEI can be set when you fill the values of watermark, background, base64seidata in output .
(Optional) In order to update layout, you can call updatemixrecord
to update mixconfig parameters .
Features | Implementation |
---|---|
Custom layout | Input parameters layoutX , layoutY , layoutH and layoutW in the input of mixconfig to define the display position of the output screen of a user. Please refer to Layout coordinate system. |
Crop video | Input parameters cropX , cropY , cropH , cropW in the input of mixconfig to intercept part of the entire user video screen and perform partial output. Please refer to Video cropping coordinate system. |
Watermark | Watermark (time stamp, text or picture) can be set when you fill the values of watermark in output . |
Background | Background can be set when you fill the values of background in output . |
SEI | SEI can be set when you fill the values of base64seidata in output . |
/ Video is the output screen of one user
| videowidth |
|-----------------------------------------------|---
| (0,0) |
| |
| (layoutX, layoutY) |
| |----layoutW-----| |
| | | | videoheight
| layoutH | | |
| | Video | |
| Canvas | | |
| |----------------| |
|-----------------------------------------------|---
/ original is the original video of one user, crop is the intercepted user video
|---------------------------------------------|---
| (0,0) |
| |
| (cropX,cropY) |
| |------cropW-----| |
| | | |
| cropH | | |
| | crop | |
| original | | |
| |----------------| |
|---------------------------------------------|---