BS2RtspConfig config = Util.AllocateStructure(); config.enabled = Convert.ToByte(1); string strRTSPID = "myAccount"; byte[] arrRTSPID = Encoding.UTF8.GetBytes(strRTSPID); Array.Clear(config.id, 0, BS2Environment.BS2_USER_ID_SIZE); Array.Copy(arrRTSPID, 0, config.id, 0, arrRTSPID.Length); string strRTSPPW = "myPassword"; byte[] arrRTSPPW = Encoding.UTF8.GetBytes(strRTSPPW); Array.Clear(config.password, 0, BS2Environment.BS2_USER_ID_SIZE); Array.Copy(arrRTSPPW, 0, config.password, 0, arrRTSPPW.Length); string strIpAddr = "192.168.0.10"; // rtsp://192.168.0.10 byte[] arrIpAddr = Encoding.UTF8.GetBytes(strIpAddr); Array.Clear(config.address, 0, BS2Environment.BS2_URL_SIZE); Array.Copy(arrIpAddr, 0, config.address, 0, arrIpAddr.Length); config.port = (ushort)554; BS2ErrorCode result = (BS2ErrorCode)API.BS2_SetRtspConfig(sdkContext, deviceID, ref config); if (result != BS2ErrorCode.BS_SDK_SUCCESS) { Console.WriteLine("Got error({0}).", result); }