Share via


Enable preview images when recording video

Note

Azure Video Analyzer has been retired and is no longer available.

Azure Video Analyzer for Media is not affected by this retirement. It is now rebranded to Azure Video Indexer. Click here to read more.

You can use Azure Video Analyzer to capture and record video from an RTSP camera. You would be creating a pipeline topology that includes a video sink node, as shown in Quickstart: Detect motion in a (simulated) live video, record the video to the Video Analyzer account or Tutorial: Continuous video recording and playback.

If you record video using the Video Analyzer edge module, you can enable the video sink node to periodically generate a set of preview images of different sizes. These images can then be retrieved from the video resource in your Video Analyzer account. For example, if your camera generates a video that has a resolution of 1920x1080, then the preview images would have the following sizes:

  • 320 x 180: small
  • 640 x 360: medium
  • 1280 x 720: large

Note

The preview images will preserve the aspect ratio of video from the camera.

The preview images are generated periodically, the frequency being determined by segmentLength. If you are using event-based recording, you should note that images are generated only when the live pipeline is active and video is being recorded. Each time a set of preview images are generated, they will overwrite the previous set.

Note

This functionality is currently only available with Video Analyzer Edge module. Further, enabling this has an impact on your Azure storage costs, driven by the frequent transactions to write the images or view them, and the size of the images.

Enable preview images in the video sink node

To enable preview images, you need to set the appropriate flag in the video sink node of the pipeline topology. Under videoPublishingOptions, set enableVideoPreviewImage to true

Example:

        "sinks": [
        {
          "@type": "#Microsoft.VideoAnalyzer.VideoSink",
          "name": "videoSink",
          "videoName": "{$parameter-for-specifying-unique-videoName-for-each-pipeline}",
          "inputs": [
            {
              "nodeName": "rtspSource",
              "outputSelectors": [
                {
                  "property": "mediaType",
                  "operator": "is",
                  "value": "video"
                }
              ]
            }
          ],
          "videoPublishingOptions": {
            "enableVideoPreviewImage": true
          },
          "videoCreationProperties": {
            "title": "{$parameter-for-specifying-unique-title-for-each-pipeline}",
            "description": "{$parameter-for-specifying-unique-description-for-each-pipeline}",
            "segmentLength": "PT30S"
          },
          "localMediaCachePath": "/var/lib/videoanalyzer/tmp/",
          "localMediaCacheMaximumSizeMiB": "2048"
        }
      ]

Access preview images

To acquire the static URLs to the available preview images, a GET request must be called on the video resource with an authorized bearer token. You will see the URLs listed under contentUrls in the response as shown below.

      "contentUrls": {
        ...
        "previewImageUrls": {
          "small": "XXXX",
          "medium": "XXXX",
          "large": "XXXX"
         }
       },
    

Next steps

Try out enabling video preview images in the topology in Quickstart: Detect motion in a (simulated) live video, record the video to the Video Analyzer account or Tutorial: Continuous video recording and playback.