Giter Club home page Giter Club logo

onvifcameraandroid's People

Contributors

rvi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

onvifcameraandroid's Issues

Method Not Alloed 405

hey, i imported your demo trying to get my tapo tp link camera to work, i get the error
request failed: GetDeviceInformation Repsonse 405 - Method Not Allowed
url rtsp://192.168.0.34:554
the camera requires username and password which i entered.
the ip address i entered was 192.168.0.34:554 i also tried different versions of this with or without port number for example
any suggestions would be great, thanks.

This is not an issue

I have a question, this method is just used to connect to an ONVIF device but can it change the password or send different commands to the camera?

How to send audio to camera ip?

Hello, I want create app to livestream camera and using speaker of android to talk to camera IP. Please for example how to do it?

Can't Connect Onvif Camera

Hi rvi
i'm work with Onvif camera
with model is NETGEAR VNC4030
i use your project to connect my ip camera
i can get current device but i saw rtspURI = null when i debug
please help me ?
my camera ip is : 10.84.0.129:80
user : admin
password : password
thanks so much

ErrorCode 500, Internal Server Error on getProfiles()

Hello, i am new to this technology. I am getting Internal server error, Error Code is 500. Please help me to resolve this issue. I've gone through documentation it's easy to understand. I am not able to get media profiles and rtsp url also. Please help. Here are the log details.

getServices()

admincMY4zICXTSgiZIMCaLrScottS/A=MjE2ZDM5MzAtYjM5My00MzA0LWFhYzYtNzU2NDBmZGFhNmI5
</wsse:Nonce><wsu:Created>2019-10-16T06:13:000Z</wsu:Created></wsse:UsernameToken></wsse:Security></soap:Header><soap:Body><GetServices xmlns="http://www.onvif.org/ver10/device/wsdl"><IncludeCapability>false</IncludeCapability></GetServices></soap:Body></soap:Envelope>

true
Request GetServices performed.

getDeviceInformation()

adminEhkGLRFAOzgjd/UihGLedGjYvJI=ODBlYzBkYWItNGRlYi00ODI5LWE1ZDAtODNhMTAzMDcyZjZj
</wsse:Nonce><wsu:Created>2019-10-16T06:13:000Z</wsu:Created></wsse:UsernameToken></wsse:Security></soap:Header><soap:Body><GetDeviceInformation xmlns="http://www.onvif.org/ver10/device/wsdl"></GetDeviceInformation></soap:Body></soap:Envelope>	

true
Request GetDeviceInformation performed.
Device information:
Manufacturer: HIKVISION
Model: DS-2CD122P-I3
FirmwareVersion: V5.4.50 build 180602
SerialNumber: DS-2CD122P-I320190604AAWR234641390

getProfiles()

adminTHOWbf+eUm4MBI8xVKMi+taceic=MTNjOGQ1OWItMTZhNC00MDdjLWEzMTgtYTM1MWZjZGQ1NTky
</wsse:Nonce><wsu:Created>2019-10-16T06:13:000Z</wsu:Created></wsse:UsernameToken></wsse:Security></soap:Header><soap:Body><GetProfiles xmlns="http://www.onvif.org/ver10/media/wsdl"/></soap:Body></soap:Envelope>

Response{protocol=http/1.1, code=500, message=Internal Server Error, url=http://ipaddress:port/onvif/device_service}
false
Request GetProfiles performed.

405 - Method Not Allowed

405 - Method Not Allowed,The callback function reports an error when you click to connect the device

Error, make sure your endpoint is correct

hi, the all code works fine, but there is one problem -
it works for 5 to 10 seconds well and I get the video stream, but after this duration, it gives me the error - Error, make sure your endpoint is correct.
and after that, it never gives me the video stream.

this is the log I get when trying to connect the second time after disconnecting in 5second.

EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
W/libEGL: EGLNativeWindowType 0x7ea5df1010 disconnect failed
W/VLC: [0000007ebceda410/48eb] libvlc demux: no data received in 10s. Switching to TCP
D/VLC: [0000007ebcfa0590/48eb] libvlc decoder: killing decoder fourcc h264' [0000007ebcfa0590/48eb] libvlc decoder: removing module "avcodec" D/VLC: [0000007ebcfa0910/48eb] libvlc packetizer: removing module "h264" D/VLC: [0000007ebcfa0c90/48eb] libvlc decoder: killing decoder fourcc mp4a'
[0000007ebcfa0c90/48eb] libvlc decoder: removing module "avcodec"
D/VLC: [0000007ea81ec090/48eb] libvlc input: Program doesn't contain anymore ES
W/VLC: [0000007ebceda410/48eb] libvlc demux: Password in a URI is DEPRECATED
D/VLC: [0000007ebceda410/48eb] libvlc demux: connection error -115

E/VLC: [0000007ebceda410/48eb] libvlc demux: Failed to connect with rtsp://deviceipaddress:554/live/deviceusername_p0_TVFMETBYEDCJ
[0000007ebceda410/48eb] libvlc demux: TCP rollover failed, aborting

D/VLC: [0000007ea81ec090/48eb] libvlc input: EOF reached
D/VLC: [0000007ebceda410/48eb] libvlc demux: removing module "live555"

getServices problem on api26 or higher

Hello folks!
I'm developping an App to stream IP cameras. I'm using the 1.1.8 version of the onvif library (but I also tried the 1.1.6).

When it runs on my Zenfone5 with Android 5 (API 21), I receive the "RESULT: true" followed by the device's profiles. Until here, everything looks fine. When I run it on Android 10 and Android 9, I just receive the "RESULT: false". No messages are returned, by the way. If someone could help, I'll be glad!

class MainActivity : AppCompatActivity(), OnvifListener {

    //var vlcVideoLibrary: VlcVideoLibrary? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        currentDevice = OnvifDevice("192.168.1.100", "admin", "tecnnic2001")
        currentDevice.listener = this
        currentDevice.getServices()
override fun requestPerformed(response: OnvifResponse) {
        Log.d("Aplicativo: ", response.parsingUIMessage)
        
        Log.d("ONVIF", "Request ${response.request.type} performed.")
        Log.d("ONVIF","Succeeded: ${response.success}, message: ${response.parsingUIMessage}")

Here's my log:
image

Library issues both in gradle library and module library

I'm import your module library I got the issues

Error------
Caused by: org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin 'com.github.dcendents.android-maven'.

And then I also try using gradle library ....Not working because can't call specific method from gradle library.
Error ------
Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':app:debugRuntimeClasspath'.

this is my app level of build.gradle.

  plugins {
       id 'com.android.application'
       id 'org.jetbrains.kotlin.android'
      }

android {
namespace 'com.test.cameraip'
compileSdk 33

defaultConfig {
    applicationId "com.test.cameraip"
    minSdk 24
    targetSdk 33
    versionCode 1
    versionName "1.0"

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    vectorDrawables {
        useSupportLibrary true
    }
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
    jvmTarget = '1.8'
}
buildFeatures {
    compose true
}
composeOptions {
    kotlinCompilerExtensionVersion '1.4.3'
}
packaging {
    resources {
        excludes += '/META-INF/{AL2.0,LGPL2.1}'
    }
}
}

 dependencies {

implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.2'
implementation 'androidx.activity:activity-compose:1.8.2'
implementation platform('androidx.compose:compose-bom:2023.03.00')
implementation 'androidx.compose.ui:ui'
implementation 'androidx.compose.ui:ui-graphics'
implementation 'androidx.compose.ui:ui-tooling-preview'
implementation 'androidx.compose.material3:material3'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
androidTestImplementation platform('androidx.compose:compose-bom:2023.03.00')
androidTestImplementation 'androidx.compose.ui:ui-test-junit4'
debugImplementation 'androidx.compose.ui:ui-tooling'
debugImplementation 'androidx.compose.ui:ui-test-manifest'

implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation 'com.rvirin.onvif:onvifcamera:1.1.9'
 }

How to connect local IP camera without internet access?

I had used Tplink camera connect with local IP without internet access. How to connect camera to watch video streaming from camera on local network without internet access. This sdk not supported for local network ? I need help and suggest from you Please help. Thanks

ONVIF PTZ Control

Hi, I have Used this library in one of my android app, do you have any plan to extend the library to support PTZ action.
OR
Can you help me guiding the way to achieve this milestone.
Thanks

Connecting by Serial Number

Hi,

Is it possible to access to ONVIF camera via Serial Number instead of ip using this library? We cannot open ports.

Thanks!!!

Get Profile Request failed

E/ERROR: request failed: GetProfiles
Response: 400 - Bad Request

<s:Envelope xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:d="http://schemas.xmlsoap.org/ws/2005/04/discovery" xmlns:ter="http://www.onvif.org/ver10/error" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wsrf-bf="http://docs.oasis-open.org/wsrf/bf-2">
  <s:Body>
    <s:Fault>
      <s:Code>
        <s:Value>s:Sender</s:Value>
        <s:Subcode>
          <s:Value>ter:NotAuthorized</s:Value>
        </s:Subcode>
      </s:Code>
      <s:Reason>
        <s:Text xml:lang="en">Sender not Authorized. Invalid username or password! You still have 29 attempt(s).</s:Text>
      </s:Reason>
    </s:Fault>
  </s:Body>
</s:Envelope>

Change IP-Camera settings

How to change ip-camera settings like framerate , resolution ... etc , with onvif
Any help please.

401 Unauthorized

Hi, i'm having an issue while using the library version: 1.1.9

I get "HTTP Error: 401 Unauthorized" response while i try to use the getProfile method.
Here is the request and the response i see logged:

------------------REQUEST:-------------------------
URL:
http://192.168.1.167:888/onvif/device_service

Headers:
Content-Type text/xml; charset=utf-8
Authorization Digest username="ad-2020@", realm="realm", nonce="nonce", uri="/onvif/device_service", response="1204fe0080c5377e7c5f99d80e788ff8", cnonce="a1b390a149f9085d64598b75f3a9e0f1", nc=00000001, qop="auth"Digest username="ad-2020@", uri="/onvif/device_service", response="1204fe0080c5377e7c5f99d80e788ff8", cnonce="a1b390a149f9085d64598b75f3a9e0f1", nc=00000001, qop="auth"

Body:

<soap:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://www.w3.org/2003/05/soap-envelope" >
soap:Body

false

</soap:Body>
</soap:Envelope>

------------------------ Response -----------------------------

Header
WWW-Authenticate: Basic realm="gSOAP Web Service"
Server: gSOAP
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 1654
Connection: close

BODY

<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:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
xmlns:wsdd="http://schemas.xmlsoap.org/ws/2005/04/discovery"
xmlns:chan="http://schemas.microsoft.com/ws/2005/02/duplex"
xmlns:wsa5="http://www.w3.org/2005/08/addressing"
xmlns:c14n="http://www.w3.org/2001/10/xml-exc-c14n#"
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://schemas.xmlsoap.org/ws/2005/02/sc"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
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:tt="http://www.onvif.org/ver10/schema"
xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2"
xmlns:wsrfbf="http://docs.oasis-open.org/wsrf/bf-2"
xmlns:wstop="http://docs.oasis-open.org/wsn/t-1"
xmlns:tdn="http://www.onvif.org/ver10/network/wsdl"
xmlns:tds="http://www.onvif.org/ver10/device/wsdl"
xmlns:tptz="http://www.onvif.org/ver20/ptz/wsdl"
xmlns:trt="http://www.onvif.org/ver10/media/wsdl">
SOAP-ENV:Body
SOAP-ENV:Fault
SOAP-ENV:Code
SOAP-ENV:ValueSOAP-ENV:Sender</SOAP-ENV:Value>
</SOAP-ENV:Code>
SOAP-ENV:Reason
<SOAP-ENV:Text xml:lang="en">HTTP Error: 401 Unauthorized</SOAP-ENV:Text>
</SOAP-ENV:Reason>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Missing classes

The following classes could not be found:
- android.support.constraint.ConstraintLayout (    Add constraint-layout library dependency to the project, Fix Build Path, Edit XML, Create Class)
Tip: Try to build the project. Tip: Try to refresh the layout.

request failed: GetServices

I receive this error message when trying to connect to IP Cam:
request failed: GetServices
Response: Unable to resolve host "onvif": No address associated with hostname

what is the problem? I can't resolve what the problem is?

request failed: GetStreamURI

Hi rvi
i'm work with Onvif camera
i use your project to connect my ip camera
and i have this response. Please help.

E/ERROR: request failed: GetStreamURI
Response: 500 - Internal Server Error
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:xs="http://www.w3.org/2000/10/XMLSchema" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:ter="http://www.onvif.org/ver10/error" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wsrf-bf="http://docs.oasis-open.org/wsrf/bf-2" xmlns:wsrf-r="http://docs.oasis-open.org/wsrf/r-2">env:Bodyenv:Faultenv:Codeenv:Valueenv:Sender</env:Value>env:Subcodeenv:Valueter:InvalidArgs</env:Value></env:Subcode></env:Code>env:Reason<env:Text xml:lang="en">Invalid Args</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>

Getting Bad Request Error on GetStreamURI

Hello,

Thanks for sharing an interesting article on Implementing OnVifCamera.
We are using the code and facing a problem while accessing getstreamuri. We are able to get device information, media profiles but it is giving bad request error on getstreamuri.

Please help.

Thanks & Regards
Pankaj

RTSP URI haven't been retrieved

Hello. I tried to build this project, I can see all Device Information with app but when I click on "CONNECT TO CAMERA", it said "RTSP URI haven't been retrieved". Any help?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.