Live Broadcast Function Overview

Introduction

Agora Native SDK supports both Communication and Live Broadcast functions which is set when calling setChannelProfile before joining a channel. This document describes the detailed functions when the Agora Native SDK is used for Live Broadcast.

For users who want to use the Agora Native SDK for Communication, refer to Communication Function Overview.

Note

For the functions without references to other documents for detailed implementation, refer to each platform API reference. For each function, a diagram to indicate the API sequence will be provided in the later releases.

Basic Live Broadcast

Channel Setup

Agora Native SDK allows you to join and leave the shared Agora channels for live broadcast, identified by unique channel names, Your application code should create and manage unique channel names.

../../_images/basic_live.png

Media Control

Agora Native SDK allows you to enable and disable voice and video (allowing muting) and set various voice and video parameters that help the Agora Native SDK optimize communications. Many of the SDK operations are automated and do not require developer intervention if these parameter settings are not provided.

Device Control

Agora Native SDK allows you to access the microphone or speakerphone, set the volume, select from alternative cameras, and set the video window display.

Host in and Push Streams

Overview

Agora Native SDK supports the following basic functions when it comes to host in:

  • It supports up to 7 video hosts interacting with each other in the same Agora Channel in real time;
  • No limitation on the number of audiences who can watch the Live Broadcast;
  • The host can switch to audience anytime during the Live Broadcast, and vice versa;

Note

Agora will provide anti-stealing-link in the later releases.

Agora Native SDK supports two main scenarios, and both users host in at the client side, and the differences are:

For how to implement the host-in and push-stream functions, refer to Host in.

Client Host in + Server Push Stream

This scenario supports two modes, and the differences are:

Mode Description Platform
Mode A The Agora SDK captures both video and audio data. Android/iOS/Windows/Mac
Mode B The Agora SDK captures the audio data, while the users capture the video data by themselves. Android/iOS

See the following diagrams for details:

map to buried treasure

Mode A

map to buried treasure

Mode B

Client Host in + Client Push Stream

This scenario supports three modes, and the differences are:

Mode Description Platform
Mode A The Agora SDK captures both video and audio data. Android/iOS/Windows/Mac
Mode B The Agora SDK captures the audio data, while the users capture the video data by themselves; Android/iOS
Mode C The users capture both the video and audio data by themselves; Android/iOS/Windows/Mac

Note

In this scenario, Agora has only verified: One-to-One host-in, and the resolution of both hosts is 360P. The bandwidth is more demanding compared with Client Host in + Server Push Stream due to it pushes one more stream on the client side.

See the following diagrams for details:

map to buried treasure

Mode A

map to buried treasure

Mode B

map to buried treasure

Mode C

Other Scenario

This section provides the description for customized solutions.

For example,

map to buried treasure

In this example, the developer application only uses the Agora host-in function. By getting the raw data using the Agora raw data interface, the developers blend the pictures and push stream by themselves. The hosts are in different one-way broadcast channels using the application, and each audience can see the interaction between the hosts, after picture-blending.

Since this customized scenario is only applicable to the one-way scenario, the audiences can not switch the user role to host in.

Adjusting Picture-in-Picture Layout

If the users want to adjust the picture-in-picture layouts flexibly by themselves using SDK interfaces, it is difficult to achieve that flexibly using the normal CDN+RTMP technology, but very easy with Agora Cloud(See What is the difference between Agora Cloud and CDN RTMP?).

Note

It is mandatory to follow Adjust Picture-in-Picture to adjust the layouts before the video can be displayed on the screen in a live broadcast.

Bypass Live and Social Sharing

The users can push the streams to the CDN side for the audiences to watch the Bypass live in a web browser, which can also be shared in various social media. For more details, refer to Enable Bypass Live.

Recording

The users can record the live broadcast at the CDN side with simple application and configuration. For details, refer to CDN Recording for Live Broadcast.

Image Enhancement

Agora Native SDK users can integrate some special visual effects for image enhancements if necessary.

Agora provides a separate SDK to include this function based on Agora Native SDK. For details, refer to Using Image Enhancement Beta.

Single Stream and Dual Streams

In the Live Broadcast scenario, Agora supports two user roles: host and audience, each of which has single-stream and dual-stream mode(high and low streams are decided by resolution, frame rate, and bitrate).

  • Single-Stream Host and Dual-Stream Host: The single-stream host only sends one stream, while the dual-stream host sends two streams.
  • Single Stream Audience and Dual-Stream Audience: Both single-stream and dual-stream audience receive only one stream from each host, the difference is the single stream receives the high stream by default, while the dual-stream audience receives the low stream by default. Both can switch the stream type by calling setRemoteVideoStreamType(Android/Windows) or setRemoteVideoStream(iOS/Mac).
Role and Mode Single-Stream Host Dual-Stream Host
Single-Stream Audience Supported Not supported
Dual-Stream Audience Not supported Supported

Single-Stream Audience and Host

The host sends only one stream.

map to buried treasure

Single Stream Mode

Dual-Stream Audience and Host

The host sends both high and low streams, and each audience can select one stream from the two streams sent by each host.

map to buried treasure

Dual Stream Mode

Data Encryption

Agora Native SDK allows you to encrypt the audio and video packets in one of the following ways:

  • Using Agora Built-in Encryption
  • Using Developer Customized Encrytion

For details, refer to Data Encryption.

Note

Do not use this function together with CDN, which means if you decide to use CDN for Bypass Live and recording/storage and etc, the data encryption function is not supported.

Data Channel

The users can receive reliable and ordered packets via data channels.

Note

Agora Native SDK for Web does not support the data channel yet.

Raw Data Modification

Agora raw data interface is an advanced feature provided in the SDK library for users to obtain the audio/video raw data of the SDK engine. You, as a developer, can modify the audio or video data and create special effects to meet special needs of their applications.

You can insert a pre-processing stage before sending the data to the encoder, modifying the captured of video frames or audio signals. You can also insert a post-processing stage before sending the data to the decoder, modifying the received video frames or audio signals.

For details, refer to Modify Raw Data .

Note

Agora Native SDK for Web does not supporting raw data modification yet.

Automatic Pornography Detection

Agora allows you to detect whether there is any sensitive or pornographic contents through simple configuration.

For details, refer to ../live_broadcast/auto_porn_detection.

Host-in Authentication

Agora allows you to authentication the host privilege when users request to host in during the live broadcast which protects the live broadcast from any random disturb.

For details, refer to Host-in Authentication.

Quality Management

Agora Native SDK allows you to obtain statistics and quality indicators about network conditions on the Dashboard, run built-in tests, submit ratings and complaints about sessions and enable different levels of error logging on the dashboard. The host bitrate is adjusted dynamically according to the current network quality.