ApsaraVideo VOD records live streams as on-demand videos in real time. Once recorded, you can transcode to multiple formats, moderate content, generate smart thumbnails, edit clips with online editing, and accelerate delivery through Alibaba Cloud CDN.
This topic covers three practices for using Live to VOD.
| Resource | Link |
|---|---|
| Prerequisites | Activate ApsaraVideo VOD |
| Live-to-VOD configuration | Store recordings in ApsaraVideo VOD |
| API reference | GetPlayInfo, SubmitTranscodeJobs |
Key concepts
| Term | Description |
|---|---|
| Live to VOD | Records a live stream into ApsaraVideo VOD, where VOD features such as transcoding, online editing, AI processing, and event notifications are available for the recorded video. |
| Transcoding template group | Defines how ApsaraVideo VOD transcodes a recorded video after it is stored. |
| Merging and transcoding template group | Defines how ApsaraVideo VOD merges multiple recorded videos from a single live stream and transcodes the merged result. |
| Storage only | Stores recorded videos without post-processing. Specify the built-in No Transcoding template group in your Live-to-VOD configuration. |
| Merging only | Merges multiple recorded videos without transcoding. Specify the built-in No Transcoding template group in your Live-to-VOD configuration. |
| Recording cycle | The duration of each recording segment. For example, a 3-hour live stream with a 1-hour recording cycle generates three separate recordings. The first recording becomes available for on-demand playback one hour after the stream starts. |
Prerequisites
Before you begin, ensure that you have completed the following:
Activated ApsaraVideo VOD. See Activate ApsaraVideo VOD.
Activated ApsaraVideo Live. See Activate ApsaraVideo Live and purchase resource plans.
Added a Live-to-VOD configuration. See Store recordings in ApsaraVideo VOD.
Practice 1: Automatic transcoding + CDN acceleration
After a live stream is recorded, the recordings are transcoded and delivered through CDN immediately. Users can play the videos on demand as soon as transcoding completes.
When to use: Most live streaming scenarios where recordings require no manual editing before publication.
Flowchart:
How it works
Start stream ingest.
When a recording cycle completes, ApsaraVideo VOD automatically stores the recorded video.
ApsaraVideo VOD generates a unique video ID and sends you the
AddLiveRecordVideoCompletecallback with live streaming parameters such asDomainName,AppName, andStreamName. Store the video ID to track subsequent status updates.ApsaraVideo VOD reads the transcoding template group from your Live-to-VOD configuration and begins transcoding the recorded video.
Callbacks are sent when each processing step completes (snapshot taken, single video transcoded, or all videos transcoded). These callbacks arrive in no guaranteed order. The transcoding callback includes the CDN-accelerated playback URL. You can also call the
GetPlayInfooperation with the video ID to retrieve the playback URL.
Practice 2: Storage only + Manual transcoding
Store recorded videos in ApsaraVideo VOD without automatic transcoding. Trigger transcoding manually when you are ready, optionally after editing the recordings with the online editing feature.
The storage only mode uses the built-in No Transcoding template group, which is automatically created when you enable the VOD bucket (the OSS bucket allocated to ApsaraVideo VOD).
When to use: Scenarios where recordings need post-processing before publication, such as editing sports match footage or game highlight reels. After transcoding completes, ApsaraVideo VOD automatically provides CDN acceleration for the transcoded videos.
Flowchart:
How it works
Start stream ingest.
When a recording cycle completes, ApsaraVideo VOD automatically stores the recorded video.
ApsaraVideo VOD generates a unique video ID and sends you the
AddLiveRecordVideoCompletecallback with live streaming parameters such asDomainName,AppName, andStreamName. Store the video ID to track subsequent status updates.Call the
SubmitTranscodeJobsoperation to trigger transcoding. Before transcoding, you can perform other operations on the recorded video, such as online editing.Callbacks are sent when each processing step completes (snapshot taken, single video transcoded, or all videos transcoded). These callbacks arrive in no guaranteed order. The transcoding callback includes the CDN-accelerated playback URL. You can also call the
GetPlayInfooperation with the video ID to retrieve the playback URL.
Practice 3: Automatic merging across recording cycles
When a live stream spans multiple recording cycles, ApsaraVideo VOD can automatically merge the resulting videos into a single video. For example, with a 20-minute recording cycle and a 1-hour stream, three videos are generated and then merged.
You can configure automatic merging with either of the following template groups:
A merging and transcoding template group: merges and transcodes automatically (Option A)
The built-in No Transcoding template group: merges only, transcode manually later (Option B)
If the live stream is interrupted for longer than the specified timeout period, ApsaraVideo VOD automatically merges the recorded videos that were generated and processes the merged video based on the transcoding configuration. You can configure the interruption timeout period in ApsaraVideo Live.
Automatic merging is not supported for live streams interrupted for longer than 3 minutes.
Option A: Merging + Automatic transcoding
All recorded videos are merged and transcoded automatically after the live stream ends.
When to use: Sports broadcasts, online courses, and other scenarios where all recorded segments should be published as a single video.
Flowchart:
How it works
Start stream ingest.
When a recording cycle completes, ApsaraVideo VOD automatically stores the recorded video.
ApsaraVideo VOD generates a unique video ID and sends you the
AddLiveRecordVideoCompletecallback with live streaming parameters such asDomainName,AppName, andStreamName. Store the video ID to track subsequent status updates.The live stream is interrupted for longer than the specified timeout period, or you manually end the stream.
ApsaraVideo VOD receives an end-of-stream notification from ApsaraVideo Live.
ApsaraVideo VOD checks the merging configuration in your Live-to-VOD settings. If automatic merging is enabled, it uses the specified merging and transcoding template group to merge and transcode the recorded videos.
ApsaraVideo VOD generates a unique video ID for the merged video and sends you the
LiveRecordVideoComposeStartcallback with live streaming parameters such asDomainName,AppName, andStreamName. Store the video ID to track subsequent status updates.When merging completes, ApsaraVideo VOD sends the
FileUploadCompletecallback.Callbacks are sent when each processing step completes (snapshot taken, single video transcoded, or all videos transcoded). These callbacks arrive in no guaranteed order. The transcoding callback includes the CDN-accelerated playback URL. You can also call the
GetPlayInfooperation with the video ID to retrieve the playback URL.
Option B: Merging + Manual transcoding
All recorded videos are merged automatically, but transcoding is not triggered. You can process the merged video before triggering transcoding manually. For example, you can insert ads into the video or cut the content played during the halftime of a sports match.
When to use: Scenarios where the merged video requires editing before publication.
Flowchart:
How it works
Start stream ingest.
When a recording cycle completes, ApsaraVideo VOD automatically stores the recorded video.
ApsaraVideo VOD generates a unique video ID and sends you the
AddLiveRecordVideoCompletecallback with live streaming parameters such asDomainName,AppName, andStreamName. Store the video ID to track subsequent status updates.The live stream is interrupted for longer than the specified timeout period, or you manually end the stream.
ApsaraVideo VOD receives an end-of-stream notification from ApsaraVideo Live.
ApsaraVideo VOD checks the merging configuration in your Live-to-VOD settings. If automatic merging is enabled, it uses the specified merging only template group to merge the recorded videos.
ApsaraVideo VOD generates a unique video ID for the merged video and sends you the
LiveRecordVideoComposeStartcallback with live streaming parameters such asDomainName,AppName, andStreamName. Store the video ID to track subsequent status updates.When merging completes, ApsaraVideo VOD sends the
FileUploadCompletecallback. The merged video is now ready for further processing.Call the
SubmitTranscodeJobsoperation to trigger transcoding. Before transcoding, you can perform other operations on the merged video, such as online editing.Callbacks are sent when each processing step completes (snapshot taken, single video transcoded, or all videos transcoded). These callbacks arrive in no guaranteed order. The transcoding callback includes the CDN-accelerated playback URL. You can also call the
GetPlayInfooperation with the video ID to retrieve the playback URL.
Callbacks reference
The following callbacks are sent during the Live-to-VOD workflow. Use the video ID in each callback to correlate events and update your system.
| Callback | Trigger | Key parameters |
|---|---|---|
AddLiveRecordVideoComplete | A recorded video is stored in ApsaraVideo VOD | DomainName, AppName, StreamName, video ID |
LiveRecordVideoComposeStart | Merging of recorded videos begins | DomainName, AppName, StreamName, video ID |
FileUploadComplete | Merging completes and the merged file is ready | Video ID, merge status |
| Transcoding callback | A snapshot is taken or transcoding completes | Video ID, playback URL |
Callbacks arrive in no guaranteed order. Design your system to handle events asynchronously based on the video ID.
FAQ
How do I retrieve the playback URL for a transcoded video?
The transcoding callback includes the playback URL directly. You can also call the GetPlayInfo operation with the video ID. Both methods return a CDN-accelerated URL.
What is the VOD bucket?
The VOD bucket is the OSS bucket allocated to ApsaraVideo VOD. The built-in No Transcoding template group is automatically created when you enable this bucket.
Can I combine storage only with automatic merging?
Yes. Enable automatic merging in your Live-to-VOD settings and specify the built-in No Transcoding template group (merging only mode). ApsaraVideo VOD merges all recorded segments without transcoding, and you can process the merged video and trigger transcoding manually later.
What happens if a live stream is interrupted for more than 3 minutes?
Automatic merging is not supported for live streams that are interrupted for longer than 3 minutes. You can specify the interruption timeout period for live streams in ApsaraVideo Live.