Redact faces with Azure Media Analytics walkthrough


Azure Media Redactor is an Azure Media Analytics media processor (MP) that offers scalable face redaction in the cloud. Face redaction enables you to modify your video in order to blur faces of selected individuals. You may want to use the face redaction service in public safety and news media scenarios. A few minutes of footage that contains multiple faces can take hours to redact manually, but with this service the face redaction process will require just a few simple steps. For more information, see this blog.

For details about Azure Media Redactor, see the Face redaction overview topic.

This topic shows step by step instructions on how to run a full redaction workflow using Azure Media Services Explorer (AMSE) and Azure Media Redactor Visualizer (open source tool).

For more information, see this blog.

Azure Media Services Explorer workflow

The easiest way to get started with Redactor is to use the open source AMSE tool on github. You can run a simplified workflow via combined mode if you don’t need access to the annotation json or the face jpg images.

Download and setup

  1. Download the AMSE tool from here.
  2. Log in to your Media Services account using your service key.

    To obtain the account name and key information, go to the Azure portal and select your AMS account. Then, select Settings > Keys. The Manage keys windows shows the account name and the primary and secondary keys is displayed. Copy values of the account name and the primary key.

Face redaction

First pass – analyze mode

  1. Upload your media file through Asset –> Upload, or via drag and drop.
  2. Right click and process your media file using Media Analytics –> Azure Media Redactor –> Analyze mode.

Face redaction

Face redaction

The output will include an annotations json file with face location data, as well as a jpg of each detected face.

Face redaction

Second pass – redact mode

  1. Upload your original video asset to the output from the first pass and set as a primary asset.

    Face redaction

  2. (Optional) Upload a 'Dance_idlist.txt' file which includes a newline delimited list of the IDs you wish to redact.

    Face redaction

  3. (Optional) Make any edits to the annotations.json file such as increasing the bounding box boundaries.

  4. Right click the output asset from the first pass, select the Redactor, and run with the Redact mode.

    Face redaction

  5. Download or share the final redacted output asset.

    Face redaction

Azure Media Redactor Visualizer open source tool

An open source visualizer tool is designed to help developers just starting with the annotations format with parsing and using the output.

After you clone the repo, in order to run the project, you will need to download FFMPEG from their official site.

If you are a developer trying to parse the JSON annotation data, look inside Models.MetaData for sample code examples.

Set up the tool

  1. Download and build the entire solution.

    Face redaction

  2. Download FFMPEG from here. This project was originally developed with version be1d324 (2016-10-04) with static linking.

  3. Copy ffmpeg.exe and ffprobe.exe to the same output folder as AzureMediaRedactor.exe.

    Face redaction

  4. Run AzureMediaRedactor.exe.

Use the tool

  1. Process your video in your Azure Media Services account with the Redactor MP on Analyze mode.
  2. Download both the original video file and the output of the Redaction - Analyze job.
  3. Run the visualizer application and choose the files above.

    Face redaction

  4. Preview your file. Select which faces you'd like to blur via the sidebar on the right.

    Face redaction

  5. The bottom text field will update with the face IDs. Create a file called "idlist.txt" with these IDs as a newline delimited list.


    The idlist.txt should be saved in ANSI. You can use notepad to save in ANSI.

  6. Upload this file to the output asset from step 1. Upload the original video to this asset as well and set as primary asset.

  7. Run Redaction job on this asset with "Redact" mode to get the final redacted video.

Next steps

Read about the Azure Media Services learning paths:

Provide feedback

Use the User Voice forum to provide feedback and make suggestions on how to improve Azure Media Services. You also can go directly to one of the following categories:

Azure Media Services Analytics Overview

Azure Media Analytics demos

Announcing Face Redaction for Azure Media Analytics