Privacy Masking in Cameras: Static, Dynamic and on Export

Camera masking: whether the mask is applied on the camera or in the VMS, masks bypassed via RTSP, blurring on export and a test set after firmware updates.
Technical summary
Technology
Privacy masking, VMS, video analytics, FFmpeg, KVKK
Topic
Privacy masking and redaction in video
Level
Intermediate
Prerequisites
  • Camera and VMS admin access
  • A record of the monitoring purpose per camera
In this article7 sections

A camera’s field of view almost never consists only of the area that needs monitoring. A neighboring plot’s garden, the windows of the building opposite, the POS screen at the checkout, a keypad where PINs are entered, a monitor on a desk all enter the frame. Privacy masking technically removes these areas from the image. The real question isn’t whether there’s a mask but where in the processing chain it’s applied; because an area that looks black in live view may be visible in the recording. Below we cover static masks, dynamic anonymization and blurring on export together with how they behave on site.

When masking is needed

The principle in Article 4 of KVKK of being “relevant, limited and proportionate to the purpose” requires that areas not serving the camera’s purpose aren’t recorded. The first solution is always the right camera direction and the right lens. A mask comes in when an unwanted area stays in the frame because of the mounting point, lens options or the area’s geometry. Trying to save a badly positioned camera with a mask ends with painting half the frame black. Typical scenarios:

  • Public space and neighboring property: Roads, pavements, neighboring gardens and windows in perimeter security cameras
  • Information security: POS terminals, checkout keypads, access control PIN pads, control room and office monitors
  • Edges of private areas: The inside of a changing room or toilet becoming visible when its door opens
  • Images of third parties: Removing other people’s recognizability in a recording to be given to an individual

The mask decision is made per camera, with a written justification. If it isn’t clear which camera is there to monitor what, where to put the mask can’t be determined either. How to keep the justification record is explained in the camera privacy impact assessment guide.

Static masking

A static mask covers a fixed area of the image with an opaque rectangle or polygon. The vast majority of enterprise IP cameras support defining masks on the camera; the number and shape of masks that can be defined are limited by manufacturer and model. Points to watch in practice:

  • Draw the mask with a margin. On pole-mounted cameras that shake in the wind, or with brackets that shift slightly with temperature, information leaks past the edge of a tight mask.
  • Check the night image separately. Under IR lighting the image’s character changes; a mask that looks sufficient by day may be perceived differently at night because of reflections.
  • On PTZ cameras, the mask must be tied to the camera position, that is, move with pan, tilt and zoom. Test that the model supports this and that the mask keeps covering the target at different zoom levels.
  • On fisheye cameras, verify whether the mask is applied to the raw (un-dewarped) image or the corrected image.

A static mask also affects analytics. On most products, motion detection and object detection don’t work in the masked area. If a virtual fence rule on a perimeter camera falls under the mask, the rule silently stops working; no alarm comes, and nobody asks why. After drawing a mask, review the analytics rules on that camera again.

Dynamic masking and anonymization

Dynamic masking pixelates people or vehicles detected by video analytics in real time, or turns them into silhouettes. Some manufacturers offer this with apps running on the camera, some VMSs on the server side. The aim is to let the operator see the flow of events (crowd density, direction of movement, area intrusion) while hiding identities.

Its basic limit is detection error. When a person is partly visible, overlaps others in a crowd, is in low light or passes very close to the camera, analytics can miss them; in those frames, the person appears unmasked. A single frame is enough. That’s why dynamic masking isn’t a control providing permanent anonymization in the recording but a layer that reduces exposure in live viewing. In many installations, the unmasked original recording is also kept separately and opened only by an authorized role; in that case, what actually protects privacy is the access permissions.

Where the mask is applied: live view and recording

This is the most misunderstood point in masking projects. The same word “mask” can describe three different behaviors:

Point of application Effect on the recording Reversible? Typical use
Camera encoder The recording is masked too No Neighboring property, screens, keypads
VMS display (permanent) Varies by product Varies by product Centrally managed masks
VMS display (removable) The raw recording is unmasked Yes, with an authorized role Areas opened if needed in incident investigation
Export stage Only the copy is masked Can be regenerated from the original Responses to requests, sharing

On most products, a mask applied on the camera carries through to all streams (main stream, substream, recording stream) and can’t be undone. This is the right choice for areas that must never be seen, such as a neighboring property. Some VMS products such as Milestone XProtect, however, offer, alongside permanent masks, masks that users with a certain permission can temporarily lift. In that case, the raw recording is unmasked, and protection depends on who is given the permission to lift the mask. The role design for this permission is covered in the camera recording access permission model guide.

VMS-based masking has another overlooked gap. If the camera’s RTSP stream or web interface can be reached directly, the VMS mask is bypassed completely. A copy of VLC and the camera’s IP address are enough. If you use masks at VMS level, restrict direct access to cameras to the VMS server only, through network segmentation and account management; check in the firewall rules whether the RTSP port is open from the camera VLAN to the user VLAN.

Blurring on export

When sharing a recording containing a person’s own image in response to a data subject request, or sharing incident footage with an insurance company or another outside party, the recognizability of other people in the recording must be removed. Some enterprise VMSs offer redaction tools based on object tracking: the tool marks the person, tracks them in subsequent frames, and the operator checks frame by frame and corrects missed points. Don’t trust automatic tracking and send the output without watching it. A person should watch the file from start to finish.

If the VMS has no redaction tool, blurring a fixed region over a given time range can be done with FFmpeg. The example below blurs a 320×240-pixel region starting at coordinate 800,400 between seconds 12 and 20, and removes the audio channel:

ffmpeg -i recording.mp4 -filter_complex \
 "[0:v]crop=320:240:800:400,boxblur=20:2[b];[0:v][b]overlay=800:400:enable='between(t,12,20)'[v]" \
 -map "[v]" -an -c:v libx264 -crf 18 recording_masked.mp4

sha256sum recording.mp4 recording_masked.mp4 >> export_hash.txt

Details of the filter parameters are in the FFmpeg filters documentation. With this method, watch three points. First, re-encoding invalidates the original file’s digital signature and watermark verification; the original recording is kept separately and unmodified, and the masked copy is recorded as a “derivative.” Why this distinction matters is explained in the camera recording chain of custody guide. Second, the work is done on a workstation with restricted access, and temporary files are deleted when the job is done; a raw copy forgotten on the desktop is the most common source of leaks. Third, weak blur may not remove recognizability. Clothing, hair and gait also give a person away; use an opaque box if needed.

Verification and recording

Defining a mask is half the job. The job isn’t done until you’ve tested that the mask works in every expected viewing path. The test set below can be applied for each camera at installation, then at least once a year and after every firmware update:

Test Expected result
Live view in the VMS client The mask is visible and fully covers the target
Playback from recording Behaves according to the mask policy
Mobile app and web client Same result as the desktop client
Substream and low-resolution image The mask is preserved and doesn’t shift
Direct RTSP access to the camera Masked if there’s a camera mask; otherwise access blocked
Exported file Masked or unmasked according to policy
Night and IR mode Mask coverage is preserved

The rows most often skipped are the mobile app and the substream. A mask that looks right in the desktop client may appear in a different position, on some products, in the low-resolution stream the mobile client pulls. Keep the test results with the camera name, a screenshot of the mask definition, the test frames, the date and the person who did the test. This record shows in an audit that masking was done; it also makes clear what needs rechecking when the camera direction changes. Masking is one of the concrete camera-side implementations of the technical measures under Article 12 of KVKK; for the broader framework, see the KVKK technical measures implementation guide.

We carry out identifying the masking needs of existing cameras camera by camera and documenting the tests as part of our KVKK camera privacy notice and privacy processes work; removable mask permissions should be addressed together with the design of recording access rights and audit trail.

Frequently asked questions

Is a privacy mask defined on the camera also applied to the recording?

On most products, masks defined on the camera are applied before the image is encoded; in that case, the masked area can’t be recovered in live view, recording or export. Masks defined in the VMS, depending on the product, may be applied only on display, leaving the raw recording unmasked. Read the behavior from the product documentation and verify it with a test recording.

Can dynamic masking be used instead of a static mask?

Usually not. Dynamic masking relies on object detection; it can miss the mask when a person is partly visible, in crowds or in poor light. Cover fixed areas such as a neighboring property, screens or keyboards with a static mask; use dynamic masking as an additional layer.

How strong should blurring be in an exported recording?

Strong enough that the person’s face, clothing and distinguishing features can’t be recognized. Weak blur or small-block pixelation may not remove recognizability. Where possible, use an opaque box or strong blur, and have a second person who doesn’t know the individual check the result.

How is it proven that masking was done?

For each camera, a screenshot of the mask definition, test frames taken from the masked live and recorded images, the test date and the person who did the test are kept on a record form. The test is repeated after a firmware update or a change in camera direction.

Support

Contact us for support or a discovery session on this topic.

Contact form
[email protected]

Eretek Video Surveillance

IP cameras, recording and central management infrastructure. We plan blind spots, retention periods and the camera network around the risks of each site.

Knowledge Center

Other articles