using System;
namespace EC.Entity.Video
{
public class MonitorCamera
{
public MonitorCamera()
{
}
///
/// 主键
///
public string Id { get; set; }
///
/// 站点id
///
public string SiteId { get; set; }
///
/// 相机名称
///
public string CameraName { get; set; }
///
/// 相机类型
///
public int Type { get; set; }
///
/// 相机ip
///
public string Ip { get; set; }
///
/// 相机端口
///
public int Port { get; set; }
///
/// 认证用户名
///
public string User { get; set; }
///
/// 认证密码
///
public string Password { get; set; }
///
/// 纬度
///
public decimal Latitude { get; set; }
///
/// 经度
///
public decimal Longitude { get; set; }
///
/// 高度
///
public decimal Height { get; set; }
///
/// Rtsp地址
///
public string PreRtsp { get; set; }
///
/// 分析 Rtsp 地址
///
public string AnalysisRtsp { get; set; }
///
/// 录像 Rtsp 地址通道3
///
public string RecordRtsp { get; set; }
///
/// 云台控制ip
///
public string CloudCtrlIp { get; set; }
///
/// 云台控制端口
///
public int CloudCtrlPort { get; set; }
///
/// 流媒体服务器id
///
public string StreamingMediaId { get; set; }
///
/// 录像机id
///
public string VideoRecorderId { get; set; }
///
///
///
public int Factory { get; set; }
///
/// 相机预览通道
///
public int Channel { get; set; }
///
/// 样式
///
public int Style { get; set; }
///
/// 左夹角
///
public double LeftAngle { get; set; }
///
/// 右夹角
///
public double RightAngle { get; set; }
///
/// 视野中央有效距离
///
public double ViewDistance { get; set; }
///
/// 采样帧率
///
public int FrameRate { get; set; }
///
/// 最大跟踪范围
///
public int MaxRange { get; set; }
///
/// 状态
///
public int Status { get; set; }
///
/// 零方位角(正北夹角)
///
public double ZeroAzimuth { get; set; }
///
/// 安装垂直角(上下-90°~90°)
///
public double FixedAngle { get; set; }
///
/// 最大仰角
///
public double MaxElevation { get; set; }
///
/// 最大可视距离
///
public double MaxVisibleDistance { get; set; }
///
/// 变倍因子
///
public double ZoomFactor { get; set; }
///
/// 创建人
///
public string CreateBy { get; set; }
///
/// 创建日期
///
public DateTime? CreateTime { get; set; }
///
/// 更新人
///
public string UpdateBy { get; set; }
///
/// 更新日期
///
public DateTime? UpdateTime { get; set; }
public MonitorCamera(string cameraIp, int port, string userName, string passWord, int factory = 0, int type = 0)
{
Ip = cameraIp;
Port = port;
User = userName;
Password = passWord;
Factory = factory;
Type = type;
}
public string RtspURL(int width = 640)
{
if (width < 1200)
{
if (!string.IsNullOrEmpty(RecordRtsp))
{
return RecordRtsp;
}
}
if (!string.IsNullOrEmpty(PreRtsp))
{
return PreRtsp;
}
string rtspformat = "rtsp://{0}:{1}@{2}:554";
//switch (Factory)
//{
// case (int)Video.HK:
// rtspformat = "rtsp://{0}:{1}@{2}:554/Streaming/Channels/102?transportmode=unicast&profile=Profile_2";
// break;
// case (int)VidoeType.DH:
// rtspformat = "rtsp://{0}:{1}@{2}:554/cam/realmonitor?channel=1&subtype=1&unicast=true&proto=Onvif";
// break;
// //case VidoeType.YS:
// // return "";
//}
string url = string.Format(rtspformat, User, Password, Ip);
return url;
}
}
}