管理录制策略Manage recording policy

可以使用 IoT Edge 上的实时视频分析进行连续视频录制,持续数周或数月将视频录制到云中。You can use Live Video Analytics on IoT Edge for continuous video recording, whereby you can record video into the cloud for weeks or months. 可以使用 Azure 存储中内置的生命周期管理工具来管理云存档的时间长度(天)。You can manage the length (in days) of that cloud archive by using the Lifecycle Management tools built into Azure storage.

媒体服务帐户已链接到 Azure 存储帐户,将视频录制到云中时,内容会写入媒体服务资产Your Media Service account is linked to an Azure Storage account, and when you record video to the cloud, the content is written to a Media Service asset. 每个资产都映射到存储帐户中的一个容器。Each asset is mapped to a container in the storage account. 生命周期管理允许你为存储帐户定义策略,你可以在其中指定规则,如下所示。lifecycle management allows you to define a policy for a Storage account, wherein you can specify a rule such as the following.

{
  "rules": [
    {
      "name": "NinetyDayRule",
      "enabled": true,
      "type": "Lifecycle",
      "definition": {
        "filters": {
          "blobTypes": [ "blockBlob" ]
        },
        "actions": {
          "baseBlob": {
            "tierToCool": { "daysAfterModificationGreaterThan": 30 },
            "delete": { "daysAfterModificationGreaterThan": 90 }
          }
        }
      }
    }
  ]
}

上述规则:The above rule:

  • 应用于存储帐户中的所有块 blob。Applies to all block blobs in the Storage account.
  • 指定当 blob 期限超过 30 天时,它们将从热访问层移动到冷访问层Specifies that when blobs age beyond 30 days, they are moved from the hot access tier to cool.
  • 如果 blob 期限超过 90 天,则将其删除。And when blobs age beyond 90 days, they are to be deleted.

由于实时视频分析按指定的时间单位存档视频,因此资产将包含一系列 blob,每个片段一个 blob。Since Live Video Analytics archives your video in specified units of time, your asset will contain a series of blobs, one blob per segment. 当生命周期管理策略生效并删除较旧的 blob 时,你将继续能够通过媒体服务 API 访问和播放剩余的 blob。When Lifecycle management policy kicks in and deletes older blobs, you will continue to be able to access and playback the remaining blobs via Media Service APIs. 有关详细信息,请参阅播放录制内容For more information, see playback recordings.

限制Limitations

以下是生命周期管理的一些已知限制:Following are some known limitations with lifecycle management:

  • 策略中最多可以有 100 个规则,每个规则最多可以指定 10 个容器。You can have at most 100 rules within the policy, and each rule can specify up to 10 containers. 因此,如果你需要具有不同的录制策略(例如,正对停车场的摄像头为 3 天存档、装货码头的摄像头为 30 天、收银台后面的摄像头为 180 天),请使用媒体服务帐户,为最多 1000 个摄像头自定义规则。So if you needed to have different recording policies (for example, 3-day archive for the camera facing the parking lot, 30 days for the camera in the loading dock, and 180 days for the camera behind the checkout counter), then with one Media Service account you can customize the rules for at most 1000 cameras.
  • 生命周期管理策略更新不是即时的。Lifecycle management policy updates are not immediate. 有关更多详细信息,请参阅常见问题解答部分See this FAQ section for more details.
  • 如果选择应用将 blob 移动到冷访问层的策略,则该存档部分的播放可能会受到影响。If you choose to apply a policy where blobs get moved to the cool tier, then playback of that portion of the archive may be affected. 你可能会看到其他延迟,或偶尔发生的错误。You may see additional latencies, or sporadic errors. 媒体服务不支持在存档层中播放内容。Media Services does not support playback of content in the archive tier.

后续步骤Next steps

播放录制内容Playback of recordings