Change RTMP stream configuration

1. API Description

This API is used to change the configuration of an RTMP stream server.

Request mode:

  • V2.6.0 and above: POST [ip]/mwapi/V2.0/stream/update-rtmp
  • V2.5.0 and below: POST [ip]/mwapi/update-rtmp
Administrator Rights Logged-in
No Yes

2. Input Parameters

Name Required Type Description
id Yes Int Streaming server ID, which can be obtained via Get streaming server list
type Yes Int Streaming type
1: RTMP
name Yes String Streaming server name
url Yes String Streaming address
streamKey Yes String Streaming key
authentication Yes Boolean Whether authentication is required
true: Yes; false: No
userName No String Username, effective only when authentication is required
password No String Password, effective only when authentication is required
autoSwitch Yes Boolean Whether it is configured for automatic streaming, and can start live streaming by pressing a button
true: Yes; false: No
encoder Yes EncoderData Encoding configuration parameters
EncoderData
Name Required Type Description
codeType Yes Int Encoding type
0: H.264
encodingMode Yes Int Bitrate mode
0: VBR; 1: CBR
videoBitrate Yes Int Video encoding bitrate, in Kbps
profile Yes Int Encoding profile
0: Baseline; 1: Main Profile; 2: High Profile
audioBitrate Yes Int Audio encoding parameters
48: 48Khz, aac, 48kbps
64: 48Khz, aac, 64kbps
96: 48Khz, aac, 96kbps
128: 48Khz, aac, 128kbps
192: 48Khz, aac, 192kbps
256: 48Khz, aac, 256kbps
keyframeInterval Yes Int Keyframe interval, in seconds
duration Yes Int Video frame rate
166666: 60 FPS; 333333: 30 FPS
resolution Yes Int Video resolution
1920x1080: 1080p; 1280x720: 720p

3. Output Parameters

Name Type Description
status Int Status code
message String Status description

4. Example

Changing the configuration of the streaming server with ID 1000.

Input Example
{
    "id":1000,
    "type":1,
    "name":"rtmp",
    "url":"10.10.7.10/live/",
    "streamKey":"yxy",
    "authentication":false,
    "userName":"userName",
    "password":"password",
    "autoSwitch":false,
    "encoder":{
        "codeType":0,
        "encodingMode":1,
        "videoBitrate":2048,
        "keyframeInterval":2,
        "duration":166666,
        "resolution":"1920x1080",
        "audioBitrate":128,
        "profile":0
    }
}
Output Example
{
    "message": "success",
    "status": 0
}

5. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Status Definition Description
7 MW_STATUS_INVALID_ARG Missing required parameters
16 MW_STATUS_NOT_EXIST The server does not exist
1001 MW_STATUS_SAME_NAME A configuration with the same name already exists
1002 MW_STATUS_AUTO_LIMIT The number of automatic streaming tasks exceeds the limit

results matching ""

    No results matching ""