All Products
Search
Document Center

Implement live-to-VOD

Last Updated: Jul 11, 2019

Scenarios

The live-to-VOD feature synchronously records live streams into on-demand videos and supports various operations. The operations include media asset management, media processing (transcoding and AI processing such as content moderation and intelligent thumbnail), content production (online editing), and CDN acceleration. You can configure live-to-VOD as an automatic workflow or flexibly start live-to-VOD processing by using the API or SDK.

Preparations

After the preceding preparations, you can start to use the live-to-VOD feature.

Note: To activate the Template Group for Video Store without Transcoding and Template Group for Video Production without Transcoding, contact ApsaraVideo for VOD technical support.

Terms

When used with the features of ApsaraVideo for VOD, such as transcoding, online editing, AI processing, and event notification, the live-to-VOD feature is applicable to various business scenarios.

Terms:

  • Recording and transcoding template group: While a live stream is recorded to a VOD, ApsaraVideo for VOD uses this template group to transcode the video.
  • Production and transcoding template group: ApsaraVideo for VOD uses this template group to perform video production based on multiple recorded videos and transcode the produced video.
  • Template Group for Video Store without Transcoding: After a live stream is recorded, no subsequent operation is performed.
  • Template Group for Video Production without Transcoding: After ApsaraVideo for VOD performs video production based on live streams, no subsequent operation is performed.
  • Live stream recording period: the interval at which live streams are recorded to ApsaraVideo for VOD. If live streaming lasts for three hours and you want to provide a VOD of the recorded content during the live streaming, you can set the recording period to 1 hour. That is, an hour after the live streaming, content in the previous hour can be played on demand.

Practice 1: live stream recording + automatic transcoding + CDN acceleration

After a live stream is recorded, the recorded file is rapidly transcoded and CDN accelerated for users to play on demand. This practice applies to most live streaming scenarios without further processing of the content.

The procedure is as follows:

undefined

  1. A user starts stream ingest.
  2. When the stream ingest reaches a recording period, the recorded file is automatically added to ApsaraVideo for VOD.
  3. After the VOD is recorded, a unique video ID is generated in ApsaraVideo for VOD. The video information is sent to the user through the AddLiveRecordVideoComplete callback event containing live streaming-related parameters DomainName, AppName, and StreamName. After receiving the callback event, the user records the video information and uses VideoId as an index to update the video status later.
  4. ApsaraVideo for VOD detects the ID of the recording and transcoding template group (the transcoding template group contains the specific code stream transcoding task) in the user's live-to-VOD configuration for transcoding.
  5. When a snapshot is finished, a single code stream is transcoded, and all code streams are transcoded, callback events are respectively sent to the user without a time sequence. The user updates the video status based on VideoId in the callback events. After the transcoding, the stream can be played. The transcoding callback message contains the stream playback URL. Alternatively, the stream playback URL can be obtained based on VideoId through the GetPlayInfo operation. The stream playback URL is CDN accelerated.

Practice 2: live stream recording + storage only to ApsaraVideo for VOD + manual transcoding triggering + CDN acceleration

Some users want to only store recorded live stream videos to ApsaraVideo for VOD without transcoding. In this case, users can select the Template Group for Video Store without Transcoding as the recording and transcoding template group when setting the live-to-VOD configuration. To activate the Template Group for Video Store without Transcoding, contact ApsaraVideo for VOD technical support. Users can manually trigger video transcoding as needed. In addition, this practice can work with the online editing feature of ApsaraVideo for VOD for better effect.

Scenarios: After the live streaming, a user needs to perform further content processing, such as live stream editing for sports matches and games. Then the user initiates transcoding and CDN acceleration processes. After transcoding, ApsaraVideo for VOD automatically performs CDN acceleration for the output files.

The procedure is as follows:

undefined

  1. A user starts stream ingest.
  2. When the stream ingest reaches a recording period, the recorded file is automatically added to ApsaraVideo for VOD.
  3. After the VOD is recorded, a unique video ID is generated in ApsaraVideo for VOD. The video information is sent to the user through the AddLiveRecordVideoComplete callback event containing live streaming-related parameters DomainName, AppName, and StreamName. After receiving the callback event, the user records the video information and uses VideoId as an index to update the video status later.
  4. ApsaraVideo for VOD detects the ID of the recording and transcoding template group, which is the Template Group for Video Store without Transcoding, in the user's live-to-VOD configuration and does not perform further transcoding.
  5. The user manually triggers transcoding by calling the transcoding task operation for the video. Before that, operations like online editing can be performed.
  6. When a snapshot is finished, a single code stream is transcoded, and all code streams are transcoded, callback events are respectively sent to the user without a time sequence. The user updates the video status based on VideoId in the callback events. After the transcoding, the stream can be played. The transcoding callback message contains the stream playback URL. Alternatively, the stream playback URL can be obtained based on VideoId through the GetPlayInfo operation. The stream playback URL is CDN accelerated.

Practice 3: live stream recording + automatic merging of multiple periodic videos

Some users want to perform video production based on multiple files generated in the recording period and then process the produced video. If the recording period is 20 minutes and live streaming lasts for an hour, three videos are generated. ApsaraVideo for VOD provides the automatic production feature. When configuring live stream recording, a user can enable automatic video production and configure the production and transcoding template group for video production. The user can also configure the Template Group for Video Production without Transcoding and manually trigger transcoding later. The difference between the two methods is the same as that described in the previous two practices. ApsaraVideo for VOD automatically performs video production based on live streams and operates subsequently based on the transcoding configuration when the streaming is interrupted for longer than the specified duration. The streaming interruption time-out period can be specified for the live streaming.

Production + automatic transcoding

Scenarios: After live streaming, a user requires that the whole process of automatically merging segments in all recording periods and starting transcoding be triggered. Scenarios include sports games or the composition of online teaching courses.

The procedure is as follows:

undefined

  1. A user starts stream ingest.
  2. When the stream ingest reaches a recording period, the recorded file is automatically added to ApsaraVideo for VOD.
  3. After the VOD is recorded, a unique video ID is generated in ApsaraVideo for VOD. The video information is sent to the user through the AddLiveRecordVideoComplete callback event containing live streaming-related parameters DomainName, AppName, and StreamName. After receiving the callback event, the user records the video information and uses VideoId as an index to update the video status later.
  4. The streaming interruption duration reaches the timeout duration, or the user proactively interrupts the streaming.
  5. ApsaraVideo for VOD receives a live streaming end message from ApsaraVideo Live.
  6. ApsaraVideo for VOD detects the production configuration in the user's live-to-VOD configuration and determines whether it is necessary to trigger automatic production. If it is necessary, production and transcoding are performed based on the production and transcoding template group in the live-to-VOD configuration.
  7. The video production starts, and a unique video ID is generated in ApsaraVideo for VOD for the produced video. The video information is sent to the user through the LiveRecordVideoComposeStart callback event containing live streaming-related parameters DomainName, AppName, and StreamName. After receiving the callback event, the user records the video information and uses VideoId as an index to update the video status later.
  8. After video production is completed based on the mezzanine files, ApsaraVideo for VOD sends the FileUploadComplete callback event to notify the user of the status.
  9. When a snapshot is finished, a single code stream is transcoded, and all code streams are transcoded, callback events are respectively sent to the user without a time sequence. The user updates the video status based on VideoId in the callback events. After the transcoding, the stream can be played. The transcoding callback message contains the stream playback URL. Alternatively, the stream playback URL can be obtained based on VideoId through the GetPlayInfo operation. The stream playback URL is CDN accelerated.

Production + manual transcoding

When configuring live stream recording, a user can enable automatic video production and configure the production and transcoding template group for video production. The user can also configure the Template Group for Video Production without Transcoding and manually trigger transcoding later.

Scenarios: After live streaming, a user requires that segments in all recording periods be automatically merged without any other processing. The user performs further processing, such as online editing, and then manually transcodes the video, for example, cutting built-in ads in videos or the content played during the rest duration in a sports game.

The procedure is as follows:

undefined

  1. A user starts stream ingest.
  2. When the stream ingest reaches a recording period, the recorded file is automatically added to ApsaraVideo for VOD.
  3. After the VOD is recorded, a unique video ID is generated in ApsaraVideo for VOD. The video information is sent to the user through the AddLiveRecordVideoComplete callback event containing live streaming-related parameters DomainName, AppName, and StreamName. After receiving the callback event, the user records the video information and uses VideoId as an index to update the video status later.
  4. The streaming interruption duration reaches the timeout duration, or the user proactively interrupts the streaming.
  5. ApsaraVideo for VOD receives a live streaming end message from ApsaraVideo Live.
  6. ApsaraVideo for VOD detects the production configuration in the user's live-to-VOD configuration and determines whether it is necessary to trigger automatic production. If it is necessary, production and transcoding are performed based on the production and transcoding template group in the live-to-VOD configuration. As the Template Group for Video Production without Transcoding is configured in this scenario, ApsaraVideo for VOD does not automatically trigger transcoding.
  7. The video production starts, and a unique video ID is generated in ApsaraVideo for VOD for the produced video. The video information is sent to the user through the LiveRecordVideoComposeStart callback event containing live streaming-related parameters DomainName, AppName, and StreamName. After receiving the callback event, the user records the video information and uses VideoId as an index to update the video status later.
  8. After video production is completed based on the mezzanine files, ApsaraVideo for VOD sends the FileUploadComplete callback event to notify the user of the status. In this case, the mezzanine files involved in this production task are ready. The user can perform subsequent operations, such as triggering transcoding, on the video.
  9. The user manually triggers transcoding by calling the transcoding task operation for the video. Before that, operations like online editing can be performed.
  10. When a snapshot is finished, a single code stream is transcoded, and all code streams are transcoded, callback events are respectively sent to the user without a time sequence. The user updates the video status based on VideoId in the callback events. After the transcoding, the stream can be played. The transcoding callback message contains the stream playback URL. Alternatively, the stream playback URL can be obtained based on VideoId through the GetPlayInfo operation. The stream playback URL is CDN accelerated.