Current location - Quotes Website - Personality signature - How to use Alibaba Cloud to quickly access the live broadcast function on PC?
How to use Alibaba Cloud to quickly access the live broadcast function on PC?
This paper introduces the methods of PC live broadcast and player quick access. For mobile streaming media playback, please refer to the official website document.

About the author: Ali Li Huaming, Alibaba Cloud video service product operation (I am a China woman who loves live broadcast and knows technology, please click on the name to follow me).

Every time I see my brothers struggling with the live broadcast function, Miss Sister is anxious. In fact, the seemingly complicated live broadcast function can be quickly integrated by opening the live broadcast service in Alibaba Cloud. The development brothers calm down and spend a few minutes reading this article of Xiaomei carefully. I believe you will know how to quickly access the PC-side live broadcast function in the Alibaba Cloud live broadcast console:

Live broadcast process

Step 1: Preparation before live broadcast

Log in to official website, Alibaba Cloud? , click on the upper left corner to log in.

Log in to the real-time video console

The console will check the open status of the services it depends on. Please follow the instructions on the page.

* * Add real-time domain name * *

It should be pointed out that:

Live domain names need to be put on record for review, and can only be used after approval. Unrecorded domain names should be filed first.

After the domain name is successfully configured, the CDN live broadcast acceleration function will be automatically configured for the domain name, and the live broadcast acceleration function can be used after CNAME in addon domain.

CNAME binding

Modify the DNS CNAME record of the real-time domain name that you added to the CNAME binding address displayed on the real-time domain name management detail page. We need to send the tweet address provided by Alibaba Cloud to live addon domain, so that when it is pushed to the live domain name, it will be pushed to our live broadcast center.

Please follow the steps below to bind the domain name CNAME.

On-site domain name application in Wang Wan

Get the CNAME corresponding to the live domain name of the live console.

Click on the domain name resolution page of Alibaba Cloud official website console, and select the domain name to bind.

Enter the Domain Name Resolution tab and click Advanced Settings.

Fill in the analysis parameters and save them.

The normal resolution will take effect soon. If the newly created domain name resolution has no DNS refresh problem, if CNAME is modified, there is cached data on different DNS, which may take 48 hours to complete the update.

There are other applications of live domain names.

For domain names applied by other means, please bind the domain name CNAME on the website where the domain name is located.

Perform domain name transfer-in process in Alibaba Cloud console.

Get push stream and play address

In domain name management, click Live to speed up domain name management:

Authentication configuration

The push and play of live streaming media adopt the same authentication scheme, which can be configured in the authentication configuration of the console to learn more about the authentication configuration.

pay attention to

Only after authentication configuration can the accelerated domain name be pushed and played normally, and the live broadcast service type only supports Class A authentication.

Push and broadcast addresses need to be calculated by authentication signatures respectively, and each signature is calculated strictly according to URL, so the signature calculated by push URL cannot be applied to broadcast addresses. Similarly, each broadcast address will correspond to a different authentication calculation result.

For example:

Set the authentication configuration in Live Console- Domain Name Management -Live Domain Name Management Details Page-Authentication Configuration, as shown below:

1, turn on authentication

2. Manually enter the authentication master key value, and access authentication details the authentication settings.

Step 2: Promote the flow

Get an authenticated push address:

Live console-domain name management-live domain name management details page-basic information collection tweet address is as follows:

rtmp://video-center . alive cdn . com/AppName/stream name? vhost=live.aliyun.com

Use the authentication URL calculator on the Live Console- domain name management -Live domain name management details page-authentication configuration page to calculate the authentication URL:

Enter the push address (AppName and StreamName can be modified by themselves), authentication key and effective time, and click the button to get the authentication URL.

Push flow operation

Push stream address:

rtmp://video-center . alive cdn . com/APPName/stream name? vhost=live.aliyun.com

explain

It is a live broadcast center server, allowing customization. For example, your domain name is (note: this domain name cannot be the same as your live accelerated domain name). You can set DNS and indicate your domain name CNAME.

APPName is the application name, which supports customization and can be changed.

StreamName is the name of the stream, which supports customization and can be changed.

The vhost parameter is the domain name that is finally played at the edge node, which is your live accelerated domain name.

The third-party streaming media software can be used for live streaming media operation, and the operation method of OBS streaming media software is introduced here.

Please go to OBS official website to download the latest software for Windows and Mac.

In OBS settings, the following settings should be made:

Push address settings for Mac version:

Windows version of the stream address settings:

The content in the stream key of the actual Mac version of obs and the playback path/serial code stream of the Windows version (if any) will not be displayed in plaintext.

Taking the above push address as an example, the parameter is set to:

FMS URL / URL: rtmp:///AppName

Playback path/stream (if any)/stream key: StreamName? vhost=

If authentication is turned on, authentication parameters will also be placed in the stream key of OBS Mac version and the playback path/serial stream of Windows version (if any).

Step 3: Play

What kind of agreement do you use to play?

Protocol | Advantages | Disadvantages | Delay

- | - | -

FLV | High concurrency, low latency | Non-standard practice, playing by SDK | 1s-3s.

RTMP | Small delay | Poor high concurrency support | 1s-3s

HLS(M3U8) | General Support for Mobile Browser | Large Delay | > = 10s, which is related to slicing time, and the maximum length is 3 TS.

Customers can use it flexibly according to the actual business scenarios, and need to play it on the mobile phone browser and mobile phone H5. It is recommended to play in HLS(M3U8) mode without integrating SDK. Non-mobile or SDK integration, low concurrency, less delay, RTMP can be used, FLV is recommended for high concurrency.

Direct preview of web page background

After using OBS and other tools to push the stream through the authenticated URL, you can query the live stream record on the Live Console-Stream Management-Push Stream page, and you can query the broadcast address through the live address to preview the broadcast.

Preview VLC

Download VLC, no additional settings are required after the default installation. File-> Open the network stream, fill in the broadcast address and click Open to start playing.