Creating a Recording Template

Function

This API is an out-of-date version and may not be maintained in the future. Live will provide you with new APIs. You can use the new recording function on the Live console. For details, see Recording Live Video to OBS.

This API is used to create a recording template.

URI

POST /v1/{project_id}/record/config

Request Parameters

Parameter

Type

Description

Mandatory

domain

String

Streaming domain name

Yes

app_name

String

Application name

Yes

record_duration

Integer

Recording length. The minimum value is 15 minutes, and the maximum value is 6 hours. The default value is 1 hour. The unit is second.

No

record_format

String

Recording format. The default value is flv.

No

record_location

String

Recording storage location. The default value is vod.

No

record_prefix

String

Prefix of a recording file. The default value is Record_{DomainName}_{AppName}_{StreamName}_{StartTime}_{EndTime}, in which, DomainName, AppName, and StreamName are mandatory.

No

create_time

String

Creation time

No

start_time

String

Start time

No

end_time

String

End time

No

stream_name

String

Stream name

No

push_domain

String

Ingest domain name

No

Example Request

POST /v1/{project_id}/record/config
 
{
  "domain": "push.hwcloud.cn",
  "app_name": "live",
  "record_duration": 900,
  "record_format": "flv",
  "record_location": "vod",
  "record_prefix": "{DomainName}/{AppName}/{StreamName}/{StartTime}-{EndTime}"
}

Response Parameters

  • If the request succeeds,
    only a status code 201 Created is returned.
  • If the request fails,
    Table 1 Response parameters

    Parameter

    Type

    Description

    error_code

    String

    Error code

    error_msg

    String

    Error description

Example Response

  • A status code 201 Created is returned if the request has been fulfilled.
  • The following is a failed response example:
    {
      "error_code": "LIVE.100011001",
      "error_msg": "Request Illegal"
    }
    

Status Code

See Status Codes.

Error Code

See Error Codes.