onvifcamera

An android library to interact with ONVIF cameras.

License

License

MIT
GroupId

GroupId

com.seanproctor
ArtifactId

ArtifactId

onvifcamera
Last Version

Last Version

1.3.1
Release Date

Release Date

Type

Type

aar
Description

Description

onvifcamera
An android library to interact with ONVIF cameras.
Project URL

Project URL

https://github.com/sproctor/ONVIFCameraAndroid

Download onvifcamera

How to add to project

<!-- https://jarcasting.com/artifacts/com.seanproctor/onvifcamera/ -->
<dependency>
    <groupId>com.seanproctor</groupId>
    <artifactId>onvifcamera</artifactId>
    <version>1.3.1</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/com.seanproctor/onvifcamera/
implementation 'com.seanproctor:onvifcamera:1.3.1'
// https://jarcasting.com/artifacts/com.seanproctor/onvifcamera/
implementation ("com.seanproctor:onvifcamera:1.3.1")
'com.seanproctor:onvifcamera:aar:1.3.1'
<dependency org="com.seanproctor" name="onvifcamera" rev="1.3.1">
  <artifact name="onvifcamera" type="aar" />
</dependency>
@Grapes(
@Grab(group='com.seanproctor', module='onvifcamera', version='1.3.1')
)
libraryDependencies += "com.seanproctor" % "onvifcamera" % "1.3.1"
[com.seanproctor/onvifcamera "1.3.1"]

Dependencies

compile (5)

Group / Artifact Type Version
com.squareup.okhttp3 : okhttp jar 4.9.1
com.squareup.okhttp3 : logging-interceptor jar 4.9.1
io.github.rburgst : okhttp-digest jar 2.5
org.jetbrains.kotlin : kotlin-stdlib-jdk8 jar 1.4.30
org.jetbrains.kotlinx : kotlinx-coroutines-android jar 1.4.3

Project Modules

There are no modules declared in this project.

ONVIFCameraAndroid

Example on how to connect to an ONVIF camera on Android, and dependency to ease the development of an ONVIF Android app.

Install with Gradle (must have mavenCentral in repositories):

implementation 'com.seanproctor:onvifcamera:1.3.1'

Connect to an Onvif camera and information

val device = OnvifDevice.requestDevice("IP_ADDRESS:PORT", "login", "pwd")
val deviceInfo = device.getDeviceInformation()

Retrieve the stream URI

val device = OnvifDevice.requestDevice("IP_ADDRESS:PORT", "login", "pwd")

// Get media profiles to find which ones are streams/snapshots
val profiles = device.getProfiles()

val streamUri = profiles.firstOrNull { it.canStream() }?.let {
    device.getStreamURI(it, addCredentials = true)
}
val snapshotUri = profiles.firstOrNull { it.canSnapshot() }?.let { 
    device.getSnapshotURI(it)
}

Versions

Version
1.3.1
1.3.0