主要实现功能,直接加载海康SDK播放海康摄像头的实时界面,停止播放后保存此时界面的图片,在图片绘制区域,直线,箭头,可以保存,提交到后台()需要后台提供相应的接口文档);
窗体界面:

代码:

// ***************************************************
//
//文件名称(File Name):HK_Intrution_detection_DrawForm.cs
//
//功能描述(Description):海康摄像头播放界面
//
//数据表(Tables): 无
//
//作者(Author):徐文文
//
//日期(Create Date):2021.05.18
//
// ***************************************************
using ControlFor.Common;
using ControlFor.DataModel;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;namespace ControlFor.HKVideoMoniter
{public partial class HK_Intrution_detection_DrawForm : Form{#region 新数据定义/// <summary>/// 视频监控类/// </summary>monitor_model m_devicesource = new monitor_model();/// <summary>/// 视频参数模型/// </summary>monitor_param_model m_param_model;HK_intrusion_detection_AttributeForm m_Intruction;private bool m_bInitSDK = false;private bool m_bRecord = false;private uint iLastErr = 0;private Int32 m_lUserID = -1;private Int32 m_lRealHandle = -1;private string str1;private string str2;private Int32 i = 0;private Int32 m_lTree = 0;private string str;private long iSelIndex = 0;private uint dwAChanTotalNum = 0;private uint dwDChanTotalNum = 0;private Int32 m_lPort = -1;private IntPtr m_ptrRealHandle;private int[] iIPDevID = new int[96];private int[] iChannelNum = new int[96];private CHCNetSDK.REALDATACALLBACK RealData = null;public CHCNetSDK.NET_DVR_DEVICEINFO_V30 DeviceInfo;public CHCNetSDK.NET_DVR_IPPARACFG_V40 m_struIpParaCfgV40;public CHCNetSDK.NET_DVR_STREAM_MODE m_struStreamMode;public CHCNetSDK.NET_DVR_IPCHANINFO m_struChanInfo;public CHCNetSDK.NET_DVR_PU_STREAM_URL m_struStreamURL;public CHCNetSDK.NET_DVR_IPCHANINFO_V40 m_struChanInfoV40;private PlayCtrl.DECCBFUN m_fDisplayFun = null;public delegate void MyDebugInfo(string str);/// <summary>/// 回调函数定义/// </summary>public CHCNetSDK.DRAWFUN DrawFun = null;/// <summary>/// 声明一个NET_DVR_PICCFG_V40类型的类对象/// </summary>public CHCNetSDK.NET_DVR_PICCFG_V40 m_struPicCfgV40;#endregion#region 自定义绘图/// <summary>/// 区域的点集合/// </summary>public List<PointF> m_listPoint = new List<PointF>();/// <summary>/// 是否绘制/// </summary>public bool m_isDraw = false;/// <summary>/// 类型/// </summary>public DrawRegionTypeEnum m_type = DrawRegionTypeEnum.Polygon;/// <summary>/// 需要绘制的列表/// </summary>public List<PClass> m_drawList = new List<PClass>();/// <summary>/// 鼠标所在位置/// </summary>public PointF m_mouse_point;/// <summary>/// 鼠标是否在视频中/// </summary>public bool m_mouse_pic = false;/// <summary>/// listView选中的某项/// </summary>public ListViewItem m_listViewItem = null;/// <summary>/// 选中的listView中的flag_uuid/// </summary>public string m_selecet_uuid = "";/// <summary>/// 视频控件的框/// </summary>public int m_width;/// <summary>/// 视频控件的高/// </summary>public int m_height;#endregion#region 画图/// <summary>/// 停止播放,保存的截图/// </summary>Image m_img;/// <summary>/// 画布/// </summary>Graphics m_gx;Graphics m_draw_gx;/// <summary>/// pixtureBox发生变化/// </summary>public bool m_picIsChange = false;#endregionpublic HK_Intrution_detection_DrawForm(){InitializeComponent();}/// <summary>/// 海康摄像头预览画面窗体/// </summary>/// <param name="source"></param>/// <param name="param"></param>/// <param name="intrusion"></param>public HK_Intrution_detection_DrawForm(monitor_model source, monitor_param_model param, HK_intrusion_detection_AttributeForm intrusion){InitializeComponent();CommonClass.SetFormIcon<HK_Intrution_detection_DrawForm>(this);m_devicesource = source;m_param_model = param;m_Intruction = intrusion;initFunc();initLvListFunc(m_param_model.v_monitor_param_id);}/// <summary>/// 初始化数据/// </summary>public void initFunc() {try{this.txt_Ip.Text = m_devicesource.local_area_net_ip;this.txt_port.Text = m_devicesource.v_monitor_port;this.txt_username.Text = m_devicesource.v_monitor_account;this.txt_pwd.Text = m_devicesource.v_monitor_password;m_bInitSDK = CHCNetSDK.NET_DVR_Init();if (m_bInitSDK == false){MessageBox.Show("NET_DVR_Init error!");return;}else{InitLV();//保存SDK日志 To save the SDK logCHCNetSDK.NET_DVR_SetLogToFile(3, "C:\\HKSdkLog\\", true);comboBox1.SelectedIndex = 1;for (int i = 0; i < 64; i++){iIPDevID[i] = -1;iChannelNum[i] = -1;}}m_width = this.picBox_view.Width;m_height = this.picBox_view.Height;}catch (Exception ex){LogHelper.WriteLog(ex, "HK_Intrution_detection_DrawForm->initFunc->初始化数据失败");}}/// <summary>/// 初始化ListView/// </summary>public void InitLV(){this.lv_point.Columns.Add("编号");//序号,主键,  水平百分比,垂直百分比,宽比,高比this.lv_point.Columns.Add("uuid");this.lv_point.Columns.Add("hvwh");this.lv_point.Columns[0].Width = lv_point.Width - 10;this.lv_point.Columns[0].TextAlign = HorizontalAlignment.Center; //居中的问题,第一列,只能左对齐this.lv_point.Columns[1].Width = 0;this.lv_point.Columns[2].Width = 0;}/// <summary>/// 初始化摄像头的框到listview/// </summary>/// <param name="my_vid">设备id</param>public void initLvListFunc(string my_vid) {try{m_drawList.Clear();//调用类型接口                dynamic my_data = CommonGetInterFace.getMonitorArea(my_vid);List<dynamic> my_rectlist = JsonConvert.DeserializeObject<List<dynamic>>(my_data.re.ToString());if (my_data.code > 0){if (my_rectlist.Count > 0){for (int i = 0; i < my_rectlist.Count; i++){var my_item = my_rectlist[i];string my_uuid = my_item.area_uuid == null ? "" : my_item.area_uuid.ToString();PClass my_pc = new PClass();my_pc.uuid = my_uuid;my_pc.flag_uuid = my_item.horizontal == null ? "" : my_item.horizontal.ToString();string my_type = my_item.vertical == null ? "Polygon" : my_item.vertical.ToString();switch (my_type){case "Polygon":my_pc.type = DrawRegionTypeEnum.Polygon;my_pc.CID = (i+1).ToString() + ",预警区域";break;case "Line":my_pc.type = DrawRegionTypeEnum.Line;my_pc.CID = (i + 1).ToString() + ",预警直线";break;case "Arrow":my_pc.type = DrawRegionTypeEnum.Arrow;my_pc.CID = (i + 1).ToString() + ",预警方向";break;default:my_pc.type = DrawRegionTypeEnum.Polygon;my_pc.CID = (i + 1).ToString() + ",预警区域";break;}my_pc.control_width = my_item.wide_rate == null ? 1.0 : float.Parse(my_item.wide_rate.ToString());my_pc.control_height = my_item.high_rate == null ? 1.0 : float.Parse(my_item.high_rate.ToString());my_pc.coordinate = my_item.coordinate.ToString();my_pc.CColor = Color.Red;string[] my_strArr = my_pc.coordinate.Split(new[] { "," }, StringSplitOptions.None);List<PointF> my_list_pf = new List<PointF>();for (int j = 0; j < my_strArr.Length; j = j+2){float my_f_x = float.Parse(my_strArr[j]);float my_f_y = float.Parse(my_strArr[j+1]);PointF my_pf = new PointF(my_f_x, my_f_y);my_list_pf.Add(my_pf);}PointF[] my_arr_pf = new PointF[my_list_pf.Count];for (int k = 0; k < my_list_pf.Count; k++){my_arr_pf[k] = my_list_pf[k];}my_pc.listPoint = my_list_pf;my_pc.points = my_arr_pf;m_drawList.Add(my_pc);ListViewItem my_listViewItem = new ListViewItem(new string[] { my_pc.CID, my_pc.flag_uuid, my_pc.DStr });my_listViewItem.Tag = my_pc;lv_point.Items.Add(my_listViewItem);}}}else{MessageBox.Show("请求错误");}}catch (Exception ex){LogHelper.WriteLog(ex, "初始获取摄像头画框数据异常");}}private void HK_Intrution_detection_DrawForm_Load(object sender, EventArgs e){//openDeviceFunc();// tmr_init.Enabled = true;tmr_init.Start();tmr_bind.Start();}/// <summary>/// 初始化IPC/// </summary>public void InfoIPChannel(){uint dwSize = (uint)Marshal.SizeOf(m_struIpParaCfgV40);IntPtr ptrIpParaCfgV40 = Marshal.AllocHGlobal((Int32)dwSize);Marshal.StructureToPtr(m_struIpParaCfgV40, ptrIpParaCfgV40, false);uint dwReturn = 0;int iGroupNo = 0;  //该Demo仅获取第一组64个通道,如果设备IP通道大于64路,需要按组号0~i多次调用NET_DVR_GET_IPPARACFG_V40获取if (!CHCNetSDK.NET_DVR_GetDVRConfig(m_lUserID, CHCNetSDK.NET_DVR_GET_IPPARACFG_V40, iGroupNo, ptrIpParaCfgV40, dwSize, ref dwReturn)){iLastErr = CHCNetSDK.NET_DVR_GetLastError();str = "NET_DVR_GET_IPPARACFG_V40 failed, error code= " + iLastErr;//获取IP资源配置信息失败,输出错误号 Failed to get configuration of IP channels and output the error codeLogHelper.WriteLog(str);}else{LogHelper.WriteLog("NET_DVR_GET_IPPARACFG_V40 succ!");m_struIpParaCfgV40 = (CHCNetSDK.NET_DVR_IPPARACFG_V40)Marshal.PtrToStructure(ptrIpParaCfgV40, typeof(CHCNetSDK.NET_DVR_IPPARACFG_V40));for (i = 0; i < dwAChanTotalNum; i++){//ListAnalogChannel(i + 1, m_struIpParaCfgV40.byAnalogChanEnable[i]);iChannelNum[i] = i + (int)DeviceInfo.byStartChan;}byte byStreamType = 0;uint iDChanNum = 64;if (dwDChanTotalNum < 64){iDChanNum = dwDChanTotalNum; //如果设备IP通道小于64路,按实际路数获取}for (i = 0; i < iDChanNum; i++){iChannelNum[i + dwAChanTotalNum] = i + (int)m_struIpParaCfgV40.dwStartDChan;byStreamType = m_struIpParaCfgV40.struStreamMode[i].byGetStreamType;dwSize = (uint)Marshal.SizeOf(m_struIpParaCfgV40.struStreamMode[i].uGetStream);switch (byStreamType){//目前NVR仅支持直接从设备取流 NVR supports only the mode: get stream from device directlycase 0:IntPtr ptrChanInfo = Marshal.AllocHGlobal((Int32)dwSize);Marshal.StructureToPtr(m_struIpParaCfgV40.struStreamMode[i].uGetStream, ptrChanInfo, false);m_struChanInfo = (CHCNetSDK.NET_DVR_IPCHANINFO)Marshal.PtrToStructure(ptrChanInfo, typeof(CHCNetSDK.NET_DVR_IPCHANINFO));//列出IP通道 List the IP channel// ListIPChannel(i + 1, m_struChanInfo.byEnable, m_struChanInfo.byIPID);iIPDevID[i] = m_struChanInfo.byIPID + m_struChanInfo.byIPIDHigh * 256 - iGroupNo * 64 - 1;Marshal.FreeHGlobal(ptrChanInfo);break;case 4:IntPtr ptrStreamURL = Marshal.AllocHGlobal((Int32)dwSize);Marshal.StructureToPtr(m_struIpParaCfgV40.struStreamMode[i].uGetStream, ptrStreamURL, false);m_struStreamURL = (CHCNetSDK.NET_DVR_PU_STREAM_URL)Marshal.PtrToStructure(ptrStreamURL, typeof(CHCNetSDK.NET_DVR_PU_STREAM_URL));//列出IP通道 List the IP channel// ListIPChannel(i + 1, m_struStreamURL.byEnable, m_struStreamURL.wIPID);iIPDevID[i] = m_struStreamURL.wIPID - iGroupNo * 64 - 1;Marshal.FreeHGlobal(ptrStreamURL);break;case 6:IntPtr ptrChanInfoV40 = Marshal.AllocHGlobal((Int32)dwSize);Marshal.StructureToPtr(m_struIpParaCfgV40.struStreamMode[i].uGetStream, ptrChanInfoV40, false);m_struChanInfoV40 = (CHCNetSDK.NET_DVR_IPCHANINFO_V40)Marshal.PtrToStructure(ptrChanInfoV40, typeof(CHCNetSDK.NET_DVR_IPCHANINFO_V40));//列出IP通道 List the IP channel// ListIPChannel(i + 1, m_struChanInfoV40.byEnable, m_struChanInfoV40.wIPID);iIPDevID[i] = m_struChanInfoV40.wIPID - iGroupNo * 64 - 1;Marshal.FreeHGlobal(ptrChanInfoV40);break;default:break;}}}Marshal.FreeHGlobal(ptrIpParaCfgV40);}private void HK_Intrution_detection_DrawForm_FormClosed(object sender, FormClosedEventArgs e){//closeDeviceFunc();}/// <summary>/// 打开摄像头/// </summary>public void openDeviceFunc() {try{DateTime my_beforDT = System.DateTime.Now;if (m_lUserID < 0) //摄像头未登录,进行登录{//设备IP地址或者域名 Device IPstring DVRIPAddress = txt_Ip.Text; //设备IP地址或者域名 Device IPInt16 DVRPortNumber = Int16.Parse(txt_port.Text);//设备服务端口号 Device Portstring DVRUserName = txt_username.Text;//设备登录用户名 User name to loginstring DVRPassword = txt_pwd.Text;//设备登录密码 Password to login//登录设备 Login the devicem_lUserID = CHCNetSDK.NET_DVR_Login_V30(DVRIPAddress, DVRPortNumber, DVRUserName, DVRPassword, ref DeviceInfo);if (m_lUserID < 0) //登录失败{iLastErr = CHCNetSDK.NET_DVR_GetLastError();str = "NET_DVR_Login_V30 failed, error code= " + iLastErr; //登录失败,输出错误号 Failed to login and output the error codeMessageBox.Show("登录海康摄像头失败");LogHelper.WriteLog("*****登录海康摄像头失败。******" + str);tmr_init.Stop();return;}else{LogHelper.WriteLog("海康摄像头登录成功");dwAChanTotalNum = (uint)DeviceInfo.byChanNum;dwDChanTotalNum = (uint)DeviceInfo.byIPChanNum + 256 * (uint)DeviceInfo.byHighDChanNum;if (dwDChanTotalNum > 0){InfoIPChannel();}else{for (i = 0; i < dwAChanTotalNum; i++){//  ListAnalogChannel(i + 1, 1);iChannelNum[i] = i + (int)DeviceInfo.byStartChan;}comboBox1.SelectedItem = 1;// MessageBox.Show("This device has no IP channel!");}#region 取消显示//以下是函数体内使用的代码uint dwSize = (uint)Marshal.SizeOf(m_struPicCfgV40);//一个指针和对应的结构体,SET和GET Config的时候都是使用指针,但是操作赋值的时候使用的是结构体IntPtr ptrPicCfgV40 = Marshal.AllocHGlobal((Int32)dwSize);Marshal.StructureToPtr(m_struPicCfgV40, ptrPicCfgV40, false);uint dwReturn = 0;int iGroupNo = iChannelNum[(int)iSelIndex]; //通道号 Channel numberif (!CHCNetSDK.NET_DVR_GetDVRConfig(m_lUserID, CHCNetSDK.NET_DVR_GET_PICCFG_V40, iGroupNo, ptrPicCfgV40, dwSize, ref dwReturn)){iLastErr = CHCNetSDK.NET_DVR_GetLastError();str = "NET_DVR_GET_PICCFG_V40 failed, error code= " + iLastErr;//获取IP资源配置信息失败,输出错误号 Failed to get configuration of IP channels and output the error code//MessageBox.Show(str);}else{m_struPicCfgV40 = (CHCNetSDK.NET_DVR_PICCFG_V40)Marshal.PtrToStructure(ptrPicCfgV40, typeof(CHCNetSDK.NET_DVR_PICCFG_V40));//重点是设置这里的byEnableDisplay为0,取消移动侦测框m_struPicCfgV40.struMotion.byEnableDisplay = 0;//不要忘记结构体转换成指针Marshal.StructureToPtr(m_struPicCfgV40, ptrPicCfgV40, true);if (!CHCNetSDK.NET_DVR_SetDVRConfig(m_lUserID, CHCNetSDK.NET_DVR_SET_PICCFG_V40, iGroupNo, ptrPicCfgV40, dwSize)){uint iLastErr = CHCNetSDK.NET_DVR_GetLastError();string str = "NET_DVR_SET_PICCFG_V40 failed, error code= " + iLastErr;//MessageBox.Show(str);}else{//MessageBox.Show("NET_DVR_SET_PICCFG_V40配置成功!" + iGroupNo);                        CHCNetSDK.NET_DVR_GetDVRConfig(m_lUserID, CHCNetSDK.NET_DVR_GET_PICCFG_V40, iGroupNo, ptrPicCfgV40, dwSize, ref dwReturn);m_struPicCfgV40 = (CHCNetSDK.NET_DVR_PICCFG_V40)Marshal.PtrToStructure(ptrPicCfgV40, typeof(CHCNetSDK.NET_DVR_PICCFG_V40));//MessageBox.Show("NET_DVR_GET_PICCFG_V40!" + m_struPicCfgV40.struMotion.byEnableDisplay);}}#endregion// CommonClass.Delay(1, CommonEnum.DelayType.second);#region 直接预览摄像头数据(播放视屏)if (m_lUserID < 0){MessageBox.Show("摄像头未登录,请刷新数据");tmr_init.Stop();return;}if (m_bRecord){MessageBox.Show("摄像头正在忙碌,请刷新数据");tmr_init.Stop();return;}if (m_lRealHandle < 0) //播放视屏{LogHelper.WriteLog("准备播放视频");CHCNetSDK.NET_DVR_PREVIEWINFO lpPreviewInfo = new CHCNetSDK.NET_DVR_PREVIEWINFO();lpPreviewInfo.hPlayWnd = picBox_view.Handle;//预览窗口 live view windowlpPreviewInfo.lChannel = iChannelNum[(int)iSelIndex];//预览的设备通道 the device channel numberif (chk_height.Checked){lpPreviewInfo.dwStreamType = 0;//码流类型:0-主码流,1-子码流,2-码流3,3-码流4,以此类推}else{lpPreviewInfo.dwStreamType = 1;//码流类型:0-主码流,1-子码流,2-码流3,3-码流4,以此类推}lpPreviewInfo.dwLinkMode = 0;//连接方式:0- TCP方式,1- UDP方式,2- 多播方式,3- RTP方式,4-RTP/RTSP,5-RSTP/HTTP lpPreviewInfo.bBlocked = true; //0- 非阻塞取流,1- 阻塞取流lpPreviewInfo.dwDisplayBufNum = 15; //播放库显示缓冲区最大帧数IntPtr pUser = IntPtr.Zero;//用户数据 user data if (comboBox1.SelectedIndex == 0){//打开预览 Start live view m_lRealHandle = CHCNetSDK.NET_DVR_RealPlay_V40(m_lUserID, ref lpPreviewInfo, null/*RealData*/, pUser);}else{lpPreviewInfo.hPlayWnd = IntPtr.Zero;//预览窗口 live view windowm_ptrRealHandle = picBox_view.Handle;RealData = new CHCNetSDK.REALDATACALLBACK(RealDataCallBack);//预览实时流回调函数 real-time stream callback function m_lRealHandle = CHCNetSDK.NET_DVR_RealPlay_V40(m_lUserID, ref lpPreviewInfo, RealData, pUser);}if (m_lRealHandle < 0) //播放数据失败{iLastErr = CHCNetSDK.NET_DVR_GetLastError();str = "NET_DVR_RealPlay_V40 failed, error code= " + iLastErr; //预览失败,输出错误号 failed to start live view, and output the error code.LogHelper.WriteLog("****海康摄像头播放失败****" + str);tmr_init.Stop();return;}else //播放成功{LogHelper.WriteLog("海康摄像头播放成功");tmr_init.Stop();tmr_init.Enabled = false;}}#endregion}}DateTime my_afterDT = System.DateTime.Now;TimeSpan my_ts = my_afterDT.Subtract(my_beforDT);LogHelper.WriteLog(string.Format("从登录到播放总共花费{0}ms", my_ts.TotalMilliseconds));}catch (Exception ex){LogHelper.WriteLog(ex, "登录海康摄像头发生异常");tmr_init.Stop();}}/// <summary>/// 预览实时流回调函数 real-time stream callback function /// </summary>/// <param name="lRealHandle"></param>/// <param name="dwDataType"></param>/// <param name="pBuffer"></param>/// <param name="dwBufSize"></param>/// <param name="pUser"></param>public void RealDataCallBack(Int32 lRealHandle, UInt32 dwDataType, IntPtr pBuffer, UInt32 dwBufSize, IntPtr pUser){//下面数据处理建议使用委托的方式MyDebugInfo AlarmInfo = new MyDebugInfo(DebugInfo);switch (dwDataType){case CHCNetSDK.NET_DVR_SYSHEAD:     // sys headif (dwBufSize > 0){if (m_lPort >= 0){return; //同一路码流不需要多次调用开流接口}//获取播放句柄 Get the port to playif (!PlayCtrl.PlayM4_GetPort(ref m_lPort)){iLastErr = PlayCtrl.PlayM4_GetLastError(m_lPort);str = "PlayM4_GetPort failed, error code= " + iLastErr;this.BeginInvoke(AlarmInfo, str);break;}//设置流播放模式 Set the stream mode: real-time stream modeif (!PlayCtrl.PlayM4_SetStreamOpenMode(m_lPort, PlayCtrl.STREAME_REALTIME)){iLastErr = PlayCtrl.PlayM4_GetLastError(m_lPort);str = "Set STREAME_REALTIME mode failed, error code= " + iLastErr;this.BeginInvoke(AlarmInfo, str);}//打开码流,送入头数据 Open streamif (!PlayCtrl.PlayM4_OpenStream(m_lPort, pBuffer, dwBufSize, 2 * 1024 * 1024)){iLastErr = PlayCtrl.PlayM4_GetLastError(m_lPort);str = "PlayM4_OpenStream failed, error code= " + iLastErr;this.BeginInvoke(AlarmInfo, str);break;}//设置显示缓冲区个数 Set the display buffer numberif (!PlayCtrl.PlayM4_SetDisplayBuf(m_lPort, 15)){iLastErr = PlayCtrl.PlayM4_GetLastError(m_lPort);str = "PlayM4_SetDisplayBuf failed, error code= " + iLastErr;this.BeginInvoke(AlarmInfo, str);}//设置显示模式 Set the display modeif (!PlayCtrl.PlayM4_SetOverlayMode(m_lPort, 0, 0/* COLORREF(0)*/)) //play off screen {iLastErr = PlayCtrl.PlayM4_GetLastError(m_lPort);str = "PlayM4_SetOverlayMode failed, error code= " + iLastErr;this.BeginInvoke(AlarmInfo, str);}//设置解码回调函数,获取解码后音视频原始数据 Set callback function of decoded datam_fDisplayFun = new PlayCtrl.DECCBFUN(DecCallbackFUN);if (!PlayCtrl.PlayM4_SetDecCallBackEx(m_lPort, m_fDisplayFun, IntPtr.Zero, 0)){this.BeginInvoke(AlarmInfo, "PlayM4_SetDisplayCallBack fail");}//开始解码 Start to play                       if (!PlayCtrl.PlayM4_Play(m_lPort, m_ptrRealHandle)){iLastErr = PlayCtrl.PlayM4_GetLastError(m_lPort);str = "PlayM4_Play failed, error code= " + iLastErr;this.BeginInvoke(AlarmInfo, str);break;}}break;case CHCNetSDK.NET_DVR_STREAMDATA:     // video stream dataif (dwBufSize > 0 && m_lPort != -1){for (int i = 0; i < 999; i++){//送入码流数据进行解码 Input the stream data to decodeif (!PlayCtrl.PlayM4_InputData(m_lPort, pBuffer, dwBufSize)){iLastErr = PlayCtrl.PlayM4_GetLastError(m_lPort);str = "PlayM4_InputData failed, error code= " + iLastErr;Thread.Sleep(2);}else{break;}}}break;default:if (dwBufSize > 0 && m_lPort != -1){//送入其他数据 Input the other datafor (int i = 0; i < 999; i++){if (!PlayCtrl.PlayM4_InputData(m_lPort, pBuffer, dwBufSize)){iLastErr = PlayCtrl.PlayM4_GetLastError(m_lPort);str = "PlayM4_InputData failed, error code= " + iLastErr;Thread.Sleep(2);}else{break;}}}break;}}/// <summary>/// 记录日志()/// </summary>/// <param name="str"></param>public void DebugInfo(string str){if (str.Length > 0){str += "\n";//TextBoxInfo.AppendText(str);//MessageBox.Show(str);LogHelper.WriteLog(str);Console.WriteLine(str);}}/// <summary>/// 解码回调函数/// </summary>/// <param name="nPort"></param>/// <param name="pBuf"></param>/// <param name="nSize"></param>/// <param name="pFrameInfo"></param>/// <param name="nReserved1"></param>/// <param name="nReserved2"></param>private void DecCallbackFUN(int nPort, IntPtr pBuf, int nSize, ref PlayCtrl.FRAME_INFO pFrameInfo, int nReserved1, int nReserved2){// 将pBuf解码后视频输入写入文件中(解码后YUV数据量极大,尤其是高清码流,不建议在回调函数中处理)if (pFrameInfo.nType == 3) //#define T_YV12  3{//    FileStream fs = null;//    BinaryWriter bw = null;//    try//    {//        fs = new FileStream("DecodedVideo.yuv", FileMode.Append);//        bw = new BinaryWriter(fs);//        byte[] byteBuf = new byte[nSize];//        Marshal.Copy(pBuf, byteBuf, 0, nSize);//        bw.Write(byteBuf);//        bw.Flush();//    }//    catch (System.Exception ex)//    {//        MessageBox.Show(ex.ToString());//    }//    finally//    {//        bw.Close();//        fs.Close();//    }}}/// <summary>/// 关闭摄像头/// </summary>public void closeDeviceFunc() {try{if (m_lRealHandle >= 0) //正在播放{//停止预览 Stop live view if (!CHCNetSDK.NET_DVR_StopRealPlay(m_lRealHandle)){iLastErr = CHCNetSDK.NET_DVR_GetLastError();str = "NET_DVR_StopRealPlay failed, error code= " + iLastErr;LogHelper.WriteLog("海康摄像头退出播放失败" + str);return;}if ((comboBox1.SelectedIndex == 1) && (m_lPort >= 0)){if (!PlayCtrl.PlayM4_Stop(m_lPort)){iLastErr = PlayCtrl.PlayM4_GetLastError(m_lPort);str = "PlayM4_Stop failed, error code= " + iLastErr;LogHelper.WriteLog(str);}if (!PlayCtrl.PlayM4_CloseStream(m_lPort)){iLastErr = PlayCtrl.PlayM4_GetLastError(m_lPort);str = "PlayM4_CloseStream failed, error code= " + iLastErr;LogHelper.WriteLog(str);}if (!PlayCtrl.PlayM4_FreePort(m_lPort)){iLastErr = PlayCtrl.PlayM4_GetLastError(m_lPort);str = "PlayM4_FreePort failed, error code= " + iLastErr;LogHelper.WriteLog(str);}m_lPort = -1;}m_lRealHandle = -1; //将状态置为未播放状态LogHelper.WriteLog("海康摄像头退出播放成功");if (m_lUserID >= 0) //已经登录{if (!CHCNetSDK.NET_DVR_Logout(m_lUserID)){iLastErr = CHCNetSDK.NET_DVR_GetLastError();str = "NET_DVR_Logout failed, error code= " + iLastErr;LogHelper.WriteLog("海康摄像头退出登录失败" + str);return;}m_lUserID = -1;LogHelper.WriteLog("海康摄像头退出登录成功");}}else //未播放状态{if (m_lUserID >= 0) //已经登录{if (!CHCNetSDK.NET_DVR_Logout(m_lUserID)){iLastErr = CHCNetSDK.NET_DVR_GetLastError();str = "NET_DVR_Logout failed, error code= " + iLastErr;LogHelper.WriteLog("海康摄像头退出登录失败" + str);return;}m_lUserID = -1;LogHelper.WriteLog("海康摄像头退出登录成功");}}}catch (Exception ex){LogHelper.WriteLog(ex, "海康摄像头关闭播放时发生异常");}}private void btn_refresh_Click(object sender, EventArgs e){tmr_init.Stop();tmr_init.Enabled = false;closeDeviceFunc();openDeviceFunc();}private void HK_Intrution_detection_DrawForm_FormClosing(object sender, FormClosingEventArgs e){closeDeviceFunc();}private void tmr_init_Tick(object sender, EventArgs e){openDeviceFunc();}private void btn_stop_Click(object sender, EventArgs e){try{m_img = new Bitmap(this.picBox_view.Width, this.picBox_view.Height);m_gx = Graphics.FromImage(m_img);m_gx.CopyFromScreen(this.PointToScreen(picBox_view.Location), new Point(0, 0), this.picBox_view.Size);closeDeviceFunc();string my_evm_temp_str = System.Environment.CurrentDirectory;string my_evm_str = string.Format(@"{0}\ini\NewImage.jpg", my_evm_temp_str);this.picBox_view.Image = m_img;this.picBox_view.Refresh();this.picBox_view.Image.Save(my_evm_str);Console.WriteLine(picBox_view.Width.ToString() + "," + picBox_view.Height.ToString());picBox_view.SizeMode = PictureBoxSizeMode.StretchImage;picBox_view.Load(my_evm_str);this.picBox_view.Refresh();}catch (Exception ex){LogHelper.WriteLog(ex, "海康停止播放,发生异常");}}private void picBox_view_Resize(object sender, EventArgs e){if (m_lRealHandle < 0) //未播放{m_picIsChange = true;m_width = this.picBox_view.Width;m_height = this.picBox_view.Height;}}private void picBox_view_MouseEnter(object sender, EventArgs e){m_mouse_pic = true;}private void picBox_view_MouseLeave(object sender, EventArgs e){m_mouse_pic = false;}private void picBox_view_MouseDown(object sender, MouseEventArgs e){if (m_lRealHandle < 0){PointF my_pointf = e.Location;m_isDraw = true;if (m_listPoint.Count == 0){m_mouse_point = e.Location;m_listPoint.Add(my_pointf);}if (m_listPoint.Count > 0){if (m_listPoint[m_listPoint.Count - 1].X == my_pointf.X && m_listPoint[m_listPoint.Count - 1].Y == my_pointf.Y){//相同的点不加在list中}else{m_listPoint.Add(my_pointf);}}}}private void picBox_view_MouseMove(object sender, MouseEventArgs e){if (m_isDraw){PointF my_pointf = e.Location;if (m_mouse_pic){m_mouse_point = e.Location; //记录鼠标当前位置// m_draw_gx = picBox_view.CreateGraphics();picBox_view.Refresh();}}}private void picBox_view_Paint(object sender, PaintEventArgs e){try{//Graphics my_gx = e.Graphics;m_draw_gx = e.Graphics;if (m_isDraw && m_lRealHandle < 0) //正在绘制{if (m_mouse_pic){if (rdo_polygon.Checked){if (m_listPoint.Count == 0){//donothing}if (m_listPoint.Count == 1){m_draw_gx.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;PointF my_start_point = m_listPoint[0];PointF my_end_point = m_mouse_point;m_draw_gx.DrawLine(new Pen(Color.Yellow, 1), my_start_point, my_end_point);}if (m_listPoint.Count > 1){for (int i = 0; i < m_listPoint.Count - 1; i++){PointF my_start_point = m_listPoint[i];PointF my_end_point = m_listPoint[i + 1];m_draw_gx.DrawLine(new Pen(Color.Yellow, 1), my_start_point, my_end_point);}if (m_listPoint.Count > 0){PointF my_start_point_last = m_listPoint[m_listPoint.Count - 1];PointF my_end_point_last = m_mouse_point;m_draw_gx.DrawLine(new Pen(Color.Yellow, 1), my_start_point_last, my_end_point_last);}}}if (rdo_line.Checked){if (m_listPoint.Count == 0){//没有操作}if (m_listPoint.Count == 1){PointF my_start_point = m_listPoint[0];PointF my_end_point = m_mouse_point;m_draw_gx.DrawLine(new Pen(Color.Yellow, 1), my_start_point, my_end_point);}if (m_listPoint.Count > 1){if (m_listPoint.Count > 0){PointF my_start_point = m_listPoint[0];PointF my_end_point_last = m_mouse_point;m_draw_gx.DrawLine(new Pen(Color.Yellow, 1), my_start_point, my_end_point_last);}}}if (rdo_arrow.Checked){System.Drawing.Drawing2D.AdjustableArrowCap my_lineCap = new System.Drawing.Drawing2D.AdjustableArrowCap(5, 5, true); //设置一个线头my_lineCap.Filled = true;my_lineCap.MiddleInset = 2.1f; //设置箭头中间的缩进Pen my_pen = new Pen(Color.Yellow, 2);// my_pen.CustomStartCap = new System.Drawing.Drawing2D.AdjustableArrowCap(5, 80, true);my_pen.CustomEndCap = (System.Drawing.Drawing2D.CustomLineCap)my_lineCap;m_draw_gx.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;if (m_listPoint.Count == 0){//没有操作}if (m_listPoint.Count == 1){PointF my_start_point = m_listPoint[0];PointF my_end_point = m_mouse_point;m_draw_gx.DrawLine(my_pen, my_start_point, my_end_point);}if (m_listPoint.Count > 1){if (m_listPoint.Count > 0){PointF my_start_point = m_listPoint[0];PointF my_end_point_last = m_mouse_point;m_draw_gx.DrawLine(my_pen, my_start_point, my_end_point_last);}}}if (m_drawList.Count > 0){for (int i = 0; i < m_drawList.Count; i++){PClass my_pc = m_drawList[i];PointF[] my_draw_pf = calculationZoomFunc(my_pc, m_width, m_height);switch (my_pc.type){case DrawRegionTypeEnum.Polygon:DrawPolygonFuc(m_draw_gx, new Pen(Color.Yellow, 1), my_draw_pf);break;case DrawRegionTypeEnum.Line:DrawLineFuc(m_draw_gx, new Pen(Color.Yellow, 1), my_draw_pf);break;case DrawRegionTypeEnum.Arrow:DrawArrowFunc(m_draw_gx, new Pen(Color.Yellow, 2), my_draw_pf);break;default:break;}}}}}if (!m_isDraw && m_lRealHandle < 0){if (m_drawList.Count > 0){for (int i = 0; i < m_drawList.Count; i++){PClass my_pc = m_drawList[i];PointF[] my_draw_pf = calculationZoomFunc(my_pc, m_width, m_height);switch (my_pc.type){case DrawRegionTypeEnum.Polygon:DrawPolygonFuc(m_draw_gx, new Pen(Color.Yellow, 1), my_draw_pf);break;case DrawRegionTypeEnum.Line:DrawLineFuc(m_draw_gx, new Pen(Color.Yellow, 1), my_draw_pf);break;case DrawRegionTypeEnum.Arrow:DrawArrowFunc(m_draw_gx, new Pen(Color.Yellow, 2), my_draw_pf);break;default:break;}}}}if (lv_point.SelectedItems.Count > 0 && m_lRealHandle <0){Pen pen = new Pen(Color.Yellow, 1);#region 绘制m_drawList中的图形if (m_drawList.Count > 0){foreach (PClass my_dc in m_drawList){if (m_selecet_uuid == my_dc.flag_uuid){pen = new Pen(Color.Red, 1);}else{pen = new Pen(Color.Yellow, 1);}PointF[] my_draw_pf = calculationZoomFunc(my_dc, m_width, m_height);switch (my_dc.type){case DrawRegionTypeEnum.Polygon: //绘制多边形DrawPolygonFuc(m_draw_gx, pen, my_draw_pf);break;case DrawRegionTypeEnum.Line:  //绘制直线DrawLineFuc(m_draw_gx, pen, my_draw_pf);break;case DrawRegionTypeEnum.Arrow: //绘制箭头if (m_selecet_uuid == my_dc.flag_uuid){pen = new Pen(Color.Red, 2);}else{pen = new Pen(Color.Yellow, 2);}DrawArrowFunc(m_draw_gx, pen, my_draw_pf);break;default:break;}}}#endregionpen.Dispose();}}catch (Exception ex){LogHelper.WriteLog(ex, "海康摄像头->picBox_view_Paint发生异常");}}private void picBox_view_MouseDoubleClick(object sender, MouseEventArgs e){m_isDraw = false;if (m_mouse_pic){if (e.Button == MouseButtons.Right){m_listPoint.Clear(); //取消绘制return;}PClass my_pc = new PClass();my_pc.uuid = "";my_pc.type = m_type;string my_currentId = (m_drawList.Count + 1).ToString();if (m_type == DrawRegionTypeEnum.Polygon){my_pc.CID = my_currentId + ",预警区域";}else if (m_type == DrawRegionTypeEnum.Line){my_pc.CID = my_currentId + ",预警直线";}else if (m_type == DrawRegionTypeEnum.Arrow){my_pc.CID = my_currentId + ",预警方向";}else{//nothing}my_pc.CColor = Color.Red;my_pc.control_width = picBox_view.Width;my_pc.control_height = picBox_view.Height;switch (m_type){case DrawRegionTypeEnum.Polygon:PointF[] my_pf1 = new PointF[m_listPoint.Count];for (int i = 0; i < m_listPoint.Count; i++){my_pf1[i] = m_listPoint[i];}my_pc.points = my_pf1;break;case DrawRegionTypeEnum.Line:PointF[] my_pf2 = new PointF[2];my_pf2[0] = m_listPoint[0];my_pf2[1] = m_listPoint[m_listPoint.Count - 1];my_pc.points = my_pf2;break;case DrawRegionTypeEnum.Arrow:PointF[] my_pf3 = new PointF[2];my_pf3[0] = m_listPoint[0];my_pf3[1] = m_listPoint[m_listPoint.Count - 1];my_pc.points = my_pf3;break;default:break;}my_pc.flag_uuid = Guid.NewGuid().ToString();string my_coordinate = my_pc.points[0].X.ToString() + "," + my_pc.points[0].Y.ToString();for (int i = 1; i < my_pc.points.Length; i++){my_coordinate += "," + my_pc.points[i].X.ToString() + "," + my_pc.points[i].Y.ToString();}my_pc.coordinate = my_coordinate;if (m_drawList.Where(p => p.flag_uuid == my_pc.flag_uuid).Count() == 0){if (my_pc.points.Length >= 2){m_drawList.Add(my_pc);ListViewItem my_listViewItem = new ListViewItem(new string[] { my_pc.CID, my_pc.flag_uuid, my_pc.DStr });my_listViewItem.Tag = my_pc;lv_point.Items.Add(my_listViewItem);}}m_listPoint.Clear();picBox_view.Refresh();Console.WriteLine(m_drawList.Count.ToString());}}/// <summary>/// 绘制多边形/// </summary>/// <param name="my_g">画布</param>/// <param name="my_pen">画笔</param>/// <param name="my_points">多边形的点</param>public void DrawPolygonFuc(Graphics my_g, Pen my_pen, PointF[] my_points){Pen my_p = new Pen(my_pen.Color, my_pen.Width);my_g.DrawPolygon(my_p, my_points);}/// <summary>/// 绘制直线/// </summary>/// <param name="my_g">画布</param>/// <param name="my_pen">画笔</param>/// <param name="my_points">直线的端点</param>public void DrawLineFuc(Graphics my_g, Pen my_pen, PointF[] my_points){Pen my_p = new Pen(my_pen.Color, my_pen.Width);PointF my_start_p = my_points[0];PointF my_end_p = my_points[my_points.Count() - 1];my_g.DrawLine(my_p, my_start_p, my_end_p);}/// <summary>/// 绘制箭头/// </summary>/// <param name="my_g">画布</param>/// <param name="my_pen">画笔</param>/// <param name="my_points">箭头两端的端点</param>public void DrawArrowFunc(Graphics my_g, Pen my_pen, PointF[] my_points){System.Drawing.Drawing2D.AdjustableArrowCap my_lineCap = new System.Drawing.Drawing2D.AdjustableArrowCap(5, 5, true); //设置一个线头my_lineCap.Filled = true;my_lineCap.MiddleInset = 2.1f; //设置箭头中间的缩进// my_pen.CustomStartCap = new System.Drawing.Drawing2D.AdjustableArrowCap(5, 80, true);my_pen.CustomEndCap = (System.Drawing.Drawing2D.CustomLineCap)my_lineCap;PointF my_start_p = my_points[0];PointF my_end_p = my_points[my_points.Count() - 1];my_g.DrawLine(my_pen, my_start_p, my_end_p);}/// <summary>/// 点击ListView中的一项触发/// </summary>/// <param name="sender"></param>/// <param name="e"></param>private void lv_point_MouseClick(object sender, MouseEventArgs e){try{m_listViewItem = null;if (lv_point.SelectedItems.Count > 0){string my_CId = lv_point.SelectedItems[0].SubItems[0].Text;m_selecet_uuid = lv_point.SelectedItems[0].SubItems[1].Text;string my_DStr = lv_point.SelectedItems[0].SubItems[2].Text;m_listViewItem = lv_point.SelectedItems[0];if (e.Button == MouseButtons.Left){picBox_view.Refresh();}else{menuStrip1.Location = new Point(e.Location.X + lv_point.Location.X, e.Location.Y+lv_point.Location.Y);menuStrip1.Show();}}}catch (Exception ex){LogHelper.WriteLog(ex, "海康摄像头lv_point_MouseClick->发生异常");}}/// <summary>/// 计算要缩放的的数据列表/// </summary>/// <param name="my_p">要缩放的数据类</param>/// <param name="my_width">此时的pixtureBox控件的宽</param>/// <param name="my_height">此时的pixtureBox控件的高</param>/// <returns>要绘制的点的集合</returns>public PointF[] calculationZoomFunc(PClass my_p, int my_width, int my_height) {PointF[] my_ret = new PointF[my_p.points.Length];for (int i = 0; i < my_p.points.Length; i++){PointF my_temp_point = my_p.points[i];float my_width_scale = my_width / my_p.control_width;float my_height_scale = my_height / my_p.control_height;PointF my_new_point = new PointF(my_temp_point.X* my_width_scale, my_temp_point.Y*my_height_scale);my_ret[i] = my_new_point;}return my_ret;}private void rdo_polygon_CheckedChanged(object sender, EventArgs e){if (rdo_polygon.Checked){m_type = DrawRegionTypeEnum.Polygon;}}private void rdo_line_CheckedChanged(object sender, EventArgs e){if (rdo_line.Checked){m_type = DrawRegionTypeEnum.Line;}}private void rdo_arrow_CheckedChanged(object sender, EventArgs e){if (rdo_arrow.Checked){m_type = DrawRegionTypeEnum.Arrow;}}private void btn_submit_Click(object sender, EventArgs e){List<Dictionary<string, object>> my_lst = new List<Dictionary<string, object>>();for (int i = 0; i < m_drawList.Count; i++){PClass my_pc = m_drawList[i];Dictionary<string, object> my_param = new Dictionary<string, object>();my_param.Add("horizontal", my_pc.flag_uuid);my_param.Add("vertical", my_pc.type.ToString());my_param.Add("wide_rate", my_pc.control_width.ToString());my_param.Add("high_rate", my_pc.control_height.ToString());my_param.Add("v_monitor_param_id", m_param_model.v_monitor_param_id);my_param.Add("project_id", InfoClass.projectId);my_param.Add("create_person_id", InfoClass.userId);my_param.Add("coordinate", m_drawList[i].coordinate);my_lst.Add(my_param);}saveVideoRectFunc(my_lst);}/// <summary>/// 保存摄像头画点的数据/// </summary>/// <param name="my_para"></param>public void saveVideoRectFunc(List<Dictionary<string, object>> my_para) {try{dynamic my_data = CommonPostInterFace.saveMonitorAreas(JsonConvert.SerializeObject(my_para), m_param_model.v_monitor_param_id, m_Intruction.txt_v_monitor_param_type.Text);if (my_data.code > 0){dynamic my_info = JsonConvert.DeserializeObject<dynamic>(my_data.re.ToString());MessageBox.Show("保存成功!");}else{MessageBox.Show("参数或网络问题,保存失败");}}catch (Exception ex){LogHelper.WriteLog(ex, "海康摄像头提交数据发生异常");}}private void tmr_bind_Tick(object sender, EventArgs e){this.picBox_view.Paint += new System.Windows.Forms.PaintEventHandler(this.picBox_view_Paint);tmr_bind.Stop();tmr_bind.Enabled = false;}/// <summary>/// 删除节点/// </summary>/// <param name="sender"></param>/// <param name="e"></param>private void 删除此项ToolStripMenuItem_Click(object sender, EventArgs e){if (null != m_listViewItem){PClass my_pc = (PClass)m_listViewItem.Tag;if (my_pc.uuid ==null || my_pc.uuid == ""){lv_point.Items.Remove(m_listViewItem);//删除集合的写法m_drawList.Remove(m_drawList.Find(pc => pc.flag_uuid.Equals(my_pc.flag_uuid)));}else{//调用接口删除if (delOneRectFunc(my_pc.uuid)){lv_point.Items.Remove(m_listViewItem);m_drawList.Remove(m_drawList.Find(pc => pc.flag_uuid.Equals(my_pc.flag_uuid)));}else{MessageBox.Show("删除失败!");}}menuStrip1.Hide();picBox_view.Refresh();}}/// <summary>/// 设备uuid/// </summary>/// <param name="uuid"></param>/// <returns></returns>public bool delOneRectFunc(string uuid){//删除一个矩形框try{dynamic data = CommonGetInterFace.deleteMonitorArea(uuid);if (data.code > 0){return true;}else{return false;}}catch (Exception ex){LogHelper.WriteLog(ex,"删除矩形框失败,发生异常");return false;}}private void lv_point_MouseUp(object sender, MouseEventArgs e){// Console.WriteLine("");if (lv_point.GetItemAt(e.X, e.Y) == null) {menuStrip1.Hide();}  }}
}

注意:此项目需要海康SDK,需要将海康SDK中的库文件放在程序的执行文件的同级,debug下。
海康SDK地址:
64位:https://download.csdn.net/download/xwwwill/18930276
32位:https://download.csdn.net/download/xwwwill/18931329

C#调用海康SDK播放视屏相关推荐

  1. linux64下调用海康sdk(=登陆、获取通道列表、获取文件列表、按照文件下载文件、按照时间下载文件)

    linux下调用海康sdk 1.库文件的配置 mkdir /data/hk_sdk/ cd /data/hk_sdk/将海康SDK的lib文件夹复制到/data/hk_sdk/下 lib文件下面的结构 ...

  2. C#使用WebService调用海康SDK实现抓图与录像实时下载

    1.海康设备网络SDK下载 下载地址:https://www.hikvision.com/cn/download_more_401.html 下载完毕解压后的目录结构如下: 2.代码实现 通过参考&q ...

  3. java 调用dll_Python调用海康SDK抓取红外图像

    海康SDK提供了C++.C#.Java等示例代码,可以使用这些语言进行二次开发.对于做算法开发的人来说,就想快速采集到图像,然后在Matlab或Python里对图像进行分析,使用C++.C#.Java ...

  4. C#制作ActiveX控件中调用海康SDK的问题

    事情是这样的,有一台海康威视的摄像头,客户需要一个ActiveX控件嵌入到网页中,通过点击按钮开始录制和结束录制来进行视频的录制和保存,关于海康摄像头的二次开发在此就不多说了,可以参考SDK中的说明. ...

  5. Python调用海康SDK进行车牌识别(动态链接库的方法—不通过swig)

    由于公司项目需要,要通过Python取得海康相机识别到的车牌号,由于目前在办公室,无法进行实际测试,所以通过网络触发抓拍的方式来进行. 首先要下载海康官网的SDK示例,最开始从网上查找资料是通过swi ...

  6. 海康 linux java demo_Linux下调用海康SDK(java版)

    一:配置java项目所需的库文件,库文件的配置分为两种方案 方案1 :将需要的库文件放到系统的 /usr/lib下,HCNetSDKCom文件夹下的文件也copy到 /usr/lib下 方案2: 2. ...

  7. python调用海康sdk 数据类型

    c++的 unsigned char指针,python格式为:POINTER(c_char) ok的项目:百度网盘里,HikSDKyv12View fRealDataCallBack_V30 = RE ...

  8. Android平台上集成海康SDK(二)

    Android平台上集成海康SDK 以上是我之前写的一篇Android平台上集成海康SDK的文章,其中对于Android平台上集成海康SDK.基于海康SDK进行二次开发基本上进行了详细地介绍. 这篇文 ...

  9. (一)Qt+OpenCV调用海康工业相机SDK示例开发

    系列文章目录 提示:这里是该系列文章的所有文章的目录 第一章: (一)Qt+OpenCV调用海康工业相机SDK示例开发 第二章: (二)Qt多线程实现海康工业相机图像实时采集 文章目录 系列文章目录 ...

  10. AI云边端协同EasyCVR使用海康SDK接入,设备录像下载失败是什么原因?

    EasyCVR视频融合云服务支持多协议.多类型的设备接入,平台具备强大的视频汇聚与管理.数据分发.平台级联.设备管理等视频能力.基于云边端架构,EasyCVR具备很灵活的云边调度能力,解决视频监控领域 ...

最新文章

  1. linux下锐捷拨号的问题
  2. Leetcode-13. 罗马数字转整数(C++)
  3. ActionForm类及表单数据验证
  4. linux学习笔记:1.基础知识和命令行基本操作
  5. 关于如何将轮播图在移动端和pc端自适应的操作
  6. bigquery数据类型_将BigQuery与TB数据一起使用后的成本和性能课程
  7. DNW应用程序错误,DNW错误问题解决
  8. 计算机网络中常见拓扑结构及特点,常见的网络拓扑结构有哪些?并说明其优缺点....
  9. pycharm关联python ide_Python+Selenium进阶版 (一)- Python IDE工具-PyCharm的安装和使用...
  10. Exalogic Elastic Cloud
  11. 利用哈夫曼编码英文字母表
  12. python编写计算方差的函数_基于python计算滚动方差(标准差)talib和pd.rolling函数差异详解...
  13. 412 Precondition Failed
  14. Glide学习(二)—缓存策略
  15. 职场新人必修之苦逼初感悟
  16. 关于opencv的rows和cols的理解
  17. 音视频开发系列(24)使用FFmpeg添加、删除、替换和提取视频中的音频
  18. 术语FXO和FXS的含义是什么?
  19. [leetcode] 893. Groups of Special-Equivalent Strings
  20. 世界上有哪几大杀毒软件??

热门文章

  1. c实现一个简单的线性反馈移位寄存器LFSR
  2. C语言实现sin函数的程序设计
  3. UT斯达康首家手机网上专卖店落户淘宝网
  4. 提取Flash源文件中的素材
  5. 第 5-8 课:综合实战客户管理系统(⼆)
  6. 计算机病毒能破坏u盘文件,[计算机病毒]快捷方式病毒(U盘文件变为快捷方式)...
  7. 磁盘文件系统Fat、Fat32、NTFS、exFAT的优缺点
  8. 图片识别引擎-识图引擎搜集~
  9. cadence菜鸟之旅
  10. 蓝桥杯c语言试题 历届真题 天干地支【第十一届】【决赛】【A组】