产品中心
软件产品
Onvif SDK(安卓版)
通过ONVIF协议接入到标准NVR设备和兼容Onvif的第三方平台

ONVIF(Open Network Video Interface Forum)协议做为国际开放型网络视频产品标准网络接口协议,已经在安防监控领域普通存在,不管是IPC, NVR, 还是各种监控平台,基本都已经兼容这一国际协议;誉龙ONVIF SDK基于Android平台,通过ONVIF协议无缝接入到标准NVR设备和兼容Onvif的第三方平台,可实现视音频实时推流,并且可以快速集成到智能执法记录仪,智能安全帽,智能行车记录仪,智能手机,以及其它基于Android平台的各种智能终端的系统方案中。


1. 主要支持功能


适用协议:Open Network Video Interface Forum;

支持视频编码格式:H.264/H.265;

支持音频格式:G.711 A、G711U、AAC;

支持音频3A处理;

支持横屏、竖屏推流;

支持媒体流传输协议TCP/UDP匹配设置;

支持设备被发现;

支持设备媒体参数查询应答

支持上报设备信息;

支持设备RTSP推流地址查询应答;

支持抓拍应答;

支持自定义水印叠加;

支持状态反馈;


2. 技术特点和优势


图传自适应网络带宽,延迟低、编码效率高;

全自研封装接口,易于扩展集成,

版本迭代高效,接口功能丰富;

技术支持响应快速,支持业务功能定制;


3. 技术实现线路


 誉龙 ONVIFSDK通过ONVIF 协议接入NVR/Milestone等第三方平台。


image.png


4. ONVIF SDK协议通讯流程


企业微信截图_17135236039343.jpg





应用案例分享:誉龙ONVIF SDK接入海康NVR




近日, 我司技术支持工程师配合客户调试誉龙ONVIF SDK接入海康NVR,与现有IPC监控系统进行融合,实现高清实时图传,信息上报、抓拍、设备管理等业务功能,为客户实时监控系统方案提供了新的思路和方向;该项目的实际应用中,把誉龙ONVIF SDK集成到4G执法记录仪当中,不仅可能通过4G实时传输视音频到执法综合管理平台,同时也可以通过誉龙ONVIF SDK基于WIFI网络连接到海康NVR,实现两个不同系统的复合链路并存的视音频图传方案。


1. 发现设备


<?xml version="1.0" encoding="utf-8"?>
<Envelope
 xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns="http://www.w3.org/2003/05/soap-envelope">
<Header><wsa:MessageID xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">uuid:af495c0c-68c7-4727-865a-06408221ee5b</wsa:MessageID>
<wsa:To xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">urn:schemas-xmlsoap-org:ws:2005:04:discovery</wsa:To><wsa:Action xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
http://schemas.xmlsoap.org/ws/2005/04/discovery/Probe</wsa:Action></Header>
<Body><Probe
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/ws/2005/04/discovery">
<Types>tds:Device</Types><Scopes /></Probe></Body></Envelope>


2. SDK回复


<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" 
 xmlns:xs="http://www.w3.org/2001/XMLSchema"
 xmlns:tt="http://www.onvif.org/ver10/schema"
 xmlns:tds="http://www.onvif.org/ver10/device/wsdl" 
 xmlns:trt="http://www.onvif.org/ver10/media/wsdl" 
 xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl" 
 xmlns:tev="http://www.onvif.org/ver10/events/wsdl"
 xmlns:dn="http://www.onvif.org/ver10/network/wsdl" 
 xmlns:d="http://schemas.xmlsoap.org/ws/2005/04/discovery" 
 xmlns:wsadis="http://schemas.xmlsoap.org/ws/2004/08/addressing" 
 xmlns:wsa="http://www.w3.org/2005/08/addressing"
 xmlns:tas="http://www.onvif.org/ver10/advancedsecurity/wsdl">
 <env:Header><wsadis:MessageID>urn:uuid:00000000</wsadis:MessageID>
<wsadis:RelatesTo>uuid:3454dbae-9a7e-422a-a609-ba7289f1ea00</wsadis:RelatesTo>
<wsadis:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsadis:To>
<wsadis:Action>http://schemas.xmlsoap.org/ws/2005/04/discovery/ProbeMatches</wsadis:Action>
<d:AppSequence InstanceId="1077004800" MessageNumber="2"/>
</env:Header>
<env:Body><d:ProbeMatches><d:ProbeMatch><wsadis:EndpointReference><wsadis:Address>urn:uuid:00000000</wsadis:Address>
</wsadis:EndpointReference>
<d:Types>dn:NetworkVideoTransmitter tds:Device</d:Types>
<d:Scopes>onvif://www.onvif.org/type/video_encoder onvif://www.onvif.org/Profile/Streaming onvif://www.onvif.org/hardware/DSJ-Y66001 onvif://www.onvif.org/name/66001 onvif://www.onvif.org/location/city/shenzhen</d:Scopes>
<d:XAddrs>http://192.168.253.2:8000/onvif/device_service</d:XAddrs>
<d:MetadataVersion>10</d:MetadataVersion>
</d:ProbeMatch>
</d:ProbeMatches>
</env:Body>
</env:Envelope>


3. 获取SDK能力


<?xml
version="1.0"
encoding="utf-8"?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"><s:Header><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><wsse:UsernameToken><wsse:Username>admin</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">LWSDuE6873dWiDbG02xnJwXc19w=</wsse:Password><wsse:Nonce>wh72mMXk0YUYmqVJIMwXRw==</wsse:Nonce><wsu:Created>2024-04-08T02:29:42Z</wsu:Created></wsse:UsernameToken></wsse:Security></s:Header><s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><GetCapabilities xmlns="http://www.onvif.org/ver10/device/wsdl"><Category>Media</Category></GetCapabilities></s:Body></s:Envelope>


4. SDK能力回复


HTTP/1.1 200 OK
Date: Tue, 16 Apr 2024 02:29:44 GMT
Server: YL HTTP Server
Content-Length: 5254
Content-Type: application/soap+xml; charset=utf-8

<?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:wsa5="http://www.w3.org/2005/08/addressing" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
 xmlns:c14n="http://www.w3.org/2001/10/xml-exc-c14n#" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
 xmlns:xmime5="http://www.w3.org/2005/05/xmlmime" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:d="http://schemas.xmlsoap.org/ws/2005/04/discovery" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:wsrf-bf="http://docs.oasis-open.org/wsrf/bf-2" xmlns:wsrf="http://docs.oasis-open.org/wsrf/r-2" xmlns:cpp="http://www.onvif.org/ver10/events/wsdl/CreatePullPointBinding" xmlns:dl="http://www.onvif.org/ver10/network/wsdl/DiscoveryLookupBinding" xmlns:eve="http://www.onvif.org/ver10/events/wsdl/EventBinding" xmlns:nc="http://www.onvif.org/ver10/events/wsdl/NotificationConsumerBinding" xmlns:np="http://www.onvif.org/ver10/events/wsdl/NotificationProducerBinding" xmlns:pp="http://www.onvif.org/ver10/events/wsdl/PullPointBinding" xmlns:pps="http://www.onvif.org/ver10/events/wsdl/PullPointSubscriptionBinding" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:psm="http://www.onvif.org/ver10/events/wsdl/PausableSubscriptionManagerBinding" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:rd="http://www.onvif.org/ver10/network/wsdl/RemoteDiscoveryBinding" xmlns:dn="http://www.onvif.org/ver10/network/wsdl" xmlns:sm="http://www.onvif.org/ver10/events/wsdl/SubscriptionManagerBinding" xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl" xmlns:tmd="http://www.onvif.org/ver10/deviceIO/wsdl" xmlns:tptz="http://www.onvif.org/ver20/ptz/wsdl" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:tns1="http://www.onvif.org/ver10/topics" xmlns:bf2="http://docs.oasis-open.org/wsrf/bf-2" xmlns:ter="http://www.onvif.org/ver10/error">
  <SOAP-ENV:Header>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body>
    <tds:GetCapabilitiesResponse>
      <tds:Capabilities>
        <tt:Device>
          <tt:XAddr>http://192.168.253.2:8000/onvif/device_service</tt:XAddr>
          <tt:Network>
            <tt:IPFilter>false</tt:IPFilter>
            <tt:ZeroConfiguration>false</tt:ZeroConfiguration>
            <tt:IPVersion6>false</tt:IPVersion6>
            <tt:DynDNS>false</tt:DynDNS>
          </tt:Network>
          <tt:System>
            <tt:DiscoveryResolve>true</tt:DiscoveryResolve>
            <tt:DiscoveryBye>true</tt:DiscoveryBye>
            <tt:RemoteDiscovery>false</tt:RemoteDiscovery>
            <tt:SystemBackup>false</tt:SystemBackup>
            <tt:SystemLogging>true</tt:SystemLogging>
            <tt:FirmwareUpgrade>false</tt:FirmwareUpgrade>
            <tt:SupportedVersions>
              <tt:Major>1</tt:Major>
            </tt:SupportedVersions>
          </tt:System>
          <tt:IO>
            <tt:InputConnectors>2</tt:InputConnectors>
            <tt:RelayOutputs>1</tt:RelayOutputs>
          </tt:IO>
          <tt:Security>
            <tt:TLS1.1>false</tt:TLS1.1>
            <tt:TLS1.2>false</tt:TLS1.2>
            <tt:OnboardKeyGeneration>false</tt:OnboardKeyGeneration>
            <tt:AccessPolicyConfig>false</tt:AccessPolicyConfig>
            <tt:X.509Token>false</tt:X.509Token>
            <tt:SAMLToken>false</tt:SAMLToken>
            <tt:KerberosToken>false</tt:KerberosToken>
            <tt:RELToken>false</tt:RELToken>
          </tt:Security>
        </tt:Device>
        <tt:Events>
          <tt:XAddr>http://192.168.253.2:8000/onvif/event_service</tt:XAddr>
          <tt:WSSubscriptionPolicySupport>true</tt:WSSubscriptionPolicySupport>
          <tt:WSPullPointSupport>true</tt:WSPullPointSupport>v=0


5. 获取profile


<?xml 
version="1.0"
 encoding="utf-8"?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"><s:Header><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><wsse:UsernameToken><wsse:Username>admin</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">0PthiDVgSTYt7/6XCYdYDP4ij4o=</wsse:Password><wsse:Nonce>KhcGTQe6eK5A9lnaISplOg==</wsse:Nonce><wsu:Created>2024-04-08T02:32:57Z</wsu:Created></wsse:UsernameToken></wsse:Security></s:Header><s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><GetProfiles xmlns="http://www.onvif.org/ver10/media/wsdl"/></s:Body></s:Envelope>


6. SDK返回profile


HTTP/1.1 200 OK
Date: Tue, 16 Apr 2024 02:32:59 GMT
Server: YL HTTP Server
Content-Length: 5992
Content-Type: application/soap+xml; charset=utf-8

<?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:wsa5="http://www.w3.org/2005/08/addressing" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
 xmlns:c14n="http://www.w3.org/2001/10/xml-exc-c14n#" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
 xmlns:xmime5="http://www.w3.org/2005/05/xmlmime" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:d="http://schemas.xmlsoap.org/ws/2005/04/discovery" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:wsrf-bf="http://docs.oasis-open.org/wsrf/bf-2" xmlns:wsrf="http://docs.oasis-open.org/wsrf/r-2" xmlns:cpp="http://www.onvif.org/ver10/events/wsdl/CreatePullPointBinding" xmlns:dl="http://www.onvif.org/ver10/network/wsdl/DiscoveryLookupBinding" xmlns:eve="http://www.onvif.org/ver10/events/wsdl/EventBinding" xmlns:nc="http://www.onvif.org/ver10/events/wsdl/NotificationConsumerBinding" xmlns:np="http://www.onvif.org/ver10/events/wsdl/NotificationProducerBinding" xmlns:pp="http://www.onvif.org/ver10/events/wsdl/PullPointBinding" xmlns:pps="http://www.onvif.org/ver10/events/wsdl/PullPointSubscriptionBinding" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:psm="http://www.onvif.org/ver10/events/wsdl/PausableSubscriptionManagerBinding"
 xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:rd="http://www.onvif.org/ver10/network/wsdl/RemoteDiscoveryBinding" xmlns:dn="http://www.onvif.org/ver10/network/wsdl" xmlns:sm="http://www.onvif.org/ver10/events/wsdl/SubscriptionManagerBinding" xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl" xmlns:tmd="http://www.onvif.org/ver10/deviceIO/wsdl" xmlns:tptz="http://www.onvif.org/ver20/ptz/wsdl" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:tns1="http://www.onvif.org/ver10/topics" xmlns:bf2="http://docs.oasis-open.org/wsrf/bf-2" xmlns:ter="http://www.onvif.org/ver10/error">
  <SOAP-ENV:Header>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body>
    <trt:GetProfilesResponse>
      <trt:Profiles fixed="true" token="PROFILE_H264_CH0_MAJOR">
        <tt:Name>PROFILE_H264_CH0_MAJOR</tt:Name>
        <tt:VideoSourceConfiguration token="VIDEO_CH0">
          <tt:Name>VIDEO_CH0</tt:Name>
          <tt:UseCount>1</tt:UseCount>
          <tt:SourceToken>VI_CH0</tt:SourceToken>
          <tt:Bounds height="720" width="1280" y="0" x="0">
          </tt:Bounds>
        </tt:VideoSourceConfiguration>
        <tt:AudioSourceConfiguration token="AUDIOSRC_CH0">
          <tt:Name>AUDIOSRC_CH0</tt:Name>
          <tt:UseCount>3</tt:UseCount>
          <tt:SourceToken>AI_CH0</tt:SourceToken>
        </tt:AudioSourceConfiguration>
        <tt:VideoEncoderConfiguration token="H264_MAJOR_CH0">
          <tt:Name>H264_MAJOR_CH0</tt:Name>
          <tt:UseCount>1</tt:UseCount>
          <tt:Encoding>H264</tt:Encoding>
          <tt:Resolution>
            <tt:Width>1280</tt:Width>
            <tt:Height>720</tt:Height>
          </tt:Resolution>
          <tt:Quality>2</tt:Quality>
          <tt:RateControl>
            <tt:FrameRateLimit>25</tt:FrameRateLimit>
            <tt:EncodingInterval>1</tt:EncodingInterval>
            <tt:BitrateLimit>2048</tt:BitrateLimit>
          </tt:RateControl>
          <tt:H264>
            <tt:GovLength>30</tt:GovLength>
            <tt:H264Profile>Baseline</tt:H264Profile>
          </tt:H264>
          <tt:Multicast>
            <tt:Address>
              <tt:Type>IPv4</tt:Type>
              <tt:IPv4Address>0.0.0.0</tt:IPv4Address>
            </tt:Address>
            <tt:Port>0</tt:Port>
            <tt:TTL>300</tt:TTL>
            <tt:AutoStart>false</tt:AutoStart>
          </tt:Multicast>
          <tt:SessionTimeout>PT300S</tt:SessionTimeout>
        </tt:VideoEncoderConfiguration>
        <tt:AudioEncoderConfiguration token="AUDIOENC_CH0">
          <tt:Name>AUDIOENC_CH0</tt:Name>
          <tt:UseCount>1</tt:UseCount>
          <tt:Encoding>AAC</tt:Encoding>
          <tt:Bitrate>32</tt:Bitrate>
          <tt:SampleRate>8</tt:SampleRate>
          <tt:Multicast>
            <tt:Address>
              <tt:Type>IPv4</tt:Type>
              <tt:IPv4Address>0.0.0.0</tt:IPv4Address>
            </tt:Address>
            <tt:Port>0</tt:Port>
            <tt:TTL>300</tt:TTL>
            <tt:AutoStart>false</tt:AutoStart>
          </tt:Multicast>
          <tt:SessionTimeout>PT300S</tt:SessionTimeout>
        </tt:AudioEncoderConfiguration>
        <tt:MetadataConfiguration token="METADATA_CH0">
          <tt:Name>METADATA_CH0</tt:Name>
          <tt:UseCount>1</tt:UseCount>
          <tt:Events>
            <tt:Filter>
              <wsnt:TopicExpression Dialect="http://www.onvif.org/ver10/tev/topicExpression/ConcreteSet">
              </wsnt:TopicExpression>
              <wsnt:MessageContent Dialect="http://www.onvif.org/ver10/tev/messageContentFilter/ItemFilter">
              </wsnt:MessageContent>
            </tt:Filter>
          </tt:Events>
          <tt:Analytics>false</tt:Analytics>
          <tt:Multicast>
            <tt:Address>
              <tt:Type>IPv4</tt:Type>
              <tt:IPv4Address>239.255.255.250</tt:IPv4Address>
            </tt:Address>
            <tt:Port>3702</tt:Port>
            <tt:TTL>60</tt:TTL>
            <tt:AutoStart>false</tt:AutoStart>
          </tt:Multicast>
          <tt:SessionTimeout>PT60S</tt:SessionTimeout>
        </tt:MetadataConfiguration>
      </trt:Profiles>
    </trt:GetProfilesResponse>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>


7. 获取推流地址开始推流


<?xml 
version="1.0" 
encoding="utf-8"?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"><s:Header><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><wsse:UsernameToken><wsse:Username>admin</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">tiYuOAZIrCKLdmQs7+/5zVpbVV8=</wsse:Password><wsse:Nonce>jsi+y3Ltse6a+IUGVtIvAQ==</wsse:Nonce><wsu:Created>2024-04-08T02:34:45Z</wsu:Created></wsse:UsernameToken></wsse:Security></s:Header><s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><GetStreamUri xmlns="http://www.onvif.org/ver10/media/wsdl"><StreamSetup><Stream xmlns="http://www.onvif.org/ver10/schema">RTP-Unicast</Stream><Transport xmlns="http://www.onvif.org/ver10/schema"><Protocol>UDP</Protocol></Transport></StreamSetup><ProfileToken>PROFILE_H264_CH0_MAJOR</ProfileToken></GetStreamUri></s:Body></s:Envelope>


8. SDK返回推流地址


HTTP/1.1 200 OK
Date: Tue, 16 Apr 2024 02:34:46 GMT
Server: YL HTTP Server
Content-Length: 634
Content-Type: application/soap+xml; charset=utf-8

<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope
 xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:tt="http://www.onvif.org/ver10/schema">
  <env:Body>
    <trt:GetStreamUriResponse>
      <trt:MediaUri>
        <tt:Uri>rtsp://192.168.253.2:5554/l/live</tt:Uri>
        <tt:InvalidAfterConnect>false</tt:InvalidAfterConnect>
        <tt:InvalidAfterReboot>false</tt:InvalidAfterReboot>
        <tt:Timeout>PT15S</tt:Timeout>
      </trt:MediaUri>
    </trt:GetStreamUriResponse>
  </env:Body>
</env:Envelope>