All Products
Search
Document Center

Intelligent Media Services:Live packaging

Last Updated:Feb 02, 2026

Live packaging packages live streams in real time, reformatting them in response to playback requests from downstream devices. With live packaging, you can:

  • Deliver live content in HLS, HLS CMAF, or DASH formats

  • Enable time-shifted viewing for viewers to replay live content

  • Store live content to Object Storage Service (OSS) for later playback

How it works

MediaPackage uses a three-level resource hierarchy to receive, package, and deliver live streams:

  • Channel group

    The top-level container that consists of channels and endpoints. When you create a channel group, an origin domain is automatically assigned, which serves as the base URL for all playback requests within the group.

  • Channel

    An entry point that receives live streams from an upstream encoder, each providing two input URLs for redundant ingest. If one input URL encounters issues, the system automatically switches to the other, ensuring continuous delivery.

  • Endpoint

    A part of a channel that defines what streaming format, packaging parameters, and features the output stream will use. You can create multiple endpoints per channel. Each endpoint generates a unique playback URL that players use to request content.

The following outlines the general flow of live content in MediaPackage:

  1. An upstream encoder pushes live streams to a channel's input URLs.

  2. A downstream device, such as a player or a CDN, requests content from a specific endpoint's playback URL.

  3. When MediaPackage receives the playback request, it dynamically packages the stream into the format defined by that specific endpoint.

  4. MediaPackage delivers the packaged stream to the requesting device.

Supported inputs and outputs

Supported input types

Input type

Description

HLS

Traditional HLS that uses MPEG-2 Transport Stream (.ts) segments.

HLS_CMAF

HLS that uses the Common Media Application Format (CMAF) with fragmented MP4 (fMP4) segments.

Note

Encrypted HLS streams are not supported.

Supported output types

Output type

Description

Manifest extension

HLS

Generates a standard HLS playlist with MPEG-2 Transport Stream (.ts) segments.

.m3u8

HLS_CMAF

Generates an HLS playlist that references CMAF fragmented MP4 (fMP4) segments.

.m3u8

DASH

Generates an MPEG-DASH manifest.

.mpd

Billing

  • Live packaging charges fees for stream ingest, packaging, and output delivery. For details, see Billing of live packaging.

  • For Live-to-VOD, storing live content to OSS incurs storage fees. For more information, see Storage fees of OSS.

Create a channel group

  1. Log on to the Intelligent Media Services console.

  2. In the upper-left corner, select a region.

  3. In the left navigation pane, choose MediaPackage > Live Package.

  4. Click Create Channel Group.

  5. Enter a unique name for the channel group and a description for identification.image

  6. Click OK.

Note

Channel groups and channels in Live Package are separate from the Channel Assembly feature of MediaWeaver.

Create a channel

A channel receives live streams from an upstream encoder. Each channel provides two input URLs for redundancy. If one input stops sending content, the system automatically switches to the other.

  1. On the Live Package page, click the channel group name.

  2. Click Create Channel.

  3. Configure the following settings:image

    Parameter

    Description

    Channel Name

    A unique name for the channel.

    Protocol

    The input stream 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: 6 seconds.

    Segments

    The number of segments in the output manifest. A larger number of segments extends the player timeline and increases traffic.

    Recommended: 3.

  4. Click OK.

Create an endpoint

An endpoint defines the output format and access controls. Each endpoint generates a playback URL.

  1. Click the channel name to open the channel details page.

  2. Click the Endpoints tab, then click Create Endpoint.

  3. Configure the Basic Information:截屏2026-02-02 14

    Parameter

    Description

    Endpoint Name

    A unique name for the endpoint.

    Protocol

    The output format. Valid values: HLS, HLS_CMAF, or DASH.

    Manifest Name

    The manifest filename. Default: manifest.

    For example, if you set this to index and select HLS as protocol, the playback URL ends with index.m3u8.

    Authorization Code

    If configured, the content requests from a player or a CDN to this endpoint must include this code in the Authorization HTTP header.

    IP Address Whitelist

    The IPv4/IPv6 addresses or CIDR blocks that are allowed to access this endpoint.

    IP Address Blacklist

    The IPv4/IPv6 addresses or CIDR blocks that are 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 feature is a prerequisite for creating Live-to-VOD assets from the stream.

    • To learn how to initiate a time-shifted viewing request, see Time-shifted viewing.

  4. Configure the Segment Settings based on the protocol selected:

    HLS

    截屏2026-02-02 15

    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

    截屏2026-02-02 15

    Parameter

    Description

    Segment Duration

    The duration of each output segment in seconds. Valid values: 1 to 30.

    DRM Encryption

    DRM encryption is available for HLS_CMAF and DASH protocols.

    Encryption Method

    Default: SAMPLE_AES.

    Constant Initialization Vector

    A 16-byte hex value (32-character string). If empty, MediaPackage auto-generates one.

    DRM System ID

    Select DRM systems, up to 3 for HLS_CMAF or 2 for DASH.

    Supported DRM systems:

    • HLS_CMAF: Apple FairPlay, Google Widevine, and Microsoft PlayReady.

    • DASH: Google Widevine and Microsoft PlayReady.

    DRM Provider URL

    The URL of the proxy for key server communication (up to 512 characters).

    Content ID

    The unique identifier for the endpoint. If empty, MediaPackage auto-generates one.

  5. Configure the manifest settings:

    HLS & HLS_CMAF

    截屏2026-02-02 15

    Parameter

    Description

    Segments

    The number of segments in the output M3U8 playlist. Valid values: 2 to 100.

    Program Date/Time Interval

    Interval in seconds to insert EXT-X-PROGRAM-DATE-TIME tags. 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 in the output manifest.

    Max Video Bitrate

    Excludes streams with a bitrate higher than this value in the output manifest.

    DASH

    截屏2026-02-02 15

    Parameter

    Description

    Min Buffer Time

    The minimum amount of time (in seconds) that a player must keep in the buffer. Default: 2x segment duration. Valid values: 1 to 30.

    Min Update Period

    The minimum amount of time (in seconds) that the player must wait before requesting manifest updates. Default: 2x segment duration. Valid values: 1 to 3600.

    Suggested Presentation Delay

    The delay, in seconds, between the point where content is live (the end of the manifest) and where playback begins. For example, with a 35-second presentation delay, requests at 5:30 receive content from 5:29:25.

    Manifest Window

    A window of content (in seconds) 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 in the output manifest.

    Max Video Bitrate

    Excludes streams with a bitrate higher than this value in the output manifest.

  6. Click OK.

After you create an endpoint, the playback URL appears in the URL column on the Endpoints tab.

截屏2026-02-02 16

Stream ingest

After creating a channel, two input URLs are generated for redundancy.

View input URLs

  1. Go to the channel details page.

  2. Click the Input tab.

    Input

    Description

    ingest1

    The primary input URL.

    ingest2

    The backup input URL. The service automatically failovers to this URL if the primary input becomes unavailable.

    URL example:

    http://xxxxxx-1.packagepush-9eji12.ap-southeast-1.ice.aliyundoc.com/v1/dfjtest/1/test01/manifest
  3. Click Authentication in the Actions column to view the username and password for Basic Auth.

Configure your encoder

  1. Set your encoder's output destination to the primary input URL. For a redundant setup, configure a secondary output to the backup input URL.

  2. Enable Basic Auth with the provided credentials. The encoder must add the following HTTP header to all requests:

    Authorization: Basic <BASE64_ENCODE(username:password)>
  3. Use HTTP PUT to upload M3U8 playlists and TS segments. The URL for each file 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, both streams must have identical content with aligned timestamps. Misaligned streams can cause playback failures during a failover.

We recommend using MediaLive as the upstream encoder.

Stream playback

Use the playback URL from the endpoint to play the packaged stream.

image

For debugging:

  • Add your IP address to the endpoint's IP whitelist, or

  • Configure the Authorization header with the endpoint's authorization code

For production:

Configure your CDN to include the Authorization header in origin requests. If you use Alibaba Cloud CDN, refer to Configure outgoing request headers.

Time-shifted viewing

When time shifting is enabled, MediaPackage archives the live content for the specified retention period. Players can access past content by adding time parameters to the standard 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

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-shift 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 in the manifest, giving the player a complete timeline with full seek capabilities.

offset

Rewind from the current live edge by the specified number of seconds. Example: ?offset=300 starts playback 5 minutes behind live.

Usage notes:

  • Specify either start or offset, not both.

  • If both end and vodend are specified, vodend takes precedence.

Live-to-VOD

MediaPackage supports creating collection tasks to store live content to OSS for later playback.

Prerequisites

Before you begin, you must have:

  • An OSS bucket in the same region where the channel group is created. If you do not have one, see Activate OSS and Create a bucket for instructions.

  • Time shifting enabled on the endpoint (Time-shifted Days > 0)

Create a collection task

  1. On the channel details page, click the Collection Task tab.

  2. Click Create Collection Task.

  3. Configure the following settings:image

    Parameter

    Description

    Endpoint

    Select an endpoint in the channel with time shifting enabled (Time-shifted Days > 0).

    Collection Time

    The time range of content to collect.

    Storage Path

    The OSS bucket for collected files.

  4. Click OK.

The task starts automatically. View collected files in the OSS console.

Note

Multiple collection tasks for the same endpoint generate separate files.

FAQ

How do I ingest live streams?

Use an encoder that supports HLS output. Configure it to push to the channel's input URLs using Basic Auth. We recommend MediaLive.

Why does my collection task have no files?

Ensure time shifting is enabled on the endpoint. Set Time-shifted Days to a value greater than 0.

What are the differences between creating a collection task from the Live Package and Live-to-VOD modules in the IMS console?

Both achieve the same result. Live Package manages collection tasks per channel. Live-to-VOD provides a centralized view of all tasks.