All Products
Search
Document Center

ApsaraVideo VOD:Live to VOD

Last Updated:Mar 28, 2024

ApsaraVideo VOD provides the live-to-VOD feature for you to synchronously record live streams as on-demand videos. Then, you can perform AI operations such as transcoding, content moderation, and intelligent thumbnail generation on videos. You can also produce video content by using the online editing feature, and accelerate content distribution by using Alibaba Cloud CDN. This topic describes three use scenarios of the live-to-VOD feature.

Prerequisites

Terms

  • Live to VOD: You can apply the Live to VOD feature to various business scenarios by using it together with other features of ApsaraVideo VOD, such as transcoding, online editing, AI-based processing, and event notification.

  • Template group for recording and transcoding: After a live stream is recorded as an on-demand video, ApsaraVideo VOD uses this template group to transcode the recorded video.

  • Template group for merging and transcoding: After a live stream is recorded, ApsaraVideo VOD uses this template group to merge the recorded videos and transcode the merged video.

  • Template group for storage only: After a live stream is recorded, ApsaraVideo VOD performs no subsequent operation on the recorded videos.

  • Template group for merging only: After a live stream is recorded, ApsaraVideo VOD merges the recorded videos and performs no subsequent operation on the merged video.

  • Recording period of a live stream: the interval at which a live stream is recorded. For example, if a live stream lasts for 3 hours and you want to provide the recorded content for on-demand playback before the live stream ends, you can set the recording period to an hour. This way, an hour after the live stream starts, the content in the previous hour can be played on demand.

Method 1: Live to VOD + Automatic transcoding + CDN-based acceleration

After a live stream is recorded, the recorded video is transcoded and delivered to CDN nodes as soon as possible so that the video can be played on demand.

This method applies to most live streaming scenarios where you do not need to process recorded videos.

The following figure shows the process.

image.png

  1. You start stream ingest.

  2. When a recording period is reached, the recorded video is automatically delivered to ApsaraVideo VOD.

  3. After the video is delivered, a unique ID is generated for the video in ApsaraVideo VOD. The video information is sent to you by using the AddLiveRecordVideoComplete callback event that contains live streaming-related parameters such as DomainName, AppName, and StreamName. After you receive the callback event, you can record the video information and use the video ID as an index to update the subsequent video status.

  4. ApsaraVideo VOD detects the ID of the template group for recording and transcoding in the live-to-VOD configuration that you specify. ApsaraVideo VOD transcodes the recorded video based on configuration of the template group.

  5. After a snapshot is taken, a single video is transcoded, or all videos are transcoded, a callback event is sent to you. Callback events are sent without a time sequence. You can update the video status based on the video ID in the callback events. After the transcoding is complete, the video can be played. The transcoding callback message contains the playback URL. You can also obtain the playback URL by specifying the video ID when you call the GetPlayInfo operation. The playback URL is accelerated by CDN.

Method 2: Live to VOD + Storage only to ApsaraVideo VOD + Manual transcoding + CDN-based acceleration

You may want to store recorded videos to ApsaraVideo VOD without subsequent transcoding. In this case, you can specify the template group for storage only when you configure the Live to VOD feature. When you want to transcode the recorded videos, you can manually trigger transcoding as needed. This method can work with the online editing feature of ApsaraVideo VOD for better effects.

Note

To enable the template group for storage only, contact ApsaraVideo VOD technical support.

This method applies to scenarios where you want to process the recorded videos after a live stream ends, such as editing the recorded videos of sports matches and games. After the content processing is complete, you can initiate transcoding and CDN-based acceleration as needed. After the transcoding is complete, ApsaraVideo VOD automatically performs CDN-based acceleration for the transcoded videos.

The following figure shows the process.

image.png

  1. You start stream ingest.

  2. When a recording period is reached, the recorded video is automatically delivered to ApsaraVideo VOD.

  3. After the video is delivered, a unique ID is generated for the video in ApsaraVideo VOD. The video information is sent to you by using the AddLiveRecordVideoComplete callback event that contains live streaming-related parameters such as DomainName, AppName, and StreamName. After you receive the callback event, you can record the video information and use the video ID as an index to update the subsequent video status.

  4. You can manually trigger transcoding by calling the SubmitTranscodeJobs operation. Before you trigger transcoding, you can also perform other operations such as online editing on the recorded video.

  5. After a snapshot is taken, a single video is transcoded, or all videos are transcoded, a callback event is sent to you. Callback events are sent without a time sequence. You can update the video status based on the video ID in the callback events. After the transcoding is complete, the video can be played. The transcoding callback message contains the playback URL. You can also obtain the playback URL by specifying the video ID when you call the GetPlayInfo operation. The playback URL is accelerated by CDN.

Method 3: Live to VOD + Automatic merging of videos generated in different recording periods

You may want to merge videos generated in different recording periods and then process the merged video. For example, if the recording period is 20 minutes and a live stream lasts for an hour, three videos are generated. ApsaraVideo VOD can automatically merge the recorded videos. When you configure the Live to VOD feature, you can enable automatic merging and specify the template group for merging and transcoding. You can also specify the template group for merging only and manually trigger transcoding later. The differences between the two methods are similar to the differences between the previous two practices. If live streaming is interrupted for longer than the specified timeout period, ApsaraVideo VOD automatically merges the recorded videos that are generated for the live stream and processes the merged video based on the transcoding configuration. You can specify the streaming interruption timeout period for live streams in ApsaraVideo Live.

  • Merging + Automatic transcoding

    This applies to scenarios where you want all recorded videos to be automatically merged and then transcoded after a live stream ends, such as merging the recorded videos of sports matches and online teaching courses.

    The following figure shows the process.

    Practice 3

    1. You start stream ingest.

    2. When a recording period is reached, the recorded video is automatically delivered to ApsaraVideo VOD.

    3. After the video is delivered, a unique ID is generated for the video in ApsaraVideo VOD. The video information is sent to you by using the AddLiveRecordVideoComplete callback event that contains live streaming-related parameters such as DomainName, AppName, and StreamName. After you receive the callback event, you can record the video information and use the video ID as an index to update the subsequent video status.

    4. Live streaming is interrupted for longer than the specified timeout period, or you manually interrupt live streaming.

    5. ApsaraVideo VOD receives a message that indicates the end of live streaming from ApsaraVideo Live.

    6. ApsaraVideo VOD detects the merging configuration in the live-to-VOD configuration that you specify and determines whether to trigger automatic merging. If automatic merging is required, ApsaraVideo VOD uses the specified template group for merging and transcoding to merge the recorded videos and transcode the merged video.

    7. After video merging starts, a unique ID is generated for the merged video in ApsaraVideo VOD. The video information is sent to you by using the LiveRecordVideoComposeStart callback event that contains live streaming-related parameters such as DomainName, AppName, and StreamName. After you receive the callback event, you can record the video information and use the video ID as an index to update the subsequent video status.

    8. After video merging is complete, ApsaraVideo VOD notifies you of the merging status by using the FileUploadComplete callback event.

    9. After a snapshot is taken, a single video is transcoded, or all videos are transcoded, a callback event is sent to you. Callback events are sent without a time sequence. You can update the video status based on the video ID in the callback events. After the transcoding is complete, the video can be played. The transcoding callback message contains the playback URL. You can also obtain the playback URL by specifying the video ID when you call the GetPlayInfo operation. The playback URL is accelerated by CDN.

  • Merging + Manual transcoding

    When you configure the Live to VOD feature, you can enable automatic merging and specify the template group for merging and transcoding. In this practice, the template group for merging only is used. You can manually trigger transcoding later.

    This practice applies to scenarios where you want all recorded videos to be automatically merged but not to be transcoded after a live stream ends. You can process the merged video by using features such as online editing. Then, you can manually transcode the video. For example, you can cut the built-in ads in the video. You can also cut the content played during the rest duration in a sports match.

    The following figure shows the process.

    image.png

    1. You start stream ingest.

    2. When a recording period is reached, the recorded video is automatically delivered to ApsaraVideo VOD.

    3. After the video is delivered, a unique ID is generated for the video in ApsaraVideo VOD. The video information is sent to you by using the AddLiveRecordVideoComplete callback event that contains live streaming-related parameters such as DomainName, AppName, and StreamName. After you receive the callback event, you can record the video information and use the video ID as an index to update the subsequent video status.

    4. Live streaming is interrupted for longer than the specified timeout period, or you manually interrupt live streaming.

    5. ApsaraVideo VOD receives a message that indicates the end of live streaming from ApsaraVideo Live.

    6. ApsaraVideo VOD detects the merging configuration in the live-to-VOD configuration that you specify and determines whether to trigger automatic merging. If automatic merging is required, ApsaraVideo VOD uses the specified template group for merging and transcoding to merge the recorded videos and transcode the merged video.

    7. After video merging starts, a unique ID is generated for the merged video in ApsaraVideo VOD. The video information is sent to you by using the LiveRecordVideoComposeStart callback event that contains live streaming-related parameters such as DomainName, AppName, and StreamName. After you receive the callback event, you can record the video information and use the video ID as an index to update the subsequent video status.

    8. After video merging is complete, ApsaraVideo VOD notifies you of the merging status by using the FileUploadComplete callback event. In this case, the merged video is ready. You can perform subsequent operations on the video. For example, you can trigger transcoding for the video.

    9. You can manually trigger transcoding by calling the SubmitTranscodeJobs operation. Before you trigger transcoding, you can also perform other operations such as online editing on the recorded video.

    10. After a snapshot is taken, a single video is transcoded, or all videos are transcoded, a callback event is sent to you. Callback events are sent without a time sequence. You can update the video status based on the video ID in the callback events. After the transcoding is complete, the video can be played. The transcoding callback message contains the playback URL. You can also obtain the playback URL by specifying the video ID when you call the GetPlayInfo operation. The playback URL is accelerated by CDN.