录像下载¶
实现录像的查找与下载流程
接口概览¶
| 接口名称 | 功能描述 |
|---|---|
NET_SDK_FindFile | 查找录像文件 |
NET_SDK_FindNextFile | 获取文件信(文件名、大小、开始和结束时间) |
NET_SDK_FindClose | 关闭查找文件 |
NET_SDK_GetFileByTimeExV2 | 时间下载 |
NET_SDK_StopGetFile | 停止下载 |
Note
接口详细参数见接口定义部分
流程说明¶
---
title: 录像下载
---
flowchart TD
A(设备SDK初始化<br><strong>NET_SDK_Init</strong>)
B(用户注册设备<br><strong>NET_SDK_Login</strong>或<br><strong>NET_SDK_LoginEx</strong>)
subgraph 查找录像文件
direction LR
S0(查找录像文件<br><strong>NET_SDK_FindFile</strong>)
S1(逐个获取录像文件信息<br><strong>NET_SDK_FindNextFile</strong>)
S2(停止录像查找<br><strong>NET_SDK_FindClose</strong>)
S0 --> S1 --> S2
end
subgraph 录像文件下载
direction LR
S00(按时间回放<br><strong>NET_SDK_GetFileByTimeExV2</strong>)
S01(停止录像回放<br><strong>NET_SDK_StopPlayBack</strong>)
S00 --> S01
end
E(注销设备<br><strong>NET_SDK_Logout</strong>)
F(释放SDK资源<br><strong>NET_SDK_Cleanup</strong>)
A --> B --> 查找录像文件 --> 录像文件下载 --> E --> F
-
NET_SDK_FindFile:查询某个时间段内是否有录像文件 -
NET_SDK_FindNextFile:通过NET_SDK_FindFile返回的句柄,查询录像文件的具体信息,包括录像的起止时间等 -
NET_SDK_GetFileByTimeExV2:通过NET_SDK_FindNextFile返回的录像的起止时间,下载录像
示例代码¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | |
相关说明¶
-
下载路径须是已存在的有效路径,路径中有文件夹不存在时,下载失败,SDK 不会自动创建
-
下载的录像过大时,下载等待时间可能需要增加