static MP4_RECORD_DATA getNormalMP4_RECORD_DATA() { MP4_RECORD_DATA mm = new MP4_RECORD_DATA(); mm.emDeviceType = RECORD_FACTURE_TYPE.HK_FACTURE_NVR; mm.uiSocketType = 0; mm.uiMediaType = 0; mm.uiRecordSTime = 1800; mm.uiMainOrSubType = 0; mm.uiPortNumber = 554; mm.uiNVRChannel = 0; mm.uiRecordOldPlan = 0; mm.czEncodingType = "h264"; mm.czCamIPAddress = "192.168.1.151"; mm.czNvrIPAddress = "192.168.1.151"; mm.czRecordPath = "F:/NVSGClicnt/VideoServer/"; mm.szUserName = "******"; mm.szPassword = "******"; return(mm); }
/// <summary> /// 开启录像服务 /// 在推流的时候 /// </summary> /// <param name="IPAddStr"></param> /// <param name="port"></param> /// <returns></returns> public static void StartRecordServer(string IPAddStr, int port) { int MYComputerIP = 90; for (int i = 554; i < port; i++) { MP4_RECORD_DATA mm = getNormalMP4_RECORD_DATA(); mm.czRecordPath = m_czRecordPath; mm.czCamIPAddress = getCamIPAddress(MYComputerIP); mm.czNvrIPAddress = IPAddStr; mm.uiNVRChannel = (uint)(i - 554 + 1); string ppo = i.ToString(); mm.uiPortNumber = uint.Parse(ppo); int res = Mp4Recording_Open(ref mm); Console.WriteLine(" Port = " + i + " StartRecoedServer Result →→→→→→→→→→→→→→" + getFinalResStr(res)); MYComputerIP++; } }
public static extern int Mp4Recording_Open(ref MP4_RECORD_DATA mp4R);