python实现onvif协议-2

from suds.client import Client
from suds.wsse import Security
from suds_passworddigest.token import UsernameDigestToken

url = 'file:///home/aphero/python/wsdl/media.wsdl'
xadd='http://1.1.1.1/onvif/Media'
client=Client(url,location=xadd)
security = Security()
token = UsernameDigestToken("admin", "12345")
security.tokens.append(token)
client.set_options(wsse=security)


profiles=client.service.GetProfiles()
for profile in profiles:
    print profile._token,profile.Name
    param={"StreamSetup":profile.Name,"ProfileToken":profile._token}
    MediaUri=client.service.GetStreamUri(param)
    print MediaUri.Uri

你可能感兴趣的:(python实现onvif协议-2)