This topic describes how to push streams through RTMP by using a URL.

The URL format is as follows: rtmp://${bucket}.${host}/live/${channel}?${params}

In the preceding URL format:

  • live is the name of the application by which OSS uses the RTMP protocol.
  • param is the parameter for pushing a stream, and is in the same format as the query string in the HTTP request (that is, "varA=valueA&varB=valueB").
  • If the ACL rule for the target bucket is not public-read-write, the URL for pushing the stream must be signed. The signing method is similar to URLs of objects that are signed, which is described in the following section.

RTMP stream URL parameters

Parameter Description
playlistName Specifies the name of the generated m3u8 file. The value of this parameter overwrites the valued specified in the LiveChannel settings. Note that the generated m3u8 file is still prefixed with "${channel_name}/".

Signing method of an RTMP stream URL

A signed URL for pushing a stream is in the following format:rtmp://${bucket}.${host}/live/${channel}?OSSAccessKeyId=xxx&Expires=yyy&Signature=zzz&${params}

Parameter Description
OSSAccessKeyId Assumes the same role as the AccessKeyId in the signed HTTP request.
Expires Indicates the expiration time of the URL, in Unix timestamp format.
Signature Indicates the signature string. The calculation method for the string is described in the following section.
params Indicates other parameters. All parameters included in the URL must be signed.

The value of Signature is calculated as follows:

base64(hmac-sha1(AccessKeySecret,
    + Expires + "\n"
    + CanonicalizedParams
    + CanonicalizedResource))
Parameter Description
CanonicalizedResource The format of this parameter is as follows: /BucketName/ChannelName
CanonicalizedParams Indicates a string spliced by all param keys (in the "key:value\n" format) in alphabetical order. If the number of parameters is 0, the value of this parameter is null. SecurityToken, OSSAccessKeyId, Expire, and Signature are not included. Each param key is used in the string only once.