Modify Channel Pull Stream Bitrate
Updated: 2025-09-16 18:07:44
API Description
1、修改频道拉流码率
2、接口支持https协议
API URL
https://api.polyv.net/live/v4/channel/set-pull-bitrate
Request Method
POST
API Constraints
- The API supports both HTTP and HTTPS. HTTPS is recommended to ensure security. API calls have frequency limits. See details
Request Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| appId | true | String | Account appId See details: Get Secret Key |
| timestamp | true | Long | Current 13-digit millisecond timestamp, valid within 3 minutes |
| sign | true | String | Signature, a 32-character uppercase MD5 value. The appSecret key used to generate the signature is critical for communication data security. It must never be stored or used directly on the client side. All APIs must be called through the customer's own server to relay requests to the POLYV server for response data. See details: Signature Generation Rules |
| channelId | true | String | Channel ID |
| pullBitRate | true | Integer | Channel pull stream bitrate limit. Refer to the "Channel Pull Stream Bitrate Limit pullBitRate Value Description" for details. |
Channel Pull Stream Bitrate Limit pullBitRate Value Description
| Value | Description |
|---|---|
| -1 | No limit, uses original bitrate for pull stream |
| 400 | Pull stream at 400 bitrate |
| 600 | Pull stream at 600 bitrate |
| 800 | Pull stream at 800 bitrate |
| 1000 | Pull stream at 1000 bitrate |
| 1500 | Pull stream at 1500 bitrate |
| 2000 | Pull stream at 2000 bitrate |
| 2500 | Pull stream at 2500 bitrate |
Example
http://api.polyv.net/live/v4/channel/set-pull-bitrate?appId=frlr1zazn3&sign=417802BACAD3375E72CA1A53848E0A53&channelId=2824409×tamp=1648779734640&pullBitRate=2000
Response Parameter Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Status code, same as HTTP status code, used to determine the basic response status |
| status | String | Response result, determined by the business. Returns "success" on success, "error" on failure |
| success | Boolean | Whether the response was successful |
| requestId | String | Request ID, a unique UUID generated for each request. Only used for troubleshooting and debugging, should not be tied to business logic |
| error | Object | Error information when status code is not 200 See details: Error Field Description |
| data | Object |
Java Request Example
For quick integration of basic code, download the relevant dependency source code. Click here to download the source code. After downloading, add it to your own source code project. The test cases include HttpUtil.java and LiveSignUtil.java, both contained in the downloaded file.
It is strongly recommended to use the Live Java SDK for API integration. The Live Java SDK provides unified encapsulation and optimization for API call logic, exception handling, data signing, and HTTP request thread pools.
private static final Logger log = LoggerFactory.getLogger(ChannelOperateTest.class);
/**
* 修改频道拉流码率
* @throws IOException
* @throws NoSuchAlgorithmException
*/
@Test
public void setPullBitRate() throws IOException, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String appId = super.appId;
String appSecret = super.appSecret;
String timestamp = String.valueOf(System.currentTimeMillis());
//业务参数
String url = "http://api.polyv.net/live/v4/channel/set-pull-bitrate";
String channelId = "2824409";
String pullBitRate = "400";
//http 调用逻辑
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
requestMap.put("channelId", channelId);
requestMap.put("pullBitRate", pullBitRate);
requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
String response = HttpUtil.post(url,requestMap);
log.info("测试修改频道拉流码率成功:{}", response);
//do somethings
}
Response Example
For global error descriptions, see Global Error Description
Success Example
{
"code": 200,
"status": "success",
"requestId": "0a57e87d-e2a8-4786-bf1e-1bcfbc96a3e5",
"data": null,
"success": true
}
Error Example
{
"code": 400,
"status": "error",
"requestId": "d52c3a0f-2743-4b29-bc4c-ad827aceac53",
"error": {
"code": 30000,
"desc": "not supports bit rate"
},
"data": null,
"success": false
}
