ONVIF Client protocol Profile S (Live Streaming) Dart implementation.

This is a wrapper to ONVIF protocol which allows you to get information about your NVT (network video transmitter) device, its media sources, control PTZ (pan-tilt-zoom) movements and manage presets. It will also allow you to get information about your NVR (network video recorder).

pub package Build Status

Getting Started

In your project add the dependency:

dependencies:
  ...
  easy_onvif: ^0.0.14

For help getting started with dart, check out these guides.

Usage Example

Import the easy_onvif library.

import 'package:easy_onvif/onvif.dart';

Connecting to an Onvif device

var onvif =
	Onvif(host: '[your onvif device ip]', username: '[theUser]', password: '[thePassword]');

await onvif.initialize();

Interacting with the device through Onvif operations

Refer to the tables below for the supported operations.

Through the deviceManagement operations you can get information about the connected device.

var deviceInfo = await onvif.deviceManagement.getDeviceInformation();

print(deviceInfo.model);

Many operations require you to supply a profileToken which can be retrieved through media operations.

var profiles = await onvif.media.getProfiles();

profiles.forEach((element) {
	print(element.name + ' ' + element.token);
});

var profileToken = profiles[0].token;

With the ptz operations you can get a list of camera presets from the connected device.

var presets = await onvif.ptz.getPresets(profileToken);

//get a specific preset
var preset = presets[11];

//print the preset values
print(
	'preset: ${preset.position.panTilt?.x}  ${preset.position.panTilt?.y}  ${preset.position.zoom?.x}');

//use the GotoPreset operation to point the camera to the given preset
await onvif.ptz.gotoPreset(profileToken, preset);

Be sure to look through the API Reference for information about the parameters required for the supported Onvif operations.

Supported Onvif Operations

Device Management:

Onvif OperationDart MethodDart Return Type
GetCapabilitiesgetCapabilitiesFuture<Capabilities>
GetDeviceInformationgetDeviceInformationFuture<GetDeviceInformationResponse>
GetHostnamegetHostnameFuture<HostnameInformation>
GetNetworkProtocolsgetNetworkProtocolsFuture<List<NetworkProtocol>>
GetNtpResponsegetNtpResponseFuture<NtpInformation>
GetServicesgetServicesFuture<List<Service>>
GetSystemDateAndTimegetSystemDateAndTimeFuture<SystemDateAndTime>
GetSystemUrisgetSystemUrisFuture<GetSystemUrisResponse>
GetUsersgetUsersFuture<List<User>>

Media:

Onvif OperationDart MethodReturn Type
GetAudioSourcesgetAudioSourcesFuture<AudioSource>
GetProfilesgetProfilesFuture<List<Profile>>
GetSnapshotUrigetSnapshotUriFuture<MediaUri>
GetStreamUrigetStreamUriFuture<MediaUri>
GetVideoSourcesgetVideoSourcesFuture<VideoSources>
StartMulticastStreamingstartMulticastStreamingFuture<void>
StopMulticastStreamingstopMulticastStreamingFuture<void>

PTZ:

Onvif OperationDart MethodReturn Type
AbsoluteMoveabsoluteMoveFuture<void>
ContinuousMovecontinuousMoveFuture<void>
GetConfigurationgetConfigurationFuture<PtzConfiguration>
GetConfigurationsgetConfigurationsFuture<List<PtzConfiguration>>
GetPresetsgetPresetsFuture<List<Preset>>
GetStatusgetStatusFuture<PtzStatus>
GotoPresetgotoPresetFuture<void>
RelativeMoverelativeMoveFuture<void>
RemovePresetremovePresetFuture<void>
SetPresetsetPresetFuture<String>
StopstopFuture<void>

PTZ Helper Methods:

Onvif OperationDart MethodReturn Type
N/AmoveFuture<void>
N/AmoveDownFuture<void>
N/AmoveLeftFuture<void>
N/AmoveRightFuture<void>
N/AmoveUpFuture<void>
N/AzoomInFuture<void>
N/AzoomOutFuture<void>

What's next

Device discovery is planned for the 1.x release of the library.

Libraries

address
analytics
appSequence
audioDecoderConfiguration
audioEncoderConfiguration
audioOutputConfiguration
audioSource
audioSourceConfiguration
audioSourcesResponse
body
bounds
capabilities
capabilitiesResponse
code
configurationResponse
configurationsResponse
date
dateTime
detail
device
deviceInformationResponse
endpointReference
envelope
events
extension
getPresetResponse
h264
hostnameInformation
hostnameResponse
i8nText
media
mediaUri
metadataConfiguration
mpeg4
multicast
networkProtocol
networkProtocolsResponse
new_onvif
ONVIF Client Implementation in Dart
ntp
ntpInformation
ntpResponse
panTilt
panTiltLimits
preset
probeMatch
probeMatches
profile
profilesResponse
ptz
ptzConfiguration
ptzPosition
ptzSpeed
ptzStatus
rateControl
reason
resolution
root
service
servicesResponse
setPresetResponse
space
space1d
space2d
statusResponse
supportedVersion
system
systemDateAndTime
systemDateTimeResponse
systemLogUris
systemUrisResponse
time
timeZone
uriResponse
user
usersResponse
version
videoAnalyticsConfiguration
videoEncoderConfiguration
videoSourceConfiguration
videoSources
videoSourcesResponse
zoom
zoomLimits