How cloud storage services enable video storage

Source: Internet
Author: User
Tags sub account

In order to facilitate live/monitor users to use cloud storage products to store audio and video data, Alibaba Cloud Storage (OSS) products recently launched rtmp streaming function. The user can upload the audio and video data to the cloud storage OSS directly using the RTMP protocol.

Cloud Storage Livechannel Introduction

Livechannel is the new concept of cloud storage in order to manage the rtmp push stream, and the Livechannel is the live channel, which is used to save the push flow configuration, get the push flow status, etc. the live channel is a bucket and a user can create an unlimited number of live channels in buckets.

The user creates a livechannel that can obtain a corresponding rtmp push-stream address, which can then be pushed to the cloud storage OSS via the RTMP protocol by the user and dumped into the TS, m3u8 files of the HLS protocol. (that's great, haha) dump files can be used to do on-demand, in the case of low latency, you can also directly use the HLS protocol for live streaming, but also support the simultaneous real-time capture of the stream.

With Livechannel, users can store content to the cloud storage OSS at the same time, without any local temporary storage, while enjoying the high reliability, low cost and unlimited expansion of cloud storage OSS, and can take advantage of the powerful and growing data processing capability of cloud storage OSS (screenshots, transcoding , yellow and so on) for various post-processing, but also very convenient to use the cloud storage OSS lifecycle and other functions to do data lifecycle management.

Usage Scenario Description

One, rtmp live transcription for HLS


Step description

1. The app starts streaming and pushes Rtmp stream to CDN;

2. The app or CDN sends a "start live" message to the MNS Topic, which contains the CDN pull-streaming address for this live broadcast;

3. MNS push the message to the user to set up the RTMP proxy on cloud server ECS;

4. RTMP Proxy uses ffmpeg from CDN Lahue;

5. RTMP Proxy creates livechannel in the cloud storage OSS and pushes the stream to the cloud storage OSS;

6. After the push is over, RTMP proxy sends a "push-stream End" message to another MSN Topic;

7. MNS pushes the "push end" message to the client's application server for subsequent processing (such as saving on-demand addresses to the database);

8. The app receives an on-demand address from the application server and accesses the cloud storage OSS for on-demand video.

Note

1. Users can use the Oss/mns SDK, ffmpeg, librtmp, etc. to implement their own rtmp Proxy, subsequent cloud storage OSS will provide sample programs;

2. The components involved in the entire process can be built using the services provided by Alibaba Cloud.

Second, real-time discrimination yellow


Step description

1. Use rtmp proxy to push the data to OSS and set Livechannel to open the screenshot when live.

2. OSS by user-specified interval screenshot, and save to the OSS;

3. The OSS calls the third party yellow service to rate the picture;

4. The OSS pushes the result of the score to the MNS Topic;

5. MNS callback user's application server notifies the yellow result;

6. Another way of processing: Users can also choose to let the OSS directly push screenshots of the image link, the application server will be the image address aggregation after the use of other means of identification;

Note

1. Third party services will be deployed in the container service provided by Alibaba Cloud, the delay of the call is fully guaranteed;

2. While the cloud storage OSS will still store the rtmp stream as HLS file;

Third, permission control (private bucket support HLS play)

Cloud storage OSS provides a rich authentication/authorization mechanism that gives users granular control over the access rights of the data, and for HLS live/on-demand scenarios, we also provide a "dynamic signature m3u8" mechanism that allows users to use private buckets to provide HLS playback services.

The user only needs to access m3u8 using the URL signature method, and the parameter "X-oss-process=hls/type" is added, and OSS will sign all the TS addresses in the returned playlist in the same way as m3u8 (same accessid, AccessKey, Expiretime).

Suppose the contents of a m3u8 file are as follows:

#EXTM3U

#EXT-x-version:3

#EXT-x-media-sequence:54

#EXT-x-targetduration:6

#EXTINF: 6.006,

1470971233380.ts

#EXTINF: 6.006,

1470971233398.ts

#EXTINF: 1.944,

1470971233415.ts

The content returned after the dynamic signature is as follows:

#EXTM3U

#EXT-x-version:3

#EXT-x-media-sequence:54

#EXT-x-targetduration:6

#EXTINF: 6.006,

1470971233380.ts? Expires=1470973160&ossaccesskeyid=yjjhkokwdwinlkxv&signature=6ajidj9vcrqnv%2bwszh9meroehpm%3d

#EXTINF: 6.006,

1470971233398.ts? Expires=1470973160&ossaccesskeyid=yjjhkokwdwinlkxv&signature=ek3i5uk3r8flnzllwcmzsjxo7wk%3d

#EXTINF: 1.944,

1470971233415.ts? Expires=1470973160&ossaccesskeyid=yjjhkokwdwinlkxv&signature=jmjduccgu63bgtiiheei0usyy18%3d

Note

1. "Dynamic signature" does not change the M3 stored in the cloud storage OSS

2. Contents of the U8 file;

3. Support Sub account, STS, when using STS access, token must be provided via URL parameter;

4. The x-oss-process parameter needs to participate in the signature.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.