How to integrate Tencent Live Stream with Mlytics Stream?
Mlytics Stream ensures that your video streaming will have zero downtime and will scale during demand spikes. This is possible due to Mlytics Stream's mid-stream CDN switching and P2P video delivery.
If you are using Tencent StreamPackage and StreamLive, it is possible to improve the availability and scalability of your HLS live stream videos by integrating them with Mlytics Stream.
The diagram and instructions below will show you how you can do this.
Step 1: Obtain the m3u8 URL from Tencent StreamPackage
Log in to your Tencent StreamPackage account, then navigate to ‘ Channel Management’.
First, select a channel, by clicking the channel link.
Then you will be directed to another page. On this page and under the ‘ Endpoints’ tab, select your target endpoint, then from here, you can copy the m3u8 URL of your target HLS video by clicking the ' Copy' (paper) icon beside the URL. (e.g. http://1307357694.ap-bangkok.streampackage.srclivepull.myqcloud.com/v1/0184408487000b8ed5aa1602b0e5/018440854ca20b8ed5aa1602b0e8/main.m3u8).
You will need this m3u8 URL in Mlytics Stream.
Step 2: Create Live Stream in Mlytics Stream
To set up a live stream, navigate to ‘ Stream’ > ‘Live Streams’, and then click the ‘Create live stream’ button.
On this page, set the Stream detail info.
The Stream detail info includes:
- Stream source name: a unique name for the stream source (e.g. ss name)
- Protocol: specify the video format/container of the video stream. For now, only HLS is available.
- Origin server: the origin server is where your video streams are hosted. Use the domain name associated to your origin server (e.g. example.com). You may also set this origin as a ‘CDN candidate’ and by doing so, this server will be used together with other CDNs for mid-stream CDN switching.
Next, set the CDN configuration.
The system will recommend you to install 3 Basic CDNs by default, namely Cloudfront, StackPath, and GMA. You may also install additional CDNs depending on your business strategy.
You may also enable P2P video delivery and/or Domain allowlist.
Finally, click the ‘ Create live stream’ button.
Step 3: Paste the m3u8 URL to the Mlytics Stream SDK
After creating a live stream, Mlytics Stream will generate code snippets.
Go to the ‘ Install & Test’ tab and paste the copied m3u8 URL on the ‘Playlist URL’ field (from Tencent StreamPackage), and then click the ‘Insert’ button.
This process will insert the m3u8 URL of your target HLS video into the code snippets of the Stream SDK.
You may check the preview of your video on the ‘ Video Preview’ tab and by clicking the ‘Preview’ button.
The preview also shows how Multi CDN performs when delivering your selected video. It shows which CDNs were used to deliver video segments and their corresponding download speed (performance).
Step 4: Copy the SDK code snippets into your HTML
The final step is to copy these SDK code snippets into your video streaming application, in order to implement the Stream functionalities into your streaming application.
You can find the code snippets at the ‘ Code Snippet’ tab.
You can click the ‘ Copy’ button to copy all the code snippets into your streaming app code. You can also open the ‘See our docs’ link, to check more detailed instructions on how to input the code snippets for different players and JS frameworks.
- Make sure that your channel (in StreamLive) is running.
- Make sure that you input the RTPM server into your streaming device settings.
- Make sure that your streaming device is live.