1.Get Live Streaming
Description
This API is used to get live streaming of the IPC.
Request link
https://192.168.0.1/openapi/media/getLiveStream, 192.168.0.1 should be replaced by the IP address of the IPC.
Request Parameters
No private parameter for this API, please refer to Public Parameters for more details.
Response Parameters
Parameter | Type | Description |
code | int | Return code, represent the request result, possible return codes are 0, 1, 3, 5, 7, 232, see Error Code for further details. |
hd_live_url | string | High-Definition live streaming of the IPC using RTSP. |
fhd_live_url | string | Full High-Definition live streaming of the IPC using RTSP. |
Request Example
POST /openapi/media/getLiveStreamHTTP/1.1 Host: 192.168.0.1 Content-Type: application/x-www-form-urlencoded app_id=mdk923idkf&random=289192×tamp=1564565937&sign=IDKNFLK392038KDS932K |
Response Example
{ “code”: 0, “data”: { “hd_live_url”: “rtsp://192.168.0.1/ed98eeead4c843f898fef1c203313364/live_hd.sdp”, “fhd_live_url”: “rtsp://192.168.0.1/ed98eeead4c843f898fef1c203313364/live_fhd.sdp” } } |
2.Get Playback Streaming
Description
This API is used to get playback streaming of the IPC.
Request link
https://192.168.0.1/openapi/media/getPlaybackStream, 192.168.0.1 should be replaced by the IP address of the IPC.
Request Parameters
Below are private parameters for this API, please refer to Public Parameters for more details.
Parameter | Type | Description | Required | Example |
start_time | long | Start time of the playback streaming, seconds in UNIX format. | Y | 1578969264 |
end_time | long | End time of the playback streaming, seconds in UNIX format. | Y | 1579055640 |
Response Parameters
Parameter | Type | Description |
code | int | Return code, represent the request result, possible return codes are 0, 1, 3, 5, 7, 230, 235, see Error Code for further details. |
playback_url | string | Playback streaming of the IPC using RTSP. |
Request Example
POST /openapi/media/getPlaybackStream HTTP/1.1 Host: 192.168.0.1 Content-Type: application/x-www-form-urlencoded app_id=mdk923idkf&random=289192×tamp=1564565937&sign=IDKNFLK392038KDS932K&start_time=1564565637&end_time=1564565697 |
Response Example
{ “code”: 0, “data”: { “playback_url”: “rtsp://192.168.0.1/ed98eeead4c843f898fef1c203313364/pb.sdp” } } |
3.Get Record List
Description
This API is used to get record list of the IPC.
Request link
https://192.168.0.1/openapi/media/getRecordList, 192.168.0.1 should be replaced by the IP address of the IPC.
Request Parameters
Below are private parameters for this API, please refer to Public Parameters for more details.
Parameter | Type | Description | Required | Example |
start_time | long | Start time of record files, seconds in UNIX format. | Y | 1578969264 |
end_time | long | End time of record files, seconds in UNIX format. | Y | 1579055640 |
page_num | int | Current page, default is 1, minimum is 1. | N | 1 |
page_size | int | Number of record files in one page, default is 10, range is [0, 500]. | N | 10 |
Response Parameters
Parameter | Type | Description |
code | int | Return code, represent the request result, possible return codes are 0, 1, 3, 5, 7, 231, 234, 235, see Error Code for further details. |
total_num | int | Total number of the eligible record files, about one minute per record file. |
return_num | int | Returned number this time. |
start_time | long | Start time of the record file. |
end_time | long | End time of the record file. |
url | string | Download address of the record file. |
Request Example
POST /openapi/media/getRecordList HTTP/1.1 Host: 192.168.0.1 Content-Type: application/x-www-form-urlencoded app_id=mdk923idkf&random=289192×tamp=1564565937&sign=IDKNFLK392038KDS932K&start_time=1564565216&end_time=1564565697&page_num=2&page_size=30 |
Response Example
{ “code”: 0, “data”: { “total_num”: 100, “return_num”: 30, “record_list”:[{ “start_time”: 1564565216, “end_time”: 1564565276, “url”: “https://192.168.0.1/mnt/sd-card/sunmi_video/video_plan/20190731172656_20190731172756.flv?auth_key=1564643800-efc1f64efb0d1d8fab35f0fe8c823a34”}, …] } } |
4.Get Snapshot
Description
This API is used to get snapshot of the IPC.
Request link
https://192.168.0.1/openapi/media/getSnapshot, 192.168.0.1 should be replaced by the IP address of the IPC.
Request Parameters
No private parameter for this API, please refer to Public Parameters for more details.
Response Parameters
Parameter | Type | Description |
code | int | Return code, represent the request result, possible return codes are 0, 1, 3, 5, 7, 233, see Error Code for further details. |
snapshot_url | string | Download address of the snapshot. |
Request Example
POST /openapi/media/getSnapshot HTTP/1.1 Host: 192.168.0.1 Content-Type: application/x-www-form-urlencoded app_id=mdk923idkf&random=289192×tamp=1564565937&sign=IDKNFLK392038KDS932K |
Response Example
{ “code”: 0, “data”: { “snapshot_url”: “https://192.168.0.1/tmp/snapshot/FM0101122334455_20190726162335.jpg?auth_key=1564129415-215f61f3c5f552c5bf8f43ccef5c66a9” } } |
5.Get Video Clip
Description
Get a video clip before and after a period of time.
When this api called, the IPC will get a video clip which the period is a multiple of 4 seconds. The spanning of the video clip depends on the parameters passed in. The return parameter of the api is the download link of the video clip.
The download link of the video clip will take effect in 4 to 12 seconds. The Effective time is related to parameters passed in.
Request link
https://192.168.0.1/openapi/media/getCurVideos
Request Parameters
Blow are private parameters for this API, please refer to Public Parameters for more details.
Parameter | Type | Description | Required | Example |
preceding | int | Time period before current. 0, 4, and 8 allowed only. | Y | 0 |
following | int | Time period after current. 0, 4, and 8 allowed only. | Y | 8 |
Response Parameters
Parameter | Type | Description |
code | int | Return code, represent the request result, possible return codes are 0, 1, 2, 3, 5, 7, 236, 237, see Error Code for further details. |
url | string | Download link of the video clip, which will take effect after 4 to 12 seconds. |
Request Example
POST /openapi/media/getCurVideos HTTP/1.1 Host: 10.10.61.206 Content-Type: application/json Content-Length: 111 Connection: Keep-Alive Accept-Encoding: gzip, deflate Accept-Language: zh-CN,en,* User-Agent: Mozilla/5.0 app_id=123×tamp=1585743081&random=7783515117&following=0&preceding=0&sign=F4A04BDBE60D9C656A23CD945F703DA2 |
Response Example
{ “data”: { “url”:”https://10.10.63.19/mnt/sd-card/video_slicer/1585741874923_0_0.flv?auth_key=1585741878-c41f9a8751fe0c259b3d00b3842aa668″ }, “code”:0 } |