Updated on 2024-07-22 GMT+08:00

Video Settings

Function

This API is used to configure video settings. Before calling this API, ensure that the tenant has purchased a KooPhone cloud phone instance. This API is used to set the bit rate and output frame rate corresponding to each definition of an instance.

URI

PUT /v1/instances/video-setting

Request Parameters

Table 1 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Tenant-level token.

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

instance_ids

Yes

Array of strings

Instance list.

Maximum: 32

instance_settings

Yes

Array of InstanceSetting objects

Video setting content.

Table 3 InstanceSetting

Parameter

Mandatory

Type

Description

network_type

Yes

String

Network type. Value: MOBILE_NETWORK or WIFI.

encoding_type

Yes

String

Encoding type. Fixed value: H.264.

video_spec_groups

Yes

Array of VideoSpecGroup objects

Video specification group.

Table 4 VideoSpecGroup

Parameter

Mandatory

Type

Description

definition_540P

Yes

VideoSpec object

540p.

definition_720P

Yes

VideoSpec object

720p.

definition_1080P

Yes

VideoSpec object

1080p.

Table 5 VideoSpec

Parameter

Mandatory

Type

Description

code_rate

Yes

Integer

Bit rate, in kbit/s. The value ranges from 0 to 10000 and must be a multiple of 100.

fps

Yes

Integer

Frame rate, in fps. Value: 30 or 60.

Response Parameters

Status code: 200

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Response code. The error code specification is KOOPHONE.API.0001, and the number increases in ascending order. If error_code is 0, the operation is successful.

error_msg

String

Response description.

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Response code. The error code specification is KOOPHONE.API.0001, and the number increases in ascending order. If error_code is 0, the operation is successful.

error_msg

String

Response description.

Status code: 500

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Response code. The error code specification is KOOPHONE.API.0001, and the number increases in ascending order. If error_code is 0, the operation is successful.

error_msg

String

Response description.

Example Requests

/v1/instances/video-setting

{
  "instance_ids" : [ "a44uhlf7" ],
  "instance_settings" : [ {
    "network_type" : "WIFI",
    "encoding_type" : "H264",
    "video_spec_groups" : [ {
      "definition_540P" : {
        "code_rate" : 1000,
        "fps" : 30
      },
      "definition_720P" : {
        "code_rate" : 1000,
        "fps" : 60
      },
      "definition_1080P" : {
        "code_rate" : 1000,
        "fps" : 30
      }
    } ]
  } ]
}

Example Responses

Status code: 200

OK

{
  "error_code" : "0",
  "error_msg" : "ok"
}

Status Codes

Status Code

Description

200

OK

400

Bad Request

500

Internal Server Error

Error Codes

See Error Codes.