Privacy is always incredibly important, especially with visual media where you may not have the permission of individuals in the video. If you’re filming something in public, it’s likely you’ll catch someone’s face who simply doesn’t want or need to be identified. This recently got me to thinking: what’s the easiest way to blur faces in a video via command line?
The best open source utility I found for blurring faces in a video was deface
. Let’s have a look at how you can use deface
to blur faces in videos!
Start by downloading Python-based via pip
:
python3 -m pip install deface
With deface
installed, simply provide the video name and get the output file with blurred faces:
sudo deface ./sample-4k-faces-video.mp4 Input: ./sample-4k-faces-video.mp4 Output: ./sample-4k-faces-video_anonymized.mp4 100%|█████████████████████████████
The resulting video does an impressive job of blurring out faces of persons walking by in the original recording:
View the resulting video of persons walking down the streets of New York:
The default threshold for face recognition works very well, even on moving subjects. You can experiment with thresholds with the thresh
argument, and even draw the thresholds out while debugging:
I downloaded a handful of YouTube videos using my favorite YouTube downloading utility youtube-dl
and I was amazed at how well deface
did on a variety of visual environments. Faces were identified at a reliable level even at default threshold!
Serving Fonts from CDN
For maximum performance, we all know we must put our assets on CDN (another domain). Along with those assets are custom web fonts. Unfortunately custom web fonts via CDN (or any cross-domain font request) don’t work in Firefox or Internet Explorer (correctly so, by spec) though…
Duplicate DeSandro’s CSS Effect
I recently stumbled upon David DeSandro’s website when I saw a tweet stating that someone had stolen/hotlinked his website design and code, and he decided to do the only logical thing to retaliate: use some simple JavaScript goodness to inject unicorns into their page.
Scrolling “Go To Top” Link Using Dojo
One of the most popular code snippets of posted on my blog has been the scrolling “Go To Top” link snippet. The premise of the snippet is simple: once the user scrolls an element (usually the BODY element) past a given threshold, a “Go…
Source link