Search code examples
onvif

Is it possible to retrieve a single snapshot from a network camera using ONVIF?


I am trying to retrieve single snapshots (not video streaming) using ONVIF. Is this even possible? If so, how?

Thank you.


Solution

  • You have to user the GetSnapshotUri function from the Media Service specs.

    From the specs:

    5.16.1 Request snapshot URI

    A Network client uses the GetSnapshotUri command to obtain a JPEG snhapshot from the device. The returned URI shall remain valid indefinitely even if the profile is changed. The ValidUntilConnect, ValidUntilReboot and Timeout Parameter shall be set accordingly (ValidUntilConnect=false, ValidUntilReboot=false, timeout=PT0S). 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) should be taken from the profile if suitable. The provided image shall be updated automatically and independent from calls to GetSnapshotUri.