海康摄像头视频流获取
parent
b93a711fb7
commit
7633b88518
|
|
@ -1583,6 +1583,42 @@ namespace OpenAuth.App.ServiceApp.FireManagement
|
|||
return "fail";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取单个设备的视频流--通用
|
||||
/// </summary>
|
||||
/// <param name="cameraIndexCode">设备唯一标识吗</param>
|
||||
/// <param name="url">设备地址(例:192.168.10.163)</param>
|
||||
/// <param name="appkey"></param>
|
||||
/// <param name="appsecret"></param>
|
||||
/// <param name="port">设备端口(例1443)</param>
|
||||
/// <param name="protocol"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[AllowAnonymous]
|
||||
public string GetPreviewURL(string cameraIndexCode,string url,string appkey,string appsecret,int port, string protocol)
|
||||
{
|
||||
HttpUtillib.SetPlatformInfo(appkey, appsecret, url, port, true);
|
||||
|
||||
var obj = new
|
||||
{
|
||||
cameraIndexCode,
|
||||
streamType = 0,
|
||||
protocol = protocol,
|
||||
transmode = 1,
|
||||
expand = "transcode=0",
|
||||
streamform = "ps"
|
||||
};
|
||||
string body = JsonConvert.SerializeObject(obj);
|
||||
string uri = "/artemis/api/video/v2/cameras/previewURLs";
|
||||
byte[] result = HttpUtillib.HttpPost(uri, body, 15, 1);
|
||||
if (null != result)
|
||||
{
|
||||
return Encoding.UTF8.GetString(result);
|
||||
}
|
||||
|
||||
return "fail";
|
||||
}
|
||||
|
||||
|
||||
public async Task<Response<dynamic>> ListCameraWithInRange(string lng, string lat, int radius)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue