View Source ExOnvif.Media2 (ExOnvif v0.7.1)
Interface for making requests to the version 2.0 of Onvif Media Service
Summary
Functions
This operation adds one or more Configurations to an existing media profile.
This operation creates a new media profile.
By default this operation lists all existing audio encoder configurations for a device.
By default this operation lists all existing metadata configurations for a device.
Retrieve the profile with the specified token or all defined media profiles.
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.
This operation returns the available options (supported values and ranges for video encoder configuration parameters) when the video encoder parameters are reconfigured.
By default this operation lists all existing video encoder configurations for a device.
By default this operation lists all existing video source configurations for a device.
This operation modifies an audio encoder configuration.
This operation modifies a video encoder configuration.
Types
Functions
@spec add_configuration(ExOnvif.Device.t(), ExOnvif.Media2.AddConfiguration.t()) :: :ok | {:error, any()}
This operation adds one or more Configurations to an existing media profile.
If a configuration exists in the media profile, it will be replaced. A device shall support adding a compatible Configuration to a Profile containing a VideoSourceConfiguration and shall support streaming video data of such a profile.
@spec create_profile( ExOnvif.Device.t(), String.t(), [%{type: String.t(), token: String.t()}] ) :: {:ok, String.t()} | {:error, any()}
This operation creates a new media profile.
A created profile created via this method may be deleted via the DeleteProfile method. Optionally Configurations
can be assinged to the profile on creation. For details regarding profile assignement check also the method add_configuration/2
.
@spec get_audio_encoder_configurations(Device.t(), encoder_options_opts()) :: {:ok, [ExOnvif.Media.Profile.AudioEncoderConfiguration.t()]} | {:error, any()}
By default this operation lists all existing audio encoder configurations for a device.
Provide a profile token to list only configurations that are compatible with the profile. If a configuration token is provided only a single configuration will be returned.
@spec get_metadata_configurations(Device.t(), encoder_options_opts()) :: {:ok, [ExOnvif.Media.Profile.MetadataConfiguration.t()]} | {:error, any()}
By default this operation lists all existing metadata configurations for a device.
Provide a profile token to list only configurations that are compatible with the profile. If a configuration token is provided only a single configuration will be returned.
@spec get_profiles(Device.t(), token: String.t(), type: [String.t()]) :: {:ok, [ExOnvif.Media2.Profile.t()]} | {:error, map()}
Retrieve the profile with the specified token or all defined media profiles.
- If no Type is provided the returned profiles shall contain no configuration information.
- If a single Type with value 'All' is provided the returned profiles shall include all associated configurations.
- Otherwise the requested list of configurations shall for each profile include the configurations present as Type.
@spec get_service_capabilities(Device.t()) :: {:ok, ExOnvif.Media2.ServiceCapabilities.t()} | {:error, any()}
Returns the capabilities of the media service.
A client uses the GetSnapshotUri command to obtain a JPEG snapshot from the device.
The returned URI shall remain valid indefinitely even if the profile is changed. The URI can be used for acquiring a JPEG image through an 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. The provided image will be updated automatically and independent from calls to GetSnapshotUri.
@spec get_stream_uri(ExOnvif.Device.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 returned URI shall remain valid indefinitely even if the profile is changed.
Defined stream types are
- RtspUnicast RTSP streaming RTP as UDP Unicast.
- RtspMulticast RTSP streaming RTP as UDP Multicast.
- RTSP RTSP streaming RTP over TCP.
- RtspOverHttp Tunneling both the RTSP control channel and the RTP stream over HTTP or HTTPS.
If a multicast stream is requested at least one of VideoEncoder2Configuration, AudioEncoder2Configuration and MetadataConfiguration shall have a valid multicast setting.
@spec get_video_encoder_configuration_options( Device.t(), encoder_options_opts() ) :: {:ok, [ExOnvif.Media2.VideoEncoderConfigurationOption.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.
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.
@spec get_video_encoder_configurations( ExOnvif.Device.t(), encoder_options_opts() ) :: {:ok, [VideoEncoderConfiguration.t()]} | {:error, any()}
By default this operation lists all existing video encoder configurations for a device.
Provide a profile token to list only configurations that are compatible with the profile. If a configuration token is provided only a single configuration will be returned.
@spec get_video_source_configurations(ExOnvif.Device.t(), encoder_options_opts()) :: {:ok, [ExOnvif.Media.Profile.VideoSourceConfiguration.t()]} | {:error, any()}
By default this operation lists all existing video source configurations for a device.
Provide a profile token to list only configurations that are compatible with the profile. If a configuration token is provided only a single configuration will be returned.
@spec set_audio_encoder_configuration( ExOnvif.Device.t(), ExOnvif.Media.Profile.AudioEncoderConfiguration.t() ) :: :ok | {:error, any()}
This operation modifies an audio encoder configuration.
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.
@spec set_video_encoder_configuration( ExOnvif.Device.t(), ExOnvif.Media2.Profile.VideoEncoder.t() ) :: :ok | {:error, any()}
This operation modifies a video encoder configuration.
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.
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.