onvif icon indicating copy to clipboard operation
onvif copied to clipboard

GetProfile is not working in some cameras.

Open kalmastenitin opened this issue 7 months ago • 3 comments

IP Camera Company Named Syntel All other endpoints are working fine: but profile request is asking for authentication but dahua cameras are working fine.

Here is request :- <?xml version="1.0" encoding="UTF-8"?><soap-env:Envelope xmlns:soap-env="http://www.w3.org/2003/05/soap-envelope" xmlns:soap-enc="http://www.w3.org/2003/05/soap-encoding" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:onvif="http://www.onvif.org/ver10/schema" xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:wsntw="http://docs.oasis-open.org/wsn/bw-2" xmlns:tan="http://www.onvif.org/ver20/analytics/wsdl" xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:wsrf-rw="http://docs.oasis-open.org/wsrf/rw-2" xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:tptz="http://www.onvif.org/ver20/ptz/wsdl"><soap-env:Header><Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> <UsernameToken xmlns=""> <Username>admin</Username> <Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">tmD70TuteOMdpVIqXhSzkx1/w+M=</Password> <Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">n1115yhlqt6di7bme8ea54xq6mqun47h</Nonce> <Created xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2023-11-24T07:54:33.429776418Z</Created> </UsernameToken> </Security></soap-env:Header><soap-env:Body><tds:GetCapabilities> <tds:Category>All</tds:Category> </tds:GetCapabilities></soap-env:Body></soap-env:Envelope>

Response Provided By the camera :- <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:chan="http://schemas.microsoft.com/ws/2005/02/duplex" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:wsadis="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:c14n="http://www.w3.org/2001/10/xml-exc-c14n#" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:saml1="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" xmlns:wsc="http://docs.oasis-open.org/ws-sx/ws-secureconversation/200512" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:xmime="http://tempuri.org/xmime.xsd" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:ttr="http://www.onvif.org/ver20/analytics/radiometry" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wsrfbf="http://docs.oasis-open.org/wsrf/bf-2" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:wsrfr="http://docs.oasis-open.org/wsrf/r-2" xmlns:dn="http://www.onvif.org/ver10/network/wsdl" xmlns:d="http://schemas.xmlsoap.org/ws/2005/04/discovery" xmlns:tan="http://www.onvif.org/ver20/analytics/wsdl" xmlns:tand="http://www.onvif.org/ver10/analyticsdevice/wsdl" xmlns:tdisp="http://www.onvif.org/ver10/display/wsdl" xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:timg20="http://www.onvif.org/ver20/imaging/wsdl" xmlns:tmd="http://www.onvif.org/ver10/deviceIO/wsdl" xmlns:tptz20="http://www.onvif.org/ver20/ptz/wsdl" xmlns:trc="http://www.onvif.org/ver10/recording/wsdl" xmlns:trp="http://www.onvif.org/ver10/replay/wsdl" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:trt20="http://www.onvif.org/ver20/media/wsdl" xmlns:tse="http://www.onvif.org/ver10/search/wsdl" xmlns:tns1="http://www.onvif.org/ver10/topics" xmlns:tnshik="http://www.hikvision.com/2011/event/topics" xmlns:ter="http://www.onvif.org/ver10/error"><SOAP-ENV:Header><wsse:Security SOAP-ENV:mustUnderstand="true"></wsse:Security></SOAP-ENV:Header><SOAP-ENV:Body><SOAP-ENV:Fault><SOAP-ENV:Code><SOAP-ENV:Value>SOAP-ENV:Sender</SOAP-ENV:Value><SOAP-ENV:Subcode><SOAP-ENV:Value>ter:NotAuthorized</SOAP-ENV:Value></SOAP-ENV:Subcode></SOAP-ENV:Code><SOAP-ENV:Reason><SOAP-ENV:Text xml:lang="en">Sender not Authorized</SOAP-ENV:Text></SOAP-ENV:Reason><SOAP-ENV:Detail>The action requested requires authorization and the sender is not authorized.</SOAP-ENV:Detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>

I'am trying to fetch snapshot url here. so i need to fetch all profiles.

Same Request Gives Success with Dahua Camera:- <?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:tt="http://www.onvif.org/ver10/schema"><s:Body><trt:GetProfilesResponse><trt:Profiles token="Profile000" fixed="true"><tt:Name>Profile000</tt:Name><tt:VideoSourceConfiguration token="VideoSource000"><tt:Name>VideoSource000</tt:Name><tt:UseCount>2</tt:UseCount><tt:SourceToken>VideoSource000</tt:SourceToken><tt:Bounds x="0" y="0" width="1920" height="1080"></tt:Bounds></tt:VideoSourceConfiguration><tt:VideoEncoderConfiguration token="VideoEncoder000"><tt:Name>VideoEncoder000</tt:Name><tt:UseCount>1</tt:UseCount><tt:Encoding>H265</tt:Encoding><tt:Resolution><tt:Width>1920</tt:Width><tt:Height>1080</tt:Height></tt:Resolution><tt:Quality>4.000000</tt:Quality><tt:RateControl><tt:FrameRateLimit>1</tt:FrameRateLimit><tt:EncodingInterval>1</tt:EncodingInterval><tt:BitrateLimit>1536</tt:BitrateLimit></tt:RateControl><tt:H265><tt:GovLength>2</tt:GovLength><tt:H265Profile>Main</tt:H265Profile></tt:H265><tt:Multicast><tt:Address><tt:Type>IPv4</tt:Type><tt:IPv4Address>224.1.2.4</tt:IPv4Address></tt:Address><tt:Port>40000</tt:Port><tt:TTL>64</tt:TTL><tt:AutoStart>false</tt:AutoStart></tt:Multicast><tt:SessionTimeout>PT60S</tt:SessionTimeout></tt:VideoEncoderConfiguration><tt:VideoAnalyticsConfiguration token="Analytics000"><tt:Name>Analytics000</tt:Name><tt:UseCount>2</tt:UseCount><tt:AnalyticsEngineConfiguration><tt:AnalyticsModule Name="MyCellMotionEngine" Type="tt:CellMotionEngine"><tt:Parameters><tt:SimpleItem Name="Sensitivity" Value="60"></tt:SimpleItem><tt:ElementItem Name="Layout"><tt:CellLayout Columns="22" Rows="18"><tt:Transformation><tt:Translate x="-1.000000" y="1.000000"></tt:Translate><tt:Scale x="0.000244" y="0.000244"></tt:Scale></tt:Transformation></tt:CellLayout></tt:ElementItem></tt:Parameters></tt:AnalyticsModule><tt:AnalyticsModule Name="MyCellMotionEngine" Type="tt:CellMotionEngine"><tt:Parameters><tt:SimpleItem Name="Sensitivity" Value="60"></tt:SimpleItem><tt:ElementItem Name="Layout"><tt:CellLayout Columns="22" Rows="18"><tt:Transformation><tt:Translate x="-1.000000" y="1.000000"></tt:Translate><tt:Scale x="0.000244" y="0.000244"></tt:Scale></tt:Transformation></tt:CellLayout></tt:ElementItem></tt:Parameters></tt:AnalyticsModule><tt:AnalyticsModule Name="MyCellMotionEngine" Type="tt:CellMotionEngine"><tt:Parameters><tt:SimpleItem Name="Sensitivity" Value="60"></tt:SimpleItem><tt:ElementItem Name="Layout"><tt:CellLayout Columns="22" Rows="18"><tt:Transformation><tt:Translate x="-1.000000" y="1.000000"></tt:Translate><tt:Scale x="0.000244" y="0.000244"></tt:Scale></tt:Transformation></tt:CellLayout></tt:ElementItem></tt:Parameters></tt:AnalyticsModule><tt:AnalyticsModule Name="MyCellMotionEngine" Type="tt:CellMotionEngine"><tt:Parameters><tt:SimpleItem Name="Sensitivity" Value="60"></tt:SimpleItem><tt:ElementItem Name="Layout"><tt:CellLayout Columns="22" Rows="18"><tt:Transformation><tt:Translate x="-1.000000" y="1.000000"></tt:Translate><tt:Scale x="0.000244" y="0.000244"></tt:Scale></tt:Transformation></tt:CellLayout></tt:ElementItem></tt:Parameters></tt:AnalyticsModule></tt:AnalyticsEngineConfiguration><tt:RuleEngineConfiguration><tt:Rule Name="Region1" Type="tt:CellMotionDetector"><tt:Parameters><tt:SimpleItem Name="MinCount" Value="20"></tt:SimpleItem><tt:SimpleItem Name="AlarmOnDelay" Value="1000"></tt:SimpleItem><tt:SimpleItem Name="AlarmOffDelay" Value="1000"></tt:SimpleItem><tt:SimpleItem Name="ActiveCells" Value="0P8A8A=="></tt:SimpleItem></tt:Parameters></tt:Rule><tt:Rule Name="Region2" Type="tt:CellMotionDetector"><tt:Parameters><tt:SimpleItem Name="MinCount" Value="20"></tt:SimpleItem><tt:SimpleItem Name="AlarmOnDelay" Value="1000"></tt:SimpleItem><tt:SimpleItem Name="AlarmOffDelay" Value="1000"></tt:SimpleItem><tt:SimpleItem Name="ActiveCells" Value="zwA="></tt:SimpleItem></tt:Parameters></tt:Rule><tt:Rule Name="Region3" Type="tt:CellMotionDetector"><tt:Parameters><tt:SimpleItem Name="MinCount" Value="20"></tt:SimpleItem><tt:SimpleItem Name="AlarmOnDelay" Value="1000"></tt:SimpleItem><tt:SimpleItem Name="AlarmOffDelay" Value="1000"></tt:SimpleItem><tt:SimpleItem Name="ActiveCells" Value="zwA="></tt:SimpleItem></tt:Parameters></tt:Rule><tt:Rule Name="Region4" Type="tt:CellMotionDetector"><tt:Parameters><tt:SimpleItem Name="MinCount" Value="20"></tt:SimpleItem><tt:SimpleItem Name="AlarmOnDelay" Value="1000"></tt:SimpleItem><tt:SimpleItem Name="AlarmOffDelay" Value="1000"></tt:SimpleItem><tt:SimpleItem Name="ActiveCells" Value="zwA="></tt:SimpleItem></tt:Parameters></tt:Rule></tt:RuleEngineConfiguration></tt:VideoAnalyticsConfiguration><tt:PTZConfiguration token="PTZ000" MoveRamp="0" PresetRamp="0" PresetTourRamp="0"><tt:Name>PTZ000</tt:Name><tt:UseCount>2</tt:UseCount><tt:NodeToken>PTZ000</tt:NodeToken><tt:DefaultRelativeZoomTranslationSpace>http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace</tt:DefaultRelativeZoomTranslationSpace><tt:DefaultContinuousZoomVelocitySpace>http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace</tt:DefaultContinuousZoomVelocitySpace><tt:DefaultPTZSpeed><tt:Zoom space="http://www.onvif.org/ver10/tptz/ZoomSpaces/ZoomGenericSpeedSpace" x="0.800000"></tt:Zoom></tt:DefaultPTZSpeed><tt:DefaultPTZTimeout>PT10S</tt:DefaultPTZTimeout></tt:PTZConfiguration><tt:MetadataConfiguration token="Metadata000" CompressionType="None" GeoLocation="false"><tt:Name>Metadata000</tt:Name><tt:UseCount>1</tt:UseCount><tt:PTZStatus><tt:Status>false</tt:Status><tt:Position>false</tt:Position></tt:PTZStatus><tt:Events><tt:Filter><wsnt:TopicExpression Dialect="http://www.onvif.org/ver10/tev/topicExpression/ConcreteSet" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tns1="http://www.onvif.org/ver10/topics">tns1:Media/ConfigurationChanged</wsnt:TopicExpression></tt:Filter></tt:Events><tt:Analytics>true</tt:Analytics><tt:Multicast><tt:Address><tt:Type>IPv4</tt:Type><tt:IPv4Address>224.1.2.4</tt:IPv4Address></tt:Address><tt:Port>40000</tt:Port><tt:TTL>64</tt:TTL><tt:AutoStart>false</tt:AutoStart></tt:Multicast><tt:SessionTimeout>PT60S</tt:SessionTimeout></tt:MetadataConfiguration></trt:Profiles><trt:Profiles token="Profile001" fixed="true"><tt:Name>Profile001</tt:Name><tt:VideoSourceConfiguration token="VideoSource000"><tt:Name>VideoSource000</tt:Name><tt:UseCount>2</tt:UseCount><tt:SourceToken>VideoSource000</tt:SourceToken><tt:Bounds x="0" y="0" width="1920" height="1080"></tt:Bounds></tt:VideoSourceConfiguration><tt:VideoEncoderConfiguration token="VideoEncoder001"><tt:Name>VideoEncoder001</tt:Name><tt:UseCount>1</tt:UseCount><tt:Encoding>H264</tt:Encoding><tt:Resolution><tt:Width>704</tt:Width><tt:Height>576</tt:Height></tt:Resolution><tt:Quality>4.000000</tt:Quality><tt:RateControl><tt:FrameRateLimit>1</tt:FrameRateLimit><tt:EncodingInterval>1</tt:EncodingInterval><tt:BitrateLimit>256</tt:BitrateLimit></tt:RateControl><tt:H264><tt:GovLength>2</tt:GovLength><tt:H264Profile>Main</tt:H264Profile></tt:H264><tt:Multicast><tt:Address><tt:Type>IPv4</tt:Type><tt:IPv4Address>224.1.2.4</tt:IPv4Address></tt:Address><tt:Port>40016</tt:Port><tt:TTL>64</tt:TTL><tt:AutoStart>false</tt:AutoStart></tt:Multicast><tt:SessionTimeout>PT60S</tt:SessionTimeout></tt:VideoEncoderConfiguration><tt:VideoAnalyticsConfiguration token="Analytics000"><tt:Name>Analytics000</tt:Name><tt:UseCount>2</tt:UseCount><tt:AnalyticsEngineConfiguration><tt:AnalyticsModule Name="MyCellMotionEngine" Type="tt:CellMotionEngine"><tt:Parameters><tt:SimpleItem Name="Sensitivity" Value="60"></tt:SimpleItem><tt:ElementItem Name="Layout"><tt:CellLayout Columns="22" Rows="18"><tt:Transformation><tt:Translate x="-1.000000" y="1.000000"></tt:Translate><tt:Scale x="0.000244" y="0.000244"></tt:Scale></tt:Transformation></tt:CellLayout></tt:ElementItem></tt:Parameters></tt:AnalyticsModule><tt:AnalyticsModule Name="MyCellMotionEngine" Type="tt:CellMotionEngine"><tt:Parameters><tt:SimpleItem Name="Sensitivity" Value="60"></tt:SimpleItem><tt:ElementItem Name="Layout"><tt:CellLayout Columns="22" Rows="18"><tt:Transformation><tt:Translate x="-1.000000" y="1.000000"></tt:Translate><tt:Scale x="0.000244" y="0.000244"></tt:Scale></tt:Transformation></tt:CellLayout></tt:ElementItem></tt:Parameters></tt:AnalyticsModule><tt:AnalyticsModule Name="MyCellMotionEngine" Type="tt:CellMotionEngine"><tt:Parameters><tt:SimpleItem Name="Sensitivity" Value="60"></tt:SimpleItem><tt:ElementItem Name="Layout"><tt:CellLayout Columns="22" Rows="18"><tt:Transformation><tt:Translate x="-1.000000" y="1.000000"></tt:Translate><tt:Scale x="0.000244" y="0.000244"></tt:Scale></tt:Transformation></tt:CellLayout></tt:ElementItem></tt:Parameters></tt:AnalyticsModule><tt:AnalyticsModule Name="MyCellMotionEngine" Type="tt:CellMotionEngine"><tt:Parameters><tt:SimpleItem Name="Sensitivity" Value="60"></tt:SimpleItem><tt:ElementItem Name="Layout"><tt:CellLayout Columns="22" Rows="18"><tt:Transformation><tt:Translate x="-1.000000" y="1.000000"></tt:Translate><tt:Scale x="0.000244" y="0.000244"></tt:Scale></tt:Transformation></tt:CellLayout></tt:ElementItem></tt:Parameters></tt:AnalyticsModule></tt:AnalyticsEngineConfiguration><tt:RuleEngineConfiguration><tt:Rule Name="Region1" Type="tt:CellMotionDetector"><tt:Parameters><tt:SimpleItem Name="MinCount" Value="20"></tt:SimpleItem><tt:SimpleItem Name="AlarmOnDelay" Value="1000"></tt:SimpleItem><tt:SimpleItem Name="AlarmOffDelay" Value="1000"></tt:SimpleItem><tt:SimpleItem Name="ActiveCells" Value="0P8A8A=="></tt:SimpleItem></tt:Parameters></tt:Rule><tt:Rule Name="Region2" Type="tt:CellMotionDetector"><tt:Parameters><tt:SimpleItem Name="MinCount" Value="20"></tt:SimpleItem><tt:SimpleItem Name="AlarmOnDelay" Value="1000"></tt:SimpleItem><tt:SimpleItem Name="AlarmOffDelay" Value="1000"></tt:SimpleItem><tt:SimpleItem Name="ActiveCells" Value="zwA="></tt:SimpleItem></tt:Parameters></tt:Rule><tt:Rule Name="Region3" Type="tt:CellMotionDetector"><tt:Parameters><tt:SimpleItem Name="MinCount" Value="20"></tt:SimpleItem><tt:SimpleItem Name="AlarmOnDelay" Value="1000"></tt:SimpleItem><tt:SimpleItem Name="AlarmOffDelay" Value="1000"></tt:SimpleItem><tt:SimpleItem Name="ActiveCells" Value="zwA="></tt:SimpleItem></tt:Parameters></tt:Rule><tt:Rule Name="Region4" Type="tt:CellMotionDetector"><tt:Parameters><tt:SimpleItem Name="MinCount" Value="20"></tt:SimpleItem><tt:SimpleItem Name="AlarmOnDelay" Value="1000"></tt:SimpleItem><tt:SimpleItem Name="AlarmOffDelay" Value="1000"></tt:SimpleItem><tt:SimpleItem Name="ActiveCells" Value="zwA="></tt:SimpleItem></tt:Parameters></tt:Rule></tt:RuleEngineConfiguration></tt:VideoAnalyticsConfiguration><tt:PTZConfiguration token="PTZ000" MoveRamp="0" PresetRamp="0" PresetTourRamp="0"><tt:Name>PTZ000</tt:Name><tt:UseCount>2</tt:UseCount><tt:NodeToken>PTZ000</tt:NodeToken><tt:DefaultRelativeZoomTranslationSpace>http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace</tt:DefaultRelativeZoomTranslationSpace><tt:DefaultContinuousZoomVelocitySpace>http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace</tt:DefaultContinuousZoomVelocitySpace><tt:DefaultPTZSpeed><tt:Zoom space="http://www.onvif.org/ver10/tptz/ZoomSpaces/ZoomGenericSpeedSpace" x="0.800000"></tt:Zoom></tt:DefaultPTZSpeed><tt:DefaultPTZTimeout>PT10S</tt:DefaultPTZTimeout></tt:PTZConfiguration><tt:MetadataConfiguration token="Metadata001" CompressionType="None" GeoLocation="false"><tt:Name>Metadata001</tt:Name><tt:UseCount>1</tt:UseCount><tt:PTZStatus><tt:Status>false</tt:Status><tt:Position>false</tt:Position></tt:PTZStatus><tt:Events><tt:Filter><wsnt:TopicExpression Dialect="http://www.onvif.org/ver10/tev/topicExpression/ConcreteSet" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tns1="http://www.onvif.org/ver10/topics">tns1:Media/ConfigurationChanged</wsnt:TopicExpression></tt:Filter></tt:Events><tt:Analytics>true</tt:Analytics><tt:Multicast><tt:Address><tt:Type>IPv4</tt:Type><tt:IPv4Address>224.1.2.4</tt:IPv4Address></tt:Address><tt:Port>40016</tt:Port><tt:TTL>64</tt:TTL><tt:AutoStart>false</tt:AutoStart></tt:Multicast><tt:SessionTimeout>PT60S</tt:SessionTimeout></tt:MetadataConfiguration></trt:Profiles></trt:GetProfilesResponse></s:Body></s:Envelope>

Please Help Me out Here.

kalmastenitin avatar Nov 24 '23 08:11 kalmastenitin

@kikimor @GreenLightning Camera is working with windows onvif client

kalmastenitin avatar Nov 24 '23 09:11 kalmastenitin

Yes looks like not stable enough as ONVIF version might be different, and the authentication mechanism might fail. No clue so far..

cedricve avatar Dec 15 '23 14:12 cedricve

@kalmastenitin what is the ONVIF version on both cameras. I do have 2 Hikvisions one with ONVIF 17 (working) and another one ONVIF 19 (not working). My guess is that the authentication being used, changed a bit over the version, making it not able to authenticate.

https://github.com/use-go/onvif/blob/master/Device.go#L282-L284

cedricve avatar Dec 15 '23 16:12 cedricve