Local, GPU-accelerated redaction for video and screen recordings — blur, black-box, or mosaic faces, names, and any regex-matchable PII, with human review.
Project description
OpenScrub — local video & screen-recording redaction
A local, GPU-accelerated tool that blurs faces and any on-screen text — names, phone numbers, SSNs, emails, dates, ID numbers, or anything you can express as a regex — in videos and screen recordings, with a human review step before anything is published.
Runs entirely on your own machine (no cloud, no upload of sensitive footage). OCR-driven, so it catches text anywhere on screen; face-tracked, so a face detected once stays covered even when the detector blinks; scroll- and motion-aware, so blur boxes follow content as it moves; and onset-aware, so redaction starts on the exact frame a detail first appears rather than a half-second late. Defaults are tuned for the hardest case — dense, scrolling medical-records screens — but the engine is general-purpose.
Keywords: video redaction · blur faces in video · redact screen recording · PII redaction · anonymize video · blur license plates · GDPR / CCPA / FERPA / PCI / HIPAA · OCR text redaction · face blur · privacy tool
What it does
- Blur faces — detected with a DNN model and visually tracked, so a single detection covers a face across frames where it would otherwise be missed.
- Blur license plates — via an optional ONNX detector model (see PLATES.md); plates re-detect every frame, so a plate crossing the frame stays covered.
- Redact text by pattern — bring your own regex for account numbers, case numbers, employee IDs, order numbers; built-in patterns for SSNs, phone numbers, emails, dates, addresses (including multi-line street/city/state/ZIP blocks), credit/debit card numbers (Luhn-validated), API keys/tokens, IP addresses, and medical record numbers.
- Redact names — via named-entity recognition plus heuristics, with no list required (though you can supply an allowlist to keep specific names visible and a blocklist to always remove others).
- Detection zones — restrict redaction to a region, or invert it: keep a central subject sharp and blur everyone/everything around them, or vice versa.
- Redaction styles — blur, solid black box (irreversible), or mosaic pixelation, choosable per category (black-box the SSNs, blur the faces).
- Human review — every detection is shown as a thumbnail you can keep or blur, with an interactive box editor to resize, move, add, or time-bound any blur before rendering.
- Audit trail — each run produces a report with SHA-256 hashes of input and output for provenance.
Use cases
PHI redaction for medical practices is the flagship use — it's the hardest version of the problem (dense, scrolling, fast-changing screens) and the tool is built to handle it. But the same engine fits many privacy workflows:
- Content creators & tutorials — strip inboxes, browser tabs, API keys, file paths, and notification pop-ups out of screen-recorded walkthroughs before publishing. Onset detection catches a notification that flashes for a fraction of a second.
- Legal e-discovery & court exhibits — redact names, SSNs, account numbers, and minors' identities from video exhibits, deposition recordings, and bodycam footage; keep the named party visible, blur the rest.
- Journalism & documentary — protect sources by blurring informants' faces and on-screen identifying text (badges, plates, addresses, shared documents); face tracking survives a source turning their head.
- Law-enforcement & FOIA release — redact bystander faces, minors, and visible PII from body-cam footage for public-records compliance, with a hashed audit report for chain-of-custody.
- GDPR / CCPA compliance — anonymize identifiable people and personal data in any recorded video before it's shared or published.
- Fintech & financial support videos — blur account numbers, balances, routing and card numbers in screen recordings of banking or accounting software (PCI-DSS-relevant), via built-in and custom regex.
- Education & research (FERPA) — protect student names, IDs, and grades in recorded lectures, gradebook screen-shares, and classroom video; "blur every face except the presenter" with an inverted zone.
- Corporate training & internal demos going public — remove real customer names, employee directories, internal URLs, and chat notifications when repurposing production-system recordings for marketing.
- Real-estate & property walkthroughs — blur faces, family photos, mail with addresses, and documents on desks captured incidentally.
- Streaming & gaming VODs — redact Discord DMs, donation alerts with real names, second-monitor leaks, and non-consenting on-cam guests.
- Dashcam footage — blur license plates and pedestrian faces before posting insurance or public clips (plates via the dedicated detector model — see PLATES.md).
- UX & usability research — anonymize participants' faces, names, and on-screen account data before sharing session recordings internally.
- Government document-on-screen redaction — remove names, locations, and marked strings from recordings that walk through sensitive documents, with zones, regex, and an audit trail.
Several of these depend on you supplying the right regex, and on OCR reading the target text reliably at your recording's resolution — see Caveats. Face tracking works best on footage where faces are stationary or scroll with the page rather than moving rapidly across the frame. In all cases this is a best-effort assistive tool: review the output before publishing.
Install from PyPI (quickest)
pip install OpenScrub
This installs the Python package with all of its Python dependencies and
gives you two commands: openscrub (the CLI engine) and openscrub-web
(the web interface). The YuNet face model (~230 KB) downloads
automatically on first run.
Two system tools are not pip-installable and must be present for full functionality:
- Tesseract OCR — required for every text category (names, SSNs,
emails, …). Face and plate detection work without it; text detection
does not.
- Windows: installer from https://github.com/UB-Mannheim/tesseract/wiki
- Linux:
sudo apt install tesseract-ocr
- ffmpeg (ffprobe ships with it) — strongly recommended: audio
passthrough, H.264 output, and VFR screen-recording normalization all
depend on it.
- Windows:
winget install ffmpeg - Linux:
sudo apt install ffmpeg
- Windows:
Optional extras:
pip install "OpenScrub[ner]" # spaCy name detection (recommended)
python -m spacy download en_core_web_sm
pip install paddleocr paddlepaddle # better OCR on small UI fonts (large install)
spaCy is strongly recommended — it's the primary name detector. The tool still runs without it using heuristics, but NER is more accurate.
Guided installer (Windows / Linux / macOS best-effort)
Prefer a setup that installs the system tools too? Clone or download the repository and run:
python install.py
It probes every dependency and installs what's missing with your consent: core pip packages, spaCy NER, Tesseract and ffmpeg (via winget / apt / dnf / pacman / brew), and PaddleOCR — automatically offering the GPU build when an NVIDIA card is detected — then verifies NVENC hardware encoding and creates a launchable "OpenScrub" shortcut with the program icon (Desktop + Start Menu on Windows, a .desktop entry on Linux, a .command on macOS).
--check reports what's present without changing anything; --yes runs
unattended; --cpu-only skips GPU OCR; --with-plates fetches a
license-plate model (see PLATES.md). Start the app from the
created shortcut, or python openscrub_web.py — the web interface is the
primary interface. (openscrub_gui.py, the desktop Tk interface, still
works but is legacy: new features land in the web app.)
Web interface (LAN)
Run python openscrub_web.py on an always-on machine and open the printed
URL from any device on your network —
laptop or phone. Workflow: upload a recording (or point at a server-side
path) → scan runs on the server with a live preview and log → review
page: every detection shown as a thumbnail grouped by category, uncheck
false positives, per-category all-on/all-off, draw missed regions directly
on any frame (works with touch) → render → download the redacted video and
the audit report. Jobs queue one at a time so they don't fight over the GPU.
Security: HTTPS by default (self-signed certificate — your browser warns
once; or install your own cert from the main page). Access is open to
everyone on your network unless you start with --token <secret>, which
then gates every request (recommended). Either way this is LAN-grade
protection — never expose the port to the internet. The jobs folder on
the server contains PHI (uploads + reports); protect it accordingly.
--retain-days auto-deletes finished job folders (default 7 days).
⚠️ Disclaimer — read this before using openscrub on real PHI
openscrub is a best-effort assistive tool, not a HIPAA compliance guarantee, a de-identification certification, or a substitute for human review. It uses OCR, named-entity recognition, pattern matching, and face detection — all of which can and do miss things: low-contrast text, unusual names, stylized fonts, partially occluded faces, content visible for only a fraction of a second, handwriting, text inside images, and categories of identifiers it was never designed to detect.
You remain fully responsible for reviewing every output before it is shared, published, or distributed. The built-in review workflow and the final QC scrub are not optional extras — they are the compensating control this tool is designed around. If a redacted video leaks protected health information, that is your exposure, not this software's.
Specifically:
- The validation numbers in this README are measurements against a synthetic corpus. They demonstrate the pipeline works as designed; they are not a guarantee of performance on your recordings, your EMR, your fonts, or your screen resolution.
- Audit reports, job folders, and normalized/intermediate video files contain PHI in plaintext. Protect them with the same controls as any other PHI: restricted access, encryption at rest where required, and deletion when no longer needed.
- The web interface provides LAN-grade access control at most
(HTTPS with an optional access token — set one with
--token). Never expose it to the internet, and run it only on networks and machines already authorized to handle PHI. - This tool addresses on-screen visual content only. Audio narration, metadata, file names, and embedded subtitles are untouched and can all carry PHI.
- Nothing in this project constitutes legal, compliance, or regulatory advice. Consult your privacy officer or counsel for questions about HIPAA, state privacy law, or your organization's obligations.
This software is provided "AS IS" without warranty of any kind — see the LICENSE (Apache-2.0, §7–8) for the governing terms.
Validation
During development the pipeline is scored against a synthetic corpus: a generator plants fake PHI at known locations across the hard cases — static charts, schedule grids, scrolling notes, OCR-disrupting highlights, embedded face photos — and a scorer checks the rendered output against the ground truth:
PHI recall: 100.0% (102/102 planted samples blurred)
Benign preservation: 100.0% (39/39 benign samples left readable)
(measured with the Tesseract fallback engine; PaddleOCR + spaCy NER, the
recommended stack, is stronger). The shipped regression suite
(pytest test_openscrub.py) exercises the same end-to-end pipeline on
synthetic videos — for this tool a regression is not a bug, it's a leak,
so the suite must stay green on every change.
Feature notes
- VFR normalization — OBS/Game Bar variable-frame-rate recordings are detected (ffprobe) and normalized to CFR before processing, preventing blur-timing drift and audio desync; recorded in provenance.
- OCR quality: low-confidence words that are structurally PHI-shaped
(emails, phones, digit runs) are rescued instead of dropped; small text
triggers an automatic 2x re-OCR; a reverse pass re-searches the whole
timeline for near-misses of remembered PHI.
--paranoidpreset maxes recall at the cost of false positives (clean up in review). - False-positive economics: names must be caught by a primary detector on two separate scans before memory starts recalling them; a top-recalls summary prints after every scan; the web review suggests allowlisting strings you disabled everywhere, building a permanent allow-list.
- Web: before/after compare scrubber on finished jobs, ETA on the
progress bar,
--retain-daysauto-deletes PHI-bearing job folders (default 7 days). - Batch resume — re-running
--batchskips files already done (--overwriteto redo). - Review workflow — scan and render are separate phases; between them
you can audit every detection and correct both false positives and
misses. CLI equivalent: run with
--report audit.json, edit the JSON (set"enabled": false, or append boxes), thenopenscrub.py video.mp4 --from-report audit.jsonre-renders in seconds without re-scanning. - Face detection — the
facecategory (on by default) blurs faces in clinical photos and webcam bubbles, which OCR is blind to. Uses the YuNet DNN detector (auto-downloaded, ~230 KB) with a Haar-cascade fallback. Faces re-detect on every scan; boxes are expanded 15%. - Config profiles —
--config profile.yamlloads per-environment settings (engine, MRN regex, categories, ignore regions…). CLI flags override the file. - Ignore regions —
--ignore-region X1,Y1,X2,Y2(repeatable, or in config) excludes screen areas like the taskbar clock from all blurring. - Batch mode —
--batch folderprocesses every video, writing per-file outputs + audit reports and abatch_summary.json. - Provenance — every audit report records tool version, timestamp, full settings, and SHA256 of input and output, making the audit trail independently verifiable.
Desktop GUI (Windows, legacy)
python openscrub_gui.py opens a desktop app covering everything the
CLI does (legacy: it still works, but new features land in the web app):
- Source / output / audit-report file pickers
- OCR engine selection with live status (Tesseract / PaddleOCR / spaCy NER / NVENC detected or missing) and one-click Install buttons for PaddleOCR (CPU or GPU CUDA 12.6) and spaCy NER
- GPU/CPU toggle for OCR, NVENC/x264 toggle for encoding
- Category checkboxes, blur vs box, preview mode, memory on/off
- Allow-names and always-blur name lists (type directly or load a file)
- Sample interval / scan trigger / padding / bridge gap / MRN regex fields
- Live preview showing each frame as it's analyzed with detection boxes
- Progress bar, log pane, and a Cancel button that cleans up partial output
Extra requirement for the preview pane: pip install pillow
Usage
:: standard run
python openscrub.py recording.mp4
:: keep provider/staff names visible (one name per line in the file)
python openscrub.py recording.mp4 --allow-names providers.txt
:: tuning pass — draws boxes instead of blurring
:: (red = detected PHI, orange = unscanned scroll safety band)
python openscrub.py recording.mp4 --preview
:: everything
python openscrub.py recording.mp4 --allow-names providers.txt ^
--extra-names always_blur.txt --sample-interval 0.5 --scan-trigger 60 ^
--pad 8 --mode blur --report audit.json -o recording_redacted.mp4
How names are detected (no patient list)
Three stacked signals, any of which triggers a blur:
- spaCy NER — PERSON entities in reconstructed text lines
- Label heuristic — text following "Patient:", "Name:", "Pt:", "Member:", "Insured:", "Guarantor:", etc., stopping at the next label
- Capitalized-pair heuristic — adjacent capitalized non-UI words ("Maria Gonzalez", "Henderson, Robert", "Mrs. Whitfield"); auto-enabled as fallback when spaCy is missing, or force with --heuristic-names on
--allow-names providers.txt whitelists names to KEEP visible (your
physicians/PAs, e.g. Smith, Patel, Nguyen, Garcia).
--extra-names force-blurs specific names the detectors might miss.
How scrolling is handled
Three mechanisms working together:
- Per-frame motion tracking — global scroll offset is measured every frame via phase correlation against a keyframe (drift-bounded, verified to a few px over a 500px scroll). Every blur box is anchored in content coordinates and translated with the scroll, so blur rides along with the text on every single frame — not just at sample times.
- Motion-triggered scans — in addition to the time-based interval, an OCR scan fires after every --scan-trigger pixels of scroll (default 60), so newly revealed content is scanned almost immediately.
- Safety bands — any strip of screen that scrolled into view since the last OCR scan is blurred wholesale until it has been scanned. Unverified content is never shown, even between scans.
Net effect: text detected once stays covered while it moves, and text scrolling into view is covered by the safety band before it's even been read. Verified in testing with 26/26 PHI regions covered across static, mid-scroll, and post-scroll frames.
PHI memory and gap bridging
Two reasoning layers prevent "flash of PHI" from intermittent OCR misses:
- PHI text memory — every string confirmed as PHI is remembered for the rest of the video. Each scan checks all OCR'd words against memory (fuzzy for names, near-exact for numbers), so "Henderson" identified once gets blurred on every later appearance anywhere on screen, even where NER/heuristics would fail (e.g. a bare surname mid-sentence). Disable with --no-memory. Memory is per-run only; nothing persists.
- Evidence-based gap bridging — if the same PHI is detected, missed for a few scans, then re-detected in the same region, the blur is held straight through the gap (up to --bridge-gap seconds, default 4.0) — UNLESS an intermediate scan positively read different text there, meaning the content genuinely changed. Unreadable or empty gaps fail closed: they stay blurred.
Caveats — read these
- Best-effort, not a guarantee. OCR can miss low-contrast or tiny text; NER can miss unusual names (heuristics + label detection back it up, but nothing is 100%). Do a final QC scrub in your editor at 2x before anything goes public. Treat this as removing ~95% of the manual work.
- All dates are blurred, since the tool can't distinguish DOBs from
visit dates. Usually right on a medical UI; drop
dobfrom --categories if too aggressive for a given recording. - Partial-screen scrolling (one panel scrolls while the rest is static) is tracked as whichever motion dominates. If a recording is mostly panel-scrolling, use --preview to check coverage and consider --sample-interval 0.25.
- MRN default is standalone 7+ digit runs, or 6+ digits near an
MRN/chart/acct label. Tighten with --mrn-regex if benign numbers get
caught (e.g.
\b\d{7}\bfor an exact-width MRN). - The --report JSON contains PHI in plaintext. Handle it like any PHI file.
Recommended workflow
- Record as usual
--previewpass, spot-check red boxes and orange bands- Real pass (optionally with --report)
- Import
_redacted.mp4into your editor, edit normally - Final QC scrub before publishing
Tuning cheat sheet
| Symptom | Fix |
|---|---|
| Provider names blurred | add them to --allow-names |
| A name slips through | add to --extra-names; install spaCy if not present |
| Random capitalized words blurred | install spaCy so the pair heuristic turns off, or --heuristic-names off |
| Text slips through during very fast scrolling | --scan-trigger 40 and/or --sample-interval 0.25 |
| Benign numbers blurred as MRN | tighten --mrn-regex |
| Blur box clips edges of text | --pad 12 |
| Small text missed entirely | install paddleocr; record at native resolution |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openscrub-1.0.1.tar.gz.
File metadata
- Download URL: openscrub-1.0.1.tar.gz
- Upload date:
- Size: 130.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a1802adccd9d75861a080948d93149a378368e4f29bb6ed86aa6746e6a11848
|
|
| MD5 |
2696edcd9fe19e75b8caf52e563f07ad
|
|
| BLAKE2b-256 |
74531a53de15e6bcec6202a9e05d5e864371bbd0756cc86453556ddeb3227c1d
|
Provenance
The following attestation bundles were made for openscrub-1.0.1.tar.gz:
Publisher:
publish.yml on austinmabry/OpenScrub
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openscrub-1.0.1.tar.gz -
Subject digest:
7a1802adccd9d75861a080948d93149a378368e4f29bb6ed86aa6746e6a11848 - Sigstore transparency entry: 2141140966
- Sigstore integration time:
-
Permalink:
austinmabry/OpenScrub@231ecd7abd401c6b49a3d093907cdfec25f317fc -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/austinmabry
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@231ecd7abd401c6b49a3d093907cdfec25f317fc -
Trigger Event:
release
-
Statement type:
File details
Details for the file openscrub-1.0.1-py3-none-any.whl.
File metadata
- Download URL: openscrub-1.0.1-py3-none-any.whl
- Upload date:
- Size: 117.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f2862709553460da95993f799f0572af08ba87030ae2ab8ac1a780fcddc1430
|
|
| MD5 |
73c9f1e3977fffa8d30ee51dda6addad
|
|
| BLAKE2b-256 |
84d69c9565173c3ff3ef341648e00c2ba510cf6adfcdc8d53a921f17d4ed8c6d
|
Provenance
The following attestation bundles were made for openscrub-1.0.1-py3-none-any.whl:
Publisher:
publish.yml on austinmabry/OpenScrub
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openscrub-1.0.1-py3-none-any.whl -
Subject digest:
1f2862709553460da95993f799f0572af08ba87030ae2ab8ac1a780fcddc1430 - Sigstore transparency entry: 2141141056
- Sigstore integration time:
-
Permalink:
austinmabry/OpenScrub@231ecd7abd401c6b49a3d093907cdfec25f317fc -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/austinmabry
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@231ecd7abd401c6b49a3d093907cdfec25f317fc -
Trigger Event:
release
-
Statement type: