Coder Social home page Coder Social logo

rvi / onvifcamera Goto Github PK

View Code? Open in Web Editor NEW
87.0 87.0 18.0 3.06 MB

Pod and example on how to connect to an ONVIF camera

License: MIT License

Swift 53.42% Objective-C 42.65% Ruby 3.93%
camera ios onvif onvif-camera rtsp rtsp-player streaming streaming-video swift

onvifcamera's People

Contributors

mohamed-arradi avatar robvandenboogaard avatar 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

onvifcamera's Issues

Can not view camera view

We have purchased the SOAP key for iOS and set it into the Demo code. When we run the app in simulator or in device it's not load the camera. please see the attached images.

Simulator Screen Shot - iPhone 11 Pro Max - 2021-07-21 at 22 27 47
Simulator Screen Shot - iPhone 11 Pro Max - 2021-07-21 at 22 27 42

The maximum number of apps for free development profiles has been reached

Details

Unable to install "BootUp_ONVIF"
Domain: com.apple.dtdevicekit
Code: -402620383

App installation failed
Domain: com.apple.dtdevicekit
Code: -402620383
Failure Reason: The maximum number of apps for free development profiles has been reached.
User Info: {
DVTRadarComponentKey = 487927;
"com.apple.dtdevicekit.stacktrace" = (
0 DTDeviceKitBase 0x000000011fcd46e7 DTDKCreateNSError + 109
1 DTDeviceKitBase 0x000000011fcd4de9 DTDK_AMDErrorToNSError + 792
2 DTDeviceKitBase 0x000000011fd1456a __90-[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:]_block_invoke + 164
3 DVTFoundation 0x000000010774ac12 DVTInvokeWithStrongOwnership + 73
4 DTDeviceKitBase 0x000000011fd14301 -[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:] + 1589
5 IDEiOSSupportCore 0x000000011fb9ca25 __118-[DVTiOSDevice(DVTiPhoneApplicationInstallation) processAppInstallSet:appUninstallSet:installOptions:completionBlock:]_block_invoke.352 + 4523
6 DVTFoundation 0x000000010787be7a DVT_CALLING_CLIENT_BLOCK + 7
7 DVTFoundation 0x000000010787d552 __DVTDispatchAsync_block_invoke + 809
8 libdispatch.dylib 0x00007fff73553583 _dispatch_call_block_and_release + 12
9 libdispatch.dylib 0x00007fff7355450e _dispatch_client_callout + 8
10 libdispatch.dylib 0x00007fff73559ace _dispatch_lane_serial_drain + 597
11 libdispatch.dylib 0x00007fff7355a452 _dispatch_lane_invoke + 363
12 libdispatch.dylib 0x00007fff73563a9e _dispatch_workloop_worker_thread + 598
13 libsystem_pthread.dylib 0x00007fff737ae6fc _pthread_wqthread + 290
14 libsystem_pthread.dylib 0x00007fff737ad827 start_wqthread + 15
);
}

Cannot getprofiles when connecting to hikvision

I try to connect to Hikvision Camera. I get this problem:

Can't connect to the camera for an unknow reason. Status code: 500
SOAP REQUEST: Optional("http://www.onvif.org/ver20/media/wsdl/GetProfiles")
response: Optional([AnyHashable("Body"): {
Fault = {
Code = {
Subcode = {
Subcode = {
Value = {
attributes = {
};
value = "ter:InvalidOperation";
};
attributes = {
};
};
Value = {
attributes = {
};
value = "ter:ActionNotSupported";
};
attributes = {
};
};
Value = {
attributes = {
};
value = "env:Receiver";
};
attributes = {
};
};
Reason = {
Text = {
attributes = {
lang = en;
};
value = "Optional Action Not Implemented";
};
attributes = {
};
};
attributes = {
};
};
attributes = {
};
}])

Plz help me. Thanks

Authentication issue ..

Hi,
there is a problem with soap authentication despite I insert the right username e password. The soap response is that I'm not authorized. I suspect that the latest ONVIF specs have changed the authentication type so not plain text. Any suggestion ?

thanks
Leo

UsernameToken

Hi, would it be possible to add usernameToken to the header of the XML/SOAP envelope for the onvif client library? it would really help us.

can not get streamURI

Hello. Im using OnVif to get local camera stream uri
First sorry for my silly question. but i dont know why I can not get streamUri for profile. First i got 3 profile like below:

[ONVIFCamera.ONVIFCamera.Profile(name: "MediaProfile_Channel1_MainStream", token: "MediaProfile000"), ONVIFCamera.ONVIFCamera.Profile(name: "MediaProfile_Channel1_SubStream1", token: "MediaProfile001"), ONVIFCamera.ONVIFCamera.Profile(name: "mcMediaProfile", token: "mcMediaProfile")]

But none of these can used to get streamUri, here is the log:

getStreamURI: ["Body": {
    Fault =     {
        Code =         {
            Value = "s:Sender";
        };
        Reason =         {
            Text = "Unknown Error";
        };
    };
}]

Then here is code to get streamURI:

let params = ["Protocol": "RTSP", "ProfileToken": token]

    performRequest(request: CameraRequest.getStreamURI(params: params), response: { (result) in
        print("getStreamURI: \(result)")
      guard let body = result["Body"] as? [String: Any],
        let response = body["GetStreamUriResponse"]  as? [String: Any],
        let mediaReceived = response["MediaUri"] as? [String: Any],
        let uriReceived = mediaReceived["Uri"] as? String else {
            uri(nil)
            return
        }

      self.streamURI = self.appendCredentialsToStreamURI(uri: uriReceived)
      self.state = .ReadyToPlay
      uri(uriReceived)
    })

Objective C Example for ONVIFCamera pod

I'm trying to use this pod in an Objective C project that covers tvOS and iPadOS, however I can't seem to figure out how to import the correct headers. After configuring the Pod I then try to import the headers:

Screenshot 2020-05-30 at 09 50 18

These are the only 2 it offers, and even after importing both, I still cannot use the "ONVIFCamera" type.

Screenshot 2020-05-30 at 09 57 21

Once I can overcome this I'm reasonably sure I can translate the Swift example in to objective C, I just can't seem to get over the first hurdle.

Do you have an Objective C sample project you could add, or give me some pointers as to how I can import the pod so its usable?

Many Thanks

Plasma

How can I access ip camera feed remotely

Hello,

I was able to stream my camera locally successfully .
Now , how can I stream it remotely when I am not connected to local network ?
I tried few tutorials but no luck .
Note: I would like to stream through owned server or bought server but can you suggest camera which is compatible with the library!!

Many thanks.

Sable iOS app not working

Hi , I am trying to stream ip camera of HIKVISION brand - having user name and password in my iOS app (ONVIFCamera_Example - sample app) but it gives me below error

2023-04-14 12:00:22.466160+0530 ONVIFCamera_Example[6703:151526] Initializing SOAPEngine v.1.41
2023-04-14 12:00:22.640030+0530 ONVIFCamera_Example[6703:151525] Connection 1: received failure notification
2023-04-14 12:00:22.640221+0530 ONVIFCamera_Example[6703:151525] Connection 1: failed to connect 12:8, reason -1
2023-04-14 12:00:22.640319+0530 ONVIFCamera_Example[6703:151525] Connection 1: encountered error(12:8)
2023-04-14 12:00:22.641550+0530 ONVIFCamera_Example[6703:151525] Task <596E52E1-4CA5-4C23-BEA1-3343AF1203F4>.<1> HTTP load failed, 0/0 bytes (error code: -1003 [12:8])
2023-04-14 12:00:22.667207+0530 ONVIFCamera_Example[6703:151527] Task <596E52E1-4CA5-4C23-BEA1-3343AF1203F4>.<1> finished with error [-1003] Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found." UserInfo={_kCFStreamErrorCodeKey=8, NSUnderlyingError=0x60000114eca0 {Error Domain=kCFErrorDomainCFNetwork Code=-1003 "(null)" UserInfo={_NSURLErrorNWPathKey=satisfied (Path is satisfied), interface: en0[802.11], _kCFStreamErrorCodeKey=8, _kCFStreamErrorDomainKey=12}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <596E52E1-4CA5-4C23-BEA1-3343AF1203F4>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <596E52E1-4CA5-4C23-BEA1-3343AF1203F4>.<1>"
), NSLocalizedDescription=A server with the specified hostname could not be found., NSErrorFailingURLStringKey=http://rtsp://10.1.5/Streaming/Channels/102/?transportmode=unicast, NSErrorFailingURLKey=http://rtsp://10.1.5/Streaming/Channels/102/?transportmode=unicast, _kCFStreamErrorDomainKey=12}
Thread Performance Checker: Thread running at QOS_CLASS_USER_INITIATED waiting on a lower QoS thread running at QOS_CLASS_BACKGROUND. Investigate ways to avoid priority inversions
PID: 6703, TID: 151526
Backtrace

3 ONVIFCamera 0x0000000103c4c46d $s11ONVIFCamera14RealmRetrieverV4post33_DE5EB60F985AC4C6AD2B2B3032CD348ELL9urlStringSSSgSS_tF + 893
4 ONVIFCamera 0x0000000103c4c0e8 $s11ONVIFCamera14RealmRetrieverV5realm3forSSSgSS_tF + 40
5 ONVIFCamera 0x0000000103c472da $s11ONVIFCameraAAC14performRequest33_34D2AA8442435CFEE8408E0CFD5F02EFLL7request8response5erroryAA06CameraC0O_ySDySSypGcySScSgtFyycfU_ + 1354
6 ONVIFCamera 0x0000000103c48fd8 $sIeg_IeyB_TR + 40
7 libdispatch.dylib 0x0000000103ddfd18 _dispatch_call_block_and_release + 12
8 libdispatch.dylib 0x0000000103de0f5b _dispatch_client_callout + 8
9 libdispatch.dylib 0x0000000103de3a28 _dispatch_queue_override_invoke + 1488
10 libdispatch.dylib 0x0000000103df5e77 _dispatch_root_queue_drain + 414
11 libdispatch.dylib 0x0000000103df6b17 _dispatch_worker_thread2 + 278
12 libsystem_pthread.dylib 0x00007ff836172c9d _pthread_wqthread + 256
13 libsystem_pthread.dylib 0x00007ff836171c67 start_wqthread + 15
2023-04-14 12:00:22.679073+0530 ONVIFCamera_Example[6703:151525] Connection 2: received failure notification
2023-04-14 12:00:22.679238+0530 ONVIFCamera_Example[6703:151525] Connection 2: failed to connect 12:8, reason -1
2023-04-14 12:00:22.679358+0530 ONVIFCamera_Example[6703:151525] Connection 2: encountered error(12:8)
2023-04-14 12:00:22.680313+0530 ONVIFCamera_Example[6703:151525] Task <04E3D680-E56D-4937-BC2A-E759F648EAFF>.<0> HTTP load failed, 0/0 bytes (error code: -1003 [12:8])
2023-04-14 12:00:22.680478+0530 ONVIFCamera_Example[6703:151527] NSURLConnection finished with error - code -1003
2023-04-14 12:00:22.680827+0530 ONVIFCamera_Example[6703:151526] SOAPEngine connection fail! - A server with the specified hostname could not be found. http://rtsp://10.1.5/Streaming/Channels/102/?transportmode=unicast/onvif/device_service
Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found." UserInfo={NSUnderlyingError=0x6000011406c0 {Error Domain=kCFErrorDomainCFNetwork Code=-1003 "A server with the specified hostname could not be found." UserInfo={NSLocalizedDescription=A server with the specified hostname could not be found., NSErrorFailingURLStringKey=http://rtsp://10.1./Streaming/Channels/102/?transportmode=unicast/onvif/device_service, _kCFStreamErrorDomainKey=12, _kCFStreamErrorCodeKey=8, NSErrorFailingURLKey=http://rtsp://10.1.5/Streaming/Channels/102/?transportmode=unicast/onvif/device_service, _NSURLErrorNWPathKey=satisfied (Path is satisfied), interface: en0[802.11]}}, NSErrorFailingURLStringKey=http://rtsp://10.1.5/Streaming/Channels/102/?transportmode=unicast/onvif/device_service, NSErrorFailingURLKey=http://rtsp://10.1.5/Streaming/Channels/102/?transportmode=unicast/onvif/device_service, _kCFStreamErrorDomainKey=12, _kCFStreamErrorCodeKey=8, NSLocalizedDescription=A server with the specified hostname could not be found.}
SOAP REQUEST: http://www.onvif.org/ver10/device/wsdl/GetServices

I tried replacing with YouTube live video link but its also not working - so I guess the issue might be because - WE DONT HAVE LICENSED SOAP ENGINE KEY.

So please let me know if we buy the key - will it work OR can you provide some sample key to atleast work in simulator ?

Issue after importing ONVIFCAMERA

I get an error "soapengine.h" file not found and Could not build Objective-C module 'ONVIFCamera'.

Please suggest solution for this using Xcode 11.2

SOAPEngine licence key

Dear author,

I'd like to use ONVIFCamera for my study but I'm encountering a problem of SOAPEngine licence key on my real iPhone. How can I bypass this? Or please instruct me parse the XML yourself like it has been done on the Android project. on iOS
I dont know what the meaning of parse the XML in this context.

Thank you very much

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.