Live packaging converts live streams into the requested playback format in real time, eliminating the need to pre-package content into every format upfront.
With live packaging, you can:
-
Deliver live content in HLS, HLS CMAF, or DASH formats from a single ingest
-
Enable time-shifted viewing so viewers can replay live content
-
Archive live streams to Object Storage Service (OSS) for on-demand playback
How it works
MediaPackage organizes live packaging resources in three levels:
-
Channel group -- The top-level container for channels and endpoints. Each channel group is assigned an Origin Domain Name that serves as the base URL for all playback requests within the group.
-
Channel -- The entry point for a live stream. An upstream encoder pushes content to a channel's input URLs. Each channel provides two input URLs for redundant ingest. If one input stops sending content, MediaPackage automatically switches to the other, ensuring continuous delivery.
-
Endpoint -- The output configuration for a channel. Each endpoint defines the streaming format, packaging parameters, and access controls for the output stream. A single channel can have multiple endpoints, each producing a unique playback URL.
Content flows through these resources as follows:
-
An upstream encoder pushes a live stream to a channel's input URLs.
-
A downstream device (player or CDN) requests content from an endpoint's playback URL.
-
MediaPackage dynamically packages the stream into the format defined by that endpoint.
-
MediaPackage delivers the packaged stream to the requesting device.
Supported inputs and outputs
Supported input types
| Input type | Description |
|---|---|
| HLS | Traditional HLS with MPEG-2 Transport Stream (.ts) segments |
| HLS_CMAF | HLS with Common Media Application Format (CMAF) using fragmented MP4 (fMP4) segments |
Encrypted HLS streams are not supported for ingest.
Supported output types
| Output type | Description | Manifest extension |
|---|---|---|
| HLS | Standard HLS playlist with MPEG-2 TS (.ts) segments | .m3u8 |
| HLS_CMAF | HLS playlist referencing CMAF fMP4 segments | .m3u8 |
| DASH | MPEG-DASH manifest | .mpd |
Billing
-
Live packaging charges fees for stream ingest, packaging, and output delivery. For details, see Billing of live packaging.
-
Archiving live content to OSS through Live-to-VOD incurs OSS storage fees. See Storage fees of OSS.
Create a channel group
-
Log on to the Intelligent Media Services console.
-
In the upper-left corner, select a region.
-
In the left navigation pane, choose MediaPackage > Live Package.
-
Click Create Channel Group.
-
Enter a unique name and an optional description for the channel group.

-
Click OK.
The channel groups and channels in Live Package are separate from the Channel Assembly feature.
Create a channel
A channel receives a live stream from an upstream encoder. Each channel provides two input URLs for redundancy -- if one input stops sending content, MediaPackage automatically switches to the other.
-
On the Live Package page, click the channel group name.
-
Click Create Channel.
-
Configure the following settings:
Parameter Description Channel Name A unique name for the channel. Protocol The input protocol. Valid values: HLS, HLS_CMAF. Segment Duration The duration of each segment in seconds. Longer segments increase latency; shorter segments increase request overhead. Recommended value: 6 seconds. Segments The number of segments in the output manifest. A larger number extends the player timeline and increases traffic. Recommended value: 3. 
-
Click OK.
Create an endpoint
An endpoint defines the output format and access controls for a channel. Each endpoint generates a unique playback URL.
-
Click the channel name to open the channel details page.
-
Click the Endpoints tab, then click Create Endpoint.
-
Configure the basic information:
Parameter Description Endpoint Name A unique name for the endpoint. Protocol The output format. Valid values: HLS, HLS_CMAF, DASH. Manifest Name The manifest filename. Default: manifest. For example, setting this toindexwith the HLS protocol produces a playback URL ending inindex.m3u8.Authorization Code An authorization code that players or CDNs must include in the AuthorizationHTTP header when requesting content from this endpoint.IP Address Whitelist IPv4/IPv6 addresses or CIDR blocks allowed to access this endpoint. IP Address Blacklist IPv4/IPv6 addresses or CIDR blocks denied access to this endpoint. Time-shifted Days The number of days to retain live content for time-shifted viewing. Set to 0 to disable time shifting. This setting is a prerequisite for creating Live-to-VOD collection tasks. For details on time-shifted playback, see Time-shifted viewing. 
-
Configure the Segment Settings based on the protocol selected:
HLS

Parameter
Description
Segment Duration
The duration of each output segment in seconds. Valid values: 1 to 30.
Audio Separation
When enabled, audio tracks are packaged in separate segments from video.
HLS_CMAF & DASH

Parameter
Description
Segment Duration
The duration of each output segment in seconds. Valid values: 1 to 30.
DRM Encryption
Enables DRM encryption. Available for HLS_CMAF and DASH protocols only.
Encryption Method
The encryption method. Default:
SAMPLE_AES.Constant Initialization Vector
A 16-byte hex value (32-character string). If left blank, MediaPackage generates one automatically.
DRM System ID
The DRM systems to use. Select up to 3 for HLS_CMAF or up to 2 for DASH.
Supported systems:
-
HLS_CMAF: Apple FairPlay, Google Widevine, Microsoft PlayReady.
-
DASH: Google Widevine, Microsoft PlayReady.
DRM Provider URL
The URL of the proxy for key server communication. Maximum length: 512 characters.
Content ID
A unique identifier for the endpoint. If left blank, MediaPackage generates one automatically.
-
-
Configure the manifest settings:
HLS & HLS_CMAF

Parameter
Description
Segments
The number of segments in the output M3U8 playlist. Valid values: 2 to 100.
Program Date/Time Interval
The interval in seconds for inserting
EXT-X-PROGRAM-DATE-TIMEtags. By default, no tags are inserted.Stream Order
The order of streams in the manifest. Valid values:
-
Original: Sorts the output streams in the same order that the source uses.
-
Ascending by Bitrate: Sorts the output streams starting with the lowest bitrate.
-
Descending by Bitrate: Sorts the output streams starting with the highest bitrate.
Min Video Bitrate
Excludes streams with a bitrate lower than this value from the output manifest.
Max Video Bitrate
Excludes streams with a bitrate higher than this value from the output manifest.
DASH

Parameter
Description
Min Buffer Time
The minimum buffer time in seconds that a player must maintain. Default: 2x segment duration. Valid values: 1 to 30.
Min Update Period
The minimum interval in seconds before a player requests manifest updates. Default: 2x segment duration. Valid values: 1 to 3600.
Suggested Presentation Delay
The delay in seconds between the live edge and where playback begins. For example, a 35-second delay means requests at 5:30 PM receive content from 5:29:25 PM.
Manifest Window
The duration in seconds of content available for replay during live streaming. Valid values: 1 to 3600.
Stream Order
The order of streams in the manifest. Valid values:
-
Original: Sorts the output streams in the same order that the source uses.
-
Ascending by Bitrate: Sorts the output streams starting with the lowest bitrate.
-
Descending by Bitrate: Sorts the output streams starting with the highest bitrate.
Min Video Bitrate
Excludes streams with a bitrate lower than this value from the output manifest.
Max Video Bitrate
Excludes streams with a bitrate higher than this value from the output manifest.
-
-
Click OK.
After the endpoint is created, the playback URL appears in the URL column on the Endpoints tab.
Stream ingest
After you create a channel, two input URLs are generated for redundant ingest.
View input URLs
-
Go to the channel details page.
-
Click the Input tab. URL example:
Input Description ingest1 The primary input URL. ingest2 The backup input URL. MediaPackage automatically fails over to this URL if the primary input becomes unavailable. http://xxxxxx-1.packagepush-9eji12.ap-southeast-1.ice.aliyundoc.com/v1/dfjtest/1/test01/manifest -
Click Authentication in the Actions column to view the account name and password for Basic Auth.
Configure your encoder
-
Set your encoder's Output destination to the primary input URL. For a redundant setup, configure a secondary output to the backup input URL.
-
Enable Basic Auth with the provided credentials. The encoder must include the following HTTP header in all requests:
Authorization: Basic <BASE64_ENCODE(username:password)> -
Use HTTP PUT to upload M3U8 playlists and TS segments. Each file URL must share the same base path as the input URL:
PUT https://<input-url>/manifest.m3u8 PUT https://<input-url>/manifest-hd-1001.ts
Requirements:
-
Upload valid master playlists, media playlists, and TS segments.
-
Encrypted HLS streams are not supported.
-
For redundant ingest, the primary and backup stream must carry identical content with aligned timestamps. Misaligned streams can cause playback failures during failover.
You can also use MediaLive to ingest streams.
Stream playback
Use the playback URL from the endpoint to play the packaged stream.
For debugging:
-
Add your IP address to the endpoint's IP Address Whitelist, or
-
Include the endpoint's authorization code in the
Authorizationheader
For production:
Configure your CDN to include the Authorization header in origin requests. If you use Alibaba Cloud CDN, see Configure outgoing request headers.
Time-shifted viewing
When time shifting is enabled on an endpoint, MediaPackage retains live content for the specified number of days. Players can replay past content by appending time parameters to the playback URL.
Example:
https://xxxxx-1.packagepush-9eji12.ap-southeast-1.ice.aliyundoc.com/v1/group01/ch01/endpoint01/index.m3u8?start=2024-11-06T00:00:00Z&vodend=2024-11-06T02:00:00Z
This example replays live content from 2024-11-06T00:00:00Z to 2024-11-06T02:00:00Z. A time-shifted request is the endpoint's ordinary M3U8 manifest URL plus two query parameters: start sets the time-shift start time and vodend sets the time-shift end time.
Time parameters
| Parameter | Description |
|---|---|
start |
The start time in UTC. Example: 2024-11-06T00:00:00Z. |
end |
The end time in UTC for live mode. Example: 2024-11-06T00:00:00Z. Time-shifted playback stays in live mode until it reaches the specified end time. |
vodend |
The end time in UTC for VOD mode. All segments are returned at once with an ENDLIST tag, giving the player a complete timeline with full seek capabilities. |
offset |
Rewinds from the live edge by the specified offset. Unit: Sec. Example: ?offset=300 starts playback 5 minutes behind live. |
Usage notes
-
Specify either
startoroffset, not both. -
If both
endandvodendare specified,vodendtakes precedence.
Live-to-VOD
MediaPackage can archive segments of a live stream to OSS for on-demand playback by using collection tasks.
Prerequisites
Before you begin, make sure that you have:
-
An OSS bucket in the same region as the channel group. If you do not have one, see Activate OSS and Create a bucket
-
Time shifting enabled on the target endpoint (Time-shifted Days > 0)
Create a collection task
-
On the channel details page, click the Collection Task tab.
-
Click Create Collection Task.
-
Configure the following settings:
Parameter Description Endpoint Select an endpoint with time shifting enabled (Time-shifted Days > 0). Collection Time The time range of content to collect. Storage Path The OSS bucket where collected files are stored. 
-
Click OK.
The task starts automatically. View the collected files in the OSS console.
Multiple collection tasks for the same endpoint generate separate output files.
FAQ
How do I ingest live streams into MediaPackage?
Use an encoder that supports HLS output and push to the channel's input URLs with Basic Auth credentials. We recommend MediaLive.
How do I play a packaged stream?
Use the playback URL that was generated for the endpoint.
For debugging, add your IP address to the endpoint's IP Address Whitelist, or set the Authorization request header in your player to the authorization code configured on the endpoint.
To let external viewers play the stream, configure origin acceleration on your CDN. The CDN must send the Authorization request header carrying the endpoint's authorization code. Contact your CDN provider for the configuration steps.
My collection task completed but has no output files. What went wrong?
Time shifting must be enabled on the endpoint. Open the endpoint settings and set Time-shifted Days to a value greater than 0.
What is the difference between creating collection tasks from Live Package and the Live-to-VOD module?
Both produce the same result. Live Package manages collection tasks per channel, while Live-to-VOD provides a centralized view of all tasks across channels.