View Source ExOnvif.Media (ExOnvif v0.7.1)

Interface for making requests to the 1.0 version of Onvif Media Service

https://www.onvif.org/ver10/media/wsdl/media.wsdl

Summary

Functions

Create the OSD.

Delete the OSD with the provided token.

This operation returns the available options (supported values and ranges for audio encoder configuration parameters) when the audio encoder parameters are reconfigured.

The GetAudioEncoderConfiguration command fetches the encoder configuration if the audio encoder configuration token is known.

Get OSD by token.

Get profile by token.

Get existing media profiles of a device.

Returns the capabilities of the media service.

A client uses the GetSnapshotUri command to obtain a JPEG snapshot from the device.

This operation requests a URI that can be used to initiate a live media stream using RTSP as the control protocol.

If the video encoder configuration token is already known, the encoder configuration can be fetched through the GetVideoEncoderConfiguration command.

This operation returns the available options (supported values and ranges for video encoder configuration parameters) when the video encoder parameters are reconfigured.

This operation modifies an audio encoder configuration.

Set the OSD

This operation modifies a video encoder configuration.

Types

encoder_options_opts()

@type encoder_options_opts() :: [
  configuration_token: String.t(),
  profile_token: String.t()
]

Functions

create_osd(device, osd)

@spec create_osd(ExOnvif.Device.t(), ExOnvif.Media.OSD.t()) ::
  {:ok, String.t()} | {:error, any()}

Create the OSD.

delete_osd(device, token)

@spec delete_osd(ExOnvif.Device.t(), String.t()) :: :ok | {:error, any()}

Delete the OSD with the provided token.

get_audio_configuration_options(device, opts \\ [])

@spec get_audio_configuration_options(ExOnvif.Device.t(), encoder_options_opts()) ::
  {:ok, ExOnvif.Media.AudioEncoderConfigurationOptions.t()} | {:error, any()}

This operation returns the available options (supported values and ranges for audio encoder configuration parameters) when the audio encoder parameters are reconfigured.

get_audio_encoder_configuration(device, config_token)

@spec get_audio_encoder_configuration(ExOnvif.Device.t(), String.t()) ::
  {:ok, ExOnvif.Media.Profile.AudioEncoderConfiguration.t()} | {:error, any()}

The GetAudioEncoderConfiguration command fetches the encoder configuration if the audio encoder configuration token is known.

get_osd(device, token)

@spec get_osd(ExOnvif.Device.t(), String.t()) ::
  {:ok, ExOnvif.Media.OSD.t()} | {:error, any()}

Get OSD by token.

get_osd_options(device, token \\ nil)

@spec get_osd_options(ExOnvif.Device.t(), String.t() | nil) ::
  {:ok, ExOnvif.Media.OSDOptions.t()} | {:error, any()}

Get the OSD Options.

get_osds(device, configuration_token \\ nil)

@spec get_osds(ExOnvif.Device.t(), String.t() | nil) ::
  {:ok, [ExOnvif.Media.OSD.t()]} | {:error, any()}

Get the OSDs.

get_profile(device, token)

@spec get_profile(ExOnvif.Device.t(), String.t()) ::
  {:ok, ExOnvif.Media.Profile.t()} | {:error, any()}

Get profile by token.

get_profiles(device)

@spec get_profiles(ExOnvif.Device.t()) ::
  {:ok, [ExOnvif.Media.Profile.t()]} | {:error, any()}

Get existing media profiles of a device.

Pre-configured or dynamically configured profiles can be retrieved using this command. This command lists all configured profiles in a device. The client does not need to know the media profile in order to use the command.

get_service_capabilities(device)

@spec get_service_capabilities(ExOnvif.Device.t()) ::
  {:ok, ExOnvif.Media.ServiceCapabilities.t()} | {:error, any()}

Returns the capabilities of the media service.

get_snapshot_uri(device, profile_token)

@spec get_snapshot_uri(ExOnvif.Device.t(), String.t()) ::
  {:ok, String.t()} | {:error, any()}

A client uses the GetSnapshotUri command to obtain a JPEG snapshot from the device.

The URI can be used for acquiring a JPEG image through a HTTP GET operation. The image encoding will always be JPEG regardless of the encoding setting in the media profile. The Jpeg settings (like resolution or quality) may be taken from the profile if suitable.

get_stream_uri(device, profile_token, stream \\ "RTP-Unicast", transport_protocol \\ "UDP")

@spec get_stream_uri(ExOnvif.Device.t(), String.t(), String.t(), String.t()) ::
  {:ok, String.t()} | {:error, any()}

This operation requests a URI that can be used to initiate a live media stream using RTSP as the control protocol.

The correct syntax for the StreamSetup element for these media stream setups defined in 5.1.1 of the streaming specification are as follows:

  • RTP unicast over UDP: StreamType = "RTP_unicast", TransportProtocol = "UDP"
  • RTP over RTSP over HTTP over TCP: StreamType = "RTP_unicast", TransportProtocol = "HTTP"
  • RTP over RTSP over TCP: StreamType = "RTP_unicast", TransportProtocol = "RTSP"

If a multicast stream is requested at least one of VideoEncoderConfiguration, AudioEncoderConfiguration and MetadataConfiguration shall have a valid multicast setting.

get_video_encoder_configuration(device, config_token)

@spec get_video_encoder_configuration(ExOnvif.Device.t(), String.t()) ::
  {:ok, ExOnvif.Media.Profile.VideoEncoderConfiguration.t()} | {:error, any()}

If the video encoder configuration token is already known, the encoder configuration can be fetched through the GetVideoEncoderConfiguration command.

get_video_encoder_configuration_options(device, opts \\ [])

@spec get_video_encoder_configuration_options(
  ExOnvif.Device.t(),
  encoder_options_opts()
) ::
  {:ok, [ExOnvif.Media.VideoEncoderConfigurationOptions.t()]} | {:error, any()}

This operation returns the available options (supported values and ranges for video encoder configuration parameters) when the video encoder parameters are reconfigured.

For JPEG, MPEG4 and H264 extension elements have been defined that provide additional information. A device must provide the XxxOption information for all encodings supported and should additionally provide the corresponding XxxOption2 information.

This response contains the available video encoder configuration options. If a video encoder configuration is specified, the options shall concern that particular configuration. If a media profile is specified, the options shall be compatible with that media profile. If no tokens are specified, the options shall be considered generic for the device.

set_audio_encoder_configuration(device, encoder_config)

@spec set_audio_encoder_configuration(
  ExOnvif.Device.t(),
  ExOnvif.Media.Profile.AudioEncoderConfiguration.t()
) :: :ok | {:error, any()}

This operation modifies an audio encoder configuration.

The ForcePersistence flag indicates if the changes shall remain after reboot of the device. Running streams using this configuration may be immediately updated according to the new settings. The changes are not guaranteed to take effect unless the client requests a new stream URI and restarts any affected streams. NVC methods for changing a running stream are out of scope for this specification.

set_osd(device, osd)

@spec set_osd(ExOnvif.Device.t(), ExOnvif.Media.OSD.t()) :: :ok | {:error, any()}

Set the OSD

set_video_encoder_configuration(device, encoder_config)

@spec set_video_encoder_configuration(
  ExOnvif.Device.t(),
  ExOnvif.Media.Profile.VideoEncoderConfiguration.t()
) :: :ok | {:error, any()}

This operation modifies a video encoder configuration.

The ForcePersistence flag indicates if the changes shall remain after reboot of the device. Changes in the Multicast settings shall always be persistent. Running streams using this configuration may be immediately updated according to the new settings. The changes are not guaranteed to take effect unless the client requests a new stream URI and restarts any affected stream. NVC methods for changing a running stream are out of scope for this specification.

SessionTimeout is provided as a hint for keeping rtsp session by a device. If necessary the device may adapt parameter values for SessionTimeout elements without returning an error. For the time between keep alive calls the client shall adhere to the timeout value signaled via RTSP.