Redact personal information from video

Blur faces and on-screen personal details, mute spoken identifiers, and mask the same words in captions before sharing a recording.

This pipeline prepares workplace video for sharing. It blurs people’s faces and personal details visible in the frame, mutes spoken identifiers, and masks those words in captions.

The staged support recording shows the same clip before and after redaction, using a synthetic portrait, contact details, and voice. The four workplace recordings show reviewed exports from fixed factory footage, a handheld construction clip, a site interview, and a field software recording. Turn on sound to compare the original callback number with the muted interval in the staged recording. See the gallery.

Staged support recording

Before redaction0:17
After redaction0:17

Fixed and handheld cameras

Fixed factory camera0:07
Handheld construction camera0:05

Interview and software recordings

Construction-site interview0:17
Field software recording0:20

Play the staged recording before and after redaction. The four workplace recordings show the reviewed exports.

The screen-text step uses an llm step. Editframe enables pipelines and llm steps for an organization after you tell us about your footage.

What it produces

  • Faces and speech. The built-in PII detector uses OpenCV YuNet to detect faces across sampled frames and a quantized DistilBERT model from Hugging Face to identify names in the transcript. Editframe tracks each face over time and also marks spoken email addresses and phone numbers. YuNet weights · DistilBERT model.
  • On-screen text. Gemini inspects sampled frames for personal details in form fields, titles, badges, and labels. It returns timed boxes around the values so the surrounding text stays visible.
  • Reviewed media. After approval, the render applies the visual blurs, mutes the marked audio, and masks the matching words in burned-in captions. The output is a separate MP4 in the organization.

The pipeline

The frames and transcript are prepared in parallel. Screen-text detection uses only sampled images and video metadata. A reviewer can correct the three kinds of annotations before they reach the renderer.

probe

Reads the recording’s duration, frame size, and tracks.

json
{ "probe": { "type": "probe" } }

frames

Takes a frame every quarter-second.

json
{
  "frames": { "type": "sample_frames", "needs": ["probe"], "with": { "every_ms": 250 } }
}

transcript

Transcribes the narration and records when each word is spoken.

json
{
  "transcript": {
    "type": "transcribe",
    "needs": ["probe"],
    "with": { "language": "en" }
  }
}

face_and_speech

Detects faces with OpenCV YuNet and finds spoken names with DistilBERT from Hugging Face. The step also marks spoken email addresses and phone numbers.

json
{
  "face_and_speech": {
    "type": "detect_pii",
    "needs": ["frames", "transcript"],
    "with": { "faces": "all", "speech": ["person", "email", "phone"] }
  }
}

screen_text

Finds visible personal details in form fields, titles, badges, and labels and returns timed boxes around the values.

json
{
  "screen_text": {
    "type": "llm",
    "needs": ["frames", "probe"],
    "with": {
      "provider": "google",
      "model": "gemini-4-carbon",
      "include": ["probe"],
      "max_frames": 16,
      "instructions": "…",
      "output": { "mode": "json", "schema": "…" }
    }
  }
}
Instructions of screen_text
text
Find visible names, email addresses and phone numbers in the recording. Look at screen fields,
on-screen titles, name badges and labels. Ignore generic labels, interface controls, charts and
faces. Return one pii.screen_text annotation per sensitive value and continuous visibility
interval. Inspect the sampled frames and their t_ms to find the intervals. Use start_ms 0 and
the input duration as end_ms for values visible throughout. Give each box enough padding to
cover the whole sensitive value, including punctuation, and keep the field label visible.
Keyframe boxes use x, y, w and h as fractions of the full frame, measured from the top left. Use
at least one box per region, with another keyframe when it moves. Use generic labels like Email
address. Do not transcribe or echo the value. Return an empty regions array if nothing
qualifies.
Output schema of screen_text
json
{
  "type": "object",
  "properties": {
    "regions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "kind": { "type": "string", "enum": ["pii.screen_text"] },
          "label": { "type": "string" },
          "start_ms": { "type": "integer", "minimum": 0 },
          "end_ms": { "type": "integer", "minimum": 0 },
          "keyframes": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "properties": {
                "t_ms": { "type": "integer", "minimum": 0 },
                "x": { "type": "number", "minimum": 0, "maximum": 1 },
                "y": { "type": "number", "minimum": 0, "maximum": 1 },
                "w": { "type": "number", "minimum": 0, "maximum": 1 },
                "h": { "type": "number", "minimum": 0, "maximum": 1 }
              },
              "required": ["t_ms", "x", "y", "w", "h"]
            }
          }
        },
        "required": ["kind", "label", "start_ms", "end_ms", "keyframes"]
      }
    }
  },
  "required": ["regions"]
}

review

Holds the proposed masks and mute ranges for a reviewer to correct and approve.

json
{
  "review": {
    "type": "review",
    "needs": ["face_and_speech", "screen_text"],
    "with": {
      "instructions": "Check the recording against the proposed masks and mute ranges. Add any missed detail and adjust coverage before approving. For each kind you correct, include every annotation of that kind that should be rendered. Reject if you cannot verify coverage.",
      "expires_after_ms": 86400000,
      "on_expiry": "reject"
    }
  }
}

redact

Applies the reviewed blurs and audio mutes, then masks the matching words in captions.

json
{
  "redact": {
    "type": "redact_render",
    "needs": ["review"],
    "with": { "kinds": ["pii.face", "pii.screen_text", "pii.speech"], "captions": true }
  }
}

Run it

From the repository root, run the example with an API key in EDITFRAME_TOKEN. The runner leaves the review pending.

bash
node elements/examples/scripts/run-example.mjs pii-redaction --review wait

Open the pending review and compare the proposed boxes and mute ranges against the source. Add missed details and adjust boxes and timings as needed. When you submit corrections for a kind, include every annotation of that kind you want to keep. Reject the review if you cannot verify coverage. Rejection and expiry skip the render.

In the staged recording, the face and both form values are visible throughout. The callback number starts around 00:06 and ends just after 00:10. The screen boxes were adjusted in review to cover the full values.

After approval, inspect the exported video, audio, and captions before sharing it. Use redact.metadata.output_file_id to identify the rendered copy. Share only the reviewed MP4.

Run the workplace recordings

Fetch the originals and their verified local paths with node elements/examples/scripts/fetch-sources.mjs --slug pii-redaction. Use pipeline_id from the example runner’s summary.json as PIPELINE_ID and the path to your prepared MP4 as CLIP_MP4.

bash
npx editframe pipelines upload "$CLIP_MP4" --run "$PIPELINE_ID"

Review the faces as they enter, turn, and move out of frame. Check on-screen names in the interview and software recording and listen to the spoken introductions. Check the audio and captions again in the rendered copy.

Licences