Onvif (stands for: Open Network Video Interface Forum) is a non-profit with the goal of facilitating the development and use of a global open standard for the interface of physical IP-based security products — Wikipedi a Being able to control your house, open doors, view in real time your living room, control the lights is a childhood dream! I was really delighted to develop an app and a pod to ease the development of ONVIF iOS apps. ONVIF goal is to standardise how IP products (video surveillance cameras, alarms, doors, audio recorders…) communicate with each others. They created some specifications manufacturers have to conform to be compliant with ONVIF. The goal behind these specifications is to standardise how to connect to these products, for instance if you develop an app for streaming video from an ONVIF camera, it should work with every ONVIF camera. Try it! If you just want to try the demo project, open a terminal and run pod try ONVIFCameraYou will be able to login on every ONVIF camera and view its live stream: How to connect to a camera and visualise its live stream on iOS? 👨🏽💻 Create a new project on Xcode In your terminal type: pod init Add to your and run pod `ONVIFCamera` Podfile pod install Once it’s done, you can add the following code to connect to the camera and retrieve its information: camera = (with: , credential: (login: , password: )) camera.getServices { camera.getCameraInformation(callback: { (camera) (camera.manufacturer) (camera.model) }) { (error) ( ) } } let ONVIFCamera "IP_ADDRESS:PORT" "admin" "password" in print print in print "Couldn't connect to camera: \(error)" Getting camera informations Calling before getting the information is not mandatory but strongly recommended. It retrieves the different paths depending on the web service you’re calling, from one camera to another it can change. For instance command will have this path on a Dahua camera whereas it will be on a Uniview camera. Note: getServices getProfiles /onvif/media2_service /onvif/media2 If you implement new web services call in your app, you need to parse their path in this call. To be able to see the live stream of the camera we need to retrieve the different profiles (media profiles, with different configurations available) from the camera, select the one we want to play and retrieve the corresponding stream URI. Here is how we retrieve the profiles and the stream URI: camera.getProfiles(profiles: { (profiles) -> () profiles. > { .camera.getStreamURI(with: profiles.last!.token, uri: { (uri) .playURI(uri: uri) }) } }) in if count 0 self in self Getting the stream URI Depending on your camera, your URI will look like this one: etc... rtsp://IP_ADDRESS:PORT/cam/realmonitor?channel=1 The URI does not follow the protocol, but the protocol, which is normal because ( eal ime treaming rotocol) is aiming to make streaming simpler. The problem is, doesn’t handle RTSP. Fortunately, comes to the rescue! http rtsp RTSP R T S P AVPlayer VLC How to read a RTSP stream on iOS? 🎥 Add the pod to your and run MobileVLCKit Podfile pod install After adding VLC as a pod, your project shouldn’t link anymore. On my side, I have 78 link errors. To fix it, simply add an Objective-C++ file (for instance ) forVLCLink.mm Once your project is compiling you can import in your bridging header. MobileVLCKit Here is how you play the video with once you have the rtsp URI: MobileVLCKit mediaPlayer = () { mediaPlayer.drawable = .movieView url = (string: uri) media = (url: url) mediaPlayer.media = media mediaPlayer.play() } let VLCMediaPlayer func playURI (uri: String) self let URL let VLCMedia Playing RTSP stream with VLC You can also insert the login and password in the rtsp uri like this: etc.. . If you use the pod, the URI saved in already contains the login and password. Tip : rtsp:// login:password @IP_ADDRESS:PORT/cam/realmonitor?channel=1 ONVIFCamera ONVIFCamera.streamURI If you want to learn how to create the same project on , you can read . Android this article Creating an ONVIF library was a exciting opportunity, as you can see in my , I really enjoy having an interaction between my iOS apps and hardware devices, whether it’s a printer for iPhone, a camera, or even a door! I’m really looking forward to test new ONVIF devices and develop apps that can be useful for everyone that has ONVIF devices. previous posts The code of this project is open source, you can download it on . Github If you have any question, I’ll be happy to read them in the comments!