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
- Download the AMSE tool from here.
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.
First pass – analyze mode
- Upload your media file through Asset –> Upload, or via drag and drop.
- Right click and process your media file using Media Analytics –> Azure Media Redactor –> Analyze mode.
The output will include an annotations json file with face location data, as well as a jpg of each detected face.
Second pass – redact mode
Upload your original video asset to the output from the first pass and set as a primary asset.
(Optional) Upload a 'Dance_idlist.txt' file which includes a newline delimited list of the IDs you wish to redact.
(Optional) Make any edits to the annotations.json file such as increasing the bounding box boundaries.
Right click the output asset from the first pass, select the Redactor, and run with the Redact mode.
Download or share the final redacted output asset.
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
Download and build the entire solution.
Download FFMPEG from here. This project was originally developed with version be1d324 (2016-10-04) with static linking.
Copy ffmpeg.exe and ffprobe.exe to the same output folder as AzureMediaRedactor.exe.
Use the tool
- Process your video in your Azure Media Services account with the Redactor MP on Analyze mode.
- Download both the original video file and the output of the Redaction - Analyze job.
Run the visualizer application and choose the files above.
Preview your file. Select which faces you'd like to blur via the sidebar on the right.
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.
Upload this file to the output asset from step 1. Upload the original video to this asset as well and set as primary asset.
- Run Redaction job on this asset with "Redact" mode to get the final redacted video.
Check out the latest version of Azure Media Services: Azure Media Services v3.
You can start with the following topics:
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 Player
- Client SDK libraries
- Encoding and processing
- Live streaming
- Media Analytics
- Azure portal
- REST API and platform
- Video-on-demand streaming
We'd love to hear your thoughts. Choose the type you'd like to provide:
Our feedback system is built on GitHub Issues. Read more on our blog.