Last updated: 2019-09-26 18:32:54PDF
Thank you for choosing Tencent Cloud. This tutorial will guide you through the LVB service.
- Stream: A stream in LVB refers to a group of audiovisual data that is continuously sent, such as audiovisual data collected by the camera and continuously sent to the other party in a WeChat video call. A push is to send such data to a specified address which usually points to a group of CVM instances.
- Signature and authentication: In LVB, a signature is used to encrypt the content sent using your own private key to ensure that others cannot forge the content. The authentication refers to the process where Tencent Cloud decrypts your signed content, verifies the legitimacy of the content, and denies requests that cannot be decrypted or contain invalid content, so as to ensure only legitimate clients can obtain the corresponding services.
- StreamName: ID of a stream, which is usually used to uniquely identify the stream together with a domain name.
The nature of LVB is a broadcast process, similar to the live broadcast of TV channels sent to audience through cable networks. In order to complete this process, LVB needs to have a capture and push device (similar to a camera), a cloud live broadcast service (similar to a cable network), and a playback device (similar to a TV set). These devices can be smart devices such as mobile phones, PCs, and tablets as well as web browsers. We provide complete software demos for different types of devices. For detailed push methods, see Best Practices - LVB Push.
Below is a walkthrough of the LVB service, which can be used in the following steps:
- Activate the LVB service
- Add a domain name
- Add a CNAME record for the domain name
- Get a push address
- Get a playback address and start playback
1. Activate the LVB service
Click Get Started on the LVB product page, tick the checkbox to agree to the "Tencent Cloud Service Agreement" and "LVB Billing Instructions", and click Apply to activate the LVB service as shown below:
2. Add a domain name
- To use LVB, you should have at least two domain names, one as the push domain name, and the other as the playback domain name. Push and playback cannot use the same domain name.
- If you do not have a domain name, you can register and purchase one through Tencent Cloud Cloud Products > Domain Name and Website > Domain Name Registration. You can also purchase one at another domain name service provider.
- If you have already purchased domain names, you should apply for ICP filing for them according to the regulations of the Ministry of Industry and Information Technology. You can do so through Tencent Cloud's [ICP Filing Registration] service or through another domain name service provider. Generally, the application takes several business days, so we recommend applying in advance.
- If your domain names have already obtained ICP filing, you need to add a push domain name and a playback domain name through Domain Management > Add Domain in the LVB Console.
Suppose that your push domain name is push.livetest.myqcloud.com and playback domain name is play.livetest.myqcloud.com.
Add a push domain name:
Add a playback domain name:
If your domain names have already obtained ICP filing, they can be viewed in the domain name list once successfully added.
The push domain name number.livepush.myqcloud.com in the domain name list is a test domain name provided by us. You can use it for push testing, but we strongly recommend against using it as the push domain name for your real business.
3. Add a CNAME record for the domain name
After a domain name is successfully added, it needs to point to the cloud service cluster of LVB. You need to resolve the CNAME record of the domain name at your domain name registrar to the CNAME address of the corresponding domain name in the domain name list in the LVB Console as prompted. For more information on how to add a CNAME record, see CNAME Configuration.
After a CNAME record is successfully added, it generally takes some time to take effect. If the CNAME configuration fails, you cannot use LVB.
If the CNAME configuration failure persists, consult your domain name registrar.
4. Get the push address
Go to Domain Management, click the domain name push.livetest.myqcloud.com or Manage after the domain name to enter Push Configuration. Enter your stream name in StreamName (e.g., liveteststream), click Generate Push URL, and you will get a push address as shown below:
In the address structure, txSecret is the signature of the push and txTime is the expiration time of the push address (equal to the time in Time Setting). If you have enabled playback authentication, the actual expiration time is txTime + authentication expiration time. For more information, see Configuration Sample.
Paste the push address to the push address field in your push software.
If OBS push is used on a PC, the push FMS URL is:
The playback path/LVB code is:
6. Get a playback address and start playback
Once the push is successful, you can view the push status in the list in Stream Management > Online Stream or the room list in Channel Access.
After a playback domain name with the correct CNAME record is successfully added, you can play back the stream in Operation > Test or share the playback link in apps such as WeChat, QQ, and Weibo by clicking Share URL.
LVB does not require the playback domain name and push domain name to be in one-to-one correspondence. To obtain a playback address corresponding to the play domain name, go to Domain Management, click the corresponding domain name or Manage in the Action column, and click Playback Configuration. You can see the playback addresses in RTMP, FLV, and HLS formats. Replace the *StreanName in italics with the StreamName of the stream you want to play back.
- The RTMP protocol has higher real-time performance and thus is often used for video streams requiring low latency; however, it has a high risk of lagging.
- The HLS protocol has a relatively higher latency but offers a better watching experience. Plus, it is natively supported by Apple's Safari browser.
- The FLV protocol is a relatively balanced option with an even latency and lag performance. It is widely used by users in Mainland China.
After the playback address is obtained, enter it into the address bar of the player and the stream can be watched.