Set recording parameters
1. API Description
This API is used to set recording parameters.
Request mode:
- V2.6.0 and above: POST [ip]/mwapi/V2.0/output/set-record-encoder-format
- V2.5.0 and below: POST [ip]/mwapi/set-record-encoder-format
Administrator Rights | Logged-in |
---|---|
No | Yes |
2. Input Parameters
Name | Required | Type | Description |
---|---|---|---|
duration | Yes | Int | Frame interval |
video-bitrate | Yes | Int | Video encoding bitrate, in KB |
resolution | Yes | String | Resolution, width x height |
codeType | Yes | Int | Encoding method 0: H.264; 1: H.265 |
profile | Yes | Int | Encoding profile 0: Baseline; 1: Main Profile; 2: High Profile |
encodingMode | Yes | Int | Bitrate mode 0: VBR; 1: CBR |
keyframeInterval | Yes | Int | Keyframe interval, in seconds |
audioBitrate | Yes | Int | Audio encoding bitrate, in KB |
splitMode | Yes | Int | File splitting method 0: By size; 1: By time |
splitBlock | Yes | Int | Splitting interval By size: MB By time: minutes |
fileNamePrefix | Yes | String | Filename prefix |
savePath | Yes | String | Save path |
fileExtention | Yes | Int | File extension 0: MP4; 1: MOV |
recordSourceId | Yes | Int | Recording source 0: Program; 1: HDMI 1; 2: HDMI 2; 3: Web Camera |
recordWithAudio | Yes | Int | Whether to record audio 0: No; 1: Yes |
scheduleMode | Yes | Int | Recording schedule mode 0: None; 1: One day; 2: Daily; 3: Weekly |
scheduleStartDate | Yes | Int | Start timestamp of schedule, in ms |
scheduleEndDate | Yes | Int | End timestamp of schedule, in ms |
weeklyDate | Yes | Int | Weekly repeat time, binary flag 0: Disabled Sunday: 1st bit (0x1LL << 1) Monday: 2nd bit (0x1LL << 2) Tuesday: 3rd bit (0x1LL << 3) Wednesday: 4th bit (0x1LL << 4) Thursday: 5th bit (0x1LL << 5) Friday: 6th bit (0x1LL << 6) Saturday: 7th bit (0x1LL << 7) |
scheduleRecordTime | Yes | ScheduleRecordTime | Configuration of recording schedule |
scheduleRecordCache | Yes | Array | Setting history of recording schedule |
ScheduleRecordTime
Name | Required | Type | Description |
---|---|---|---|
startTime | Yes | Int | Start time of schedule (only the value of hours, minutes and seconds), in ms |
duration | Yes | Int | Duration of the schedule, in ms |
3. Output Parameters
Name | Type | Description |
---|---|---|
status | Int | Status code |
message | String | Status description |
4. Example
Setting recording parameters.
Input Example
{
"recordSourceId": 2,
"recordWithAudio": 1,
"resolution": "1920x1080",
"duration": 166666,
"video-bitrate": 8192,
"codeType": 0,
"keyframeInterval": 2,
"profile": 0,
"encodingMode": 1,
"audioBitrate": 128,
"fileNamePrefix": "UF_",
"fileExtention": 0,
"savePath": "/data/resource/album",
"splitMode": 1,
"splitBlock": 60,
"scheduleMode": 1,
"scheduleStartDate": 1716480000000,
"scheduleEndDate": 1716480000000,
"scheduleRecordTime": [
{
"startTime": 1716522176000,
"duration": 102000
}
],
"scheduleRecordCache": [
{
"scheduleMode": 1,
"scheduleStartDate": 1716480000000,
"scheduleEndDate": 1716480000000,
"weeklyDate": 0,
"scheduleRecordTime": [
{
"startTime": 1716522176000,
"duration": 102000
}
]
}
],
"weeklyDate": 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 |
---|---|---|
40 | MW_STATUS_VERIFY_FAILED | Recording plan verification failed, conflicting with device restart schedule. |
49 | MW_STATUS_INVALID_DATA | The parameters are missing or incorrect |