Skip to content

Media2

Media2 service implementation.

Media2

Bases: ONVIFService

Media2 service client.

Property Details
First introduced ONVIF Release 2.61 (December 2015)
Binding name Media2Binding (ver20/media/wsdl/media.wsdl)
Operations media.wsdl
Specification Media2.xml

GetServiceCapabilities()

Returns the capabilities of the media service.

The result is returned in a typed answer.

CreateProfile(Name, Configuration=None)

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 AddConfiguration.

GetProfiles(Token=None, Type=None)

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.

AddConfiguration(ProfileToken, Name=None, Configuration=None)

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.

Note that OSD elements must be added via the CreateOSD command.

RemoveConfiguration(ProfileToken, Configuration)

This operation removes the listed configurations from an existing media profile.

If the media profile does not contain one of the listed configurations that item shall be ignored.

DeleteProfile(Token)

This operation deletes a profile.

Deletion of a profile is only possible for non-fixed profiles

GetVideoSourceConfigurations(ConfigurationToken=None, ProfileToken=None)

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.

GetVideoEncoderConfigurations(ConfigurationToken=None, ProfileToken=None)

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.

GetAudioSourceConfigurations(ConfigurationToken=None, ProfileToken=None)

By default this operation lists all existing audio 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.

GetAudioEncoderConfigurations(ConfigurationToken=None, ProfileToken=None)

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.

GetAnalyticsConfigurations(ConfigurationToken=None, ProfileToken=None)

By default this operation lists all existing video analytics 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.

GetMetadataConfigurations(ConfigurationToken=None, ProfileToken=None)

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.

GetAudioOutputConfigurations(ConfigurationToken=None, ProfileToken=None)

By default this operation lists all existing audio output 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.

GetAudioDecoderConfigurations(ConfigurationToken=None, ProfileToken=None)

By default this operation lists all existing audio decoder 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.

SetVideoSourceConfiguration(Configuration)

This operation modifies a video source 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. NVC methods for changing a running stream are out of scope for this specification.

SetVideoEncoderConfiguration(Configuration)

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. 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.

SetAudioSourceConfiguration(Configuration)

This operation modifies an audio source 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 NVC methods for changing a running stream are out of scope for this specification.

SetAudioEncoderConfiguration(Configuration)

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. NVC methods for changing a running stream are out of scope for this specification.

SetMetadataConfiguration(Configuration)

This operation modifies a metadata configuration.

Running streams using this configuration may be updated immediately 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.

SetAudioOutputConfiguration(Configuration)

This operation modifies an audio output configuration.

SetAudioDecoderConfiguration(Configuration)

This operation modifies an audio decoder configuration.

SetEQPreset(Configuration)

This command is to configure Audio EQPreset.

GetVideoSourceConfigurationOptions(ConfigurationToken=None, ProfileToken=None)

This operation returns the available options (supported values and ranges for video source configuration parameters) when the video source parameters are reconfigured If a video source 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.

GetVideoEncoderConfigurationOptions(ConfigurationToken=None, ProfileToken=None)

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.

GetAudioSourceConfigurationOptions(ConfigurationToken=None, ProfileToken=None)

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

If an audio source 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.

GetAudioEncoderConfigurationOptions(ConfigurationToken=None, ProfileToken=None)

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

GetMetadataConfigurationOptions(ConfigurationToken=None, ProfileToken=None)

This operation returns the available options (supported values and ranges for metadata configuration parameters) for changing the metadata configuration.

GetAudioOutputConfigurationOptions(ConfigurationToken=None, ProfileToken=None)

This operation returns the available options (supported values and ranges for audio output configuration parameters) for configuring an audio output.

To retrieve the EQPresetList, a valid ConfigurationToken must be provided. If EQPreset is supported and isFrequencyDecibelEditable is signaled as true, the response shall include the FrequencyDecibelPair.

GetAudioDecoderConfigurationOptions(ConfigurationToken=None, ProfileToken=None)

This command list the audio decoding capabilities for a given profile and configuration of a device.

GetVideoEncoderInstances(ConfigurationToken)

The GetVideoEncoderInstances command can be used to request the minimum number of guaranteed video encoder instances (applications) per Video Source Configuration.

GetStreamUri(Protocol, ProfileToken)

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.
  • RtspsUnicast Secure RTSP streaming with SRTP as UDP Unicast.
  • RtspsMulticast Secure RTSP streaming with SRTP 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.

For full compatibility with other ONVIF services a device should not generate Uris longer than 128 octets.

StartMulticastStreaming(ProfileToken)

This command starts multicast streaming using a specified media profile of a device.

Streaming continues until StopMulticastStreaming is called for the same Profile. The streaming shall continue after a reboot of the device until a StopMulticastStreaming request is received. The multicast address, port and TTL are configured in the VideoEncoderConfiguration, AudioEncoderConfiguration and MetadataConfiguration respectively.

StopMulticastStreaming(ProfileToken)

This command stops multicast streaming using a specified media profile of a device.

SetSynchronizationPoint(ProfileToken)

Synchronization points allow clients to decode and correctly use all data after the synchronization point.

For example, if a video stream is configured with a large I-frame distance and a client loses a single packet, the client does not display video until the next I-frame is transmitted. In such cases, the client can request a Synchronization Point which enforces the device to add an I-Frame as soon as possible. Clients can request Synchronization Points for profiles. The device shall add synchronization points for all streams associated with this profile. Similarly, a synchronization point is used to get an update on full PTZ or event status through the metadata stream. If a video stream is associated with the profile, an I-frame shall be added to this video stream. If a PTZ metadata stream is associated to the profile, the PTZ position shall be repeated within the metadata stream.

GetSnapshotUri(ProfileToken)

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.

GetVideoSourceModes(VideoSourceToken)

A device returns the information for current video source mode and settable video source modes of specified video source.

A device that indicates a capability of VideoSourceModes shall support this command.

SetVideoSourceMode(VideoSourceToken, VideoSourceModeToken)

SetVideoSourceMode changes the media profile structure relating to video source for the specified video source mode.

A device that indicates a capability of VideoSourceModes shall support this command. The behavior after changing the mode is not defined in this specification.

GetOSDs(OSDToken=None, ConfigurationToken=None)

This operation lists existing OSD configurations for the device.

  • If an OSD token is provided the device shall respond with the requested configuration or provide an error if it does not exist.

  • In case only a video source configuration token is provided the device shall respond with all configurations that exist for the video source configuration.

  • If no tokens are provided the device shall respond with all available OSD configurations.

GetOSDOptions(ConfigurationToken)

Get the OSD Options.

SetOSD(OSD)

Set the OSD.

CreateOSD(OSD)

Create the OSD.

DeleteOSD(OSDToken)

Delete the OSD.

GetMasks(Token=None, ConfigurationToken=None)

This operation lists existing Mask configurations for the device.

  • If an Mask token is provided the device shall respond with the requested configuration or provide an error if it does not exist.

  • In case only a video source configuration token is provided the device shall respond with all configurations that exist for the video source configuration.

  • If no tokens are provided the device shall respond with all available Mask configurations.

GetMaskOptions(ConfigurationToken)

Get the Mask Options.

SetMask(Mask)

Set the Mask.

CreateMask(Mask)

Create the Mask.

DeleteMask(Token)

Delete the Mask.

GetWebRTCConfigurations()

This operation gets the current WebRTC configuration for the device.

SetWebRTCConfigurations(WebRTCConfiguration=None)

This operation sets the WebRTC configuration for the device.

GetAudioClips(Token=None)

This operation retrieves audio clip configurations from the device.

If an audio clip token is provided, the device shall return the audio clip configuration associated with that token. If no token is provided, the device shall return all audio clip configurations that exist on the device.

AddAudioClip(Configuration, Token=None)

This operation adds audio clip configuration to the device and provides audio clip upload URI to the client.

The response to the command includes an HTTP URL to which the audio clip may be uploaded within the expiry time. If the client is unable to upload the audio clip within the URL's expiry time, the associated audio clip configuration will be permanently removed from the device.

SetAudioClip(Token, Configuration)

This operation modifies the existing audio clip configuration on the device.

DeleteAudioClip(Token)

This operation deletes the audio clip configuration and the associated audio clip on the device.

The audio clip should be de-associated from the event or schedule trigger if it was previously associated before this operation. This operation will fail if the device is playing the audio clip at the same time due to user operation, schedule, or event trigger.

PlayAudioClip(Token, Play, AudioOutputToken=None, RepeatCycles=None)

This operation plays or stops the ongoing audio clip on the device.

AddTTSAudioClip(Configuration, TTSConfiguration, Token=None)

This operation sends a text and its configuartion to device that supports TTS function, so that device could convert the text into an audio clip and play it according to audio clip Configuration and TTS Configuration.

GetPlayingAudioClips()

This operation retrieves audio clips information which are playing currently in the device.

GetMulticastAudioDecoderConfigurationOptions(ConfigurationToken=None)

This operation gets the available options for the MulticastAudioDecoder configuration.

GetMulticastAudioDecoderConfigurations(ConfigurationToken=None)

This operation gets the list of multicast audio decoder configurations.

SetMulticastAudioDecoderConfiguration(Configuration)

This operation sets the MulticastAudioDecoderConfiguration.