admin管理员组

文章数量:1404927

I have Dahua's CCTV camera and DVR in my home. I want to get its live feed and run my own computer vision algorithms on top of it. So in order to do that, I am using Dahua's python sdk (General_NetSDK_Eng_Python_win64_IS_V3.058.0000004.0.R.241125) from their official website (Dahua Partner Alliances) to tinker with my DVR. The following code snippet from their RealPlayDemo.py file (present in their sdk's demo folder) shows how they are connecting using Ip and port:

def login(self):
    stuInParam = NET_IN_LOGIN_WITH_HIGHLEVEL_SECURITY()
    stuInParam.dwSize = sizeof(NET_IN_LOGIN_WITH_HIGHLEVEL_SECURITY)
    stuInParam.szIP = b'MyLocalIp'
    stuInParam.nPort = MyPort
    stuInParam.szUserName = b'MyUserName'
    stuInParam.szPassword = b'MyPassword'
    stuInParam.emSpecCap = EM_LOGIN_SPAC_CAP_TYPE.TCP
    stuInParam.pCapParam = None

    stuOutParam = NET_OUT_LOGIN_WITH_HIGHLEVEL_SECURITY()
    stuOutParam.dwSize = sizeof(NET_OUT_LOGIN_WITH_HIGHLEVEL_SECURITY)

    self.loginID, device_info, error_msg = self.sdk.LoginWithHighLevelSecurity(stuInParam, 
    stuOutParam)

    if self.loginID != 0:
        print(f'Login Successful, with loginId: {self.loginID}')
    else:
        print(f'Could not login, as error: {error_msg}')

Now, how can I modify the code to connect using my device SerialNumber, through P2P? I am just starting out with the sdk, so don't have much knowledge about it. Let me know if you need any more information from me.

I hope this is the right forum where I can get the answer, but do let me know if this is not the right place for it. It would be great if someone could help me in figuring this out. Thanks!!

本文标签: Dahua Python SDK P2P ConnectionStack Overflow