Redact faces with Azure Media Analytics walkthrough

media services logo


Overview

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 for AMS v2 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.

Screenshot shows Microsoft Azure Media Services where you can enter your account name and key.

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.

Screenshot shows a menu with Process Asset(s) with Azure Media Redactor.

Screenshot shows Azure Media Redactor with First Pass: Analyze mode selected.

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

Screenshot shows the output of the analysis.

Second pass – redact mode

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

    Screenshot shows the Upload and Set as Primary buttons.

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

    Screenshot shows the option to upload the text file.

  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.

    Screenshot shows Azure Media Redactor with Second Pass: Redact mode selected.

  5. Download or share the final redacted output asset.

    Screenshot shows the Download button.

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.

    Screenshot shows Build Solution selected from the menu.

  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.

    Screenshot shows the contents of the folder, including ffmpeg and ffprobe.

  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.

    Screenshot shows Azure Media Redactor uploading files.

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

    Screenshot shows Azure Media Redactor where you can preview and select faces to blur.

  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.

    Note

    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

Media Services v3 (latest)

Check out the latest version of Azure Media Services!

Media Services v2 (legacy)

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