Description
Viseron already supports detection masks (mask: under the motion/object detectors), but those only exclude a region from detection — the pixels are still recorded, snapshotted and streamed. (This is also what #183 was about: the "privacy mask" there only affected detection.)
This is a request for a true privacy / blackout mask: one or more configured regions that are painted over (solid black) in the actual image data, so the masked area is hidden in:
- recordings / event clips
- snapshots / thumbnails
- the live stream
Use case (legal)
In several countries it is legally required not to film neighbouring property or the public street with a private camera (e.g. in Germany / under GDPR, a doorbell or garden camera must not record the neighbour's plot or the road). A detection-only mask does not satisfy this, because the stored footage still contains those pixels. A camera that saves and streams a blacked-out region is the clean way to stay compliant while still monitoring your own property.
Ideally the region would be defined the same way as the existing masks (a list of polygon coordinates), so it can match arbitrary shapes — a neighbour's plot is rarely a neat rectangle.
Proposed implementation
- A
privacy_mask (name TBD) config block, per camera, taking polygon coordinates — same schema as the detection mask.
- Applied once at the camera/decode level so it propagates to all consumers (recorder, snapshots, live/go2rtc), not just one of them.
- Solid black fill (an optional configurable colour would be a nice-to-have).
Current workaround (recordings + snapshots only — NOT live)
For anyone who needs this today, it can be approximated with ffmpeg drawbox filters in the recorder video_filters, before the encode step:
ffmpeg:
camera:
my_cam:
recorder:
codec: h264_vaapi
video_filters:
- drawbox=345:0:935:204:color=black:t=fill # e.g. the street strip along the top
- drawbox=1070:204:210:34:color=black:t=fill # staircase of boxes to approximate
- drawbox=1105:238:175:34:color=black:t=fill # a non-rectangular (triangular) region
# ... more boxes as needed
- format=nv12 # required before hwupload for a VAAPI encoder
- hwupload
This burns the mask into recordings and snapshots and works well. Two limitations a native feature would solve:
drawbox is rectangle-only, so a polygon (e.g. a neighbour's plot) has to be approximated with a staircase of many boxes.
- It does not cover the live stream (go2rtc pulls the source directly), so the live view still shows the area.
A native, polygon-based privacy mask applied at the source would cover all three outputs and handle arbitrary shapes cleanly.
Thanks for the great project!
Description
Viseron already supports detection masks (
mask:under the motion/object detectors), but those only exclude a region from detection — the pixels are still recorded, snapshotted and streamed. (This is also what #183 was about: the "privacy mask" there only affected detection.)This is a request for a true privacy / blackout mask: one or more configured regions that are painted over (solid black) in the actual image data, so the masked area is hidden in:
Use case (legal)
In several countries it is legally required not to film neighbouring property or the public street with a private camera (e.g. in Germany / under GDPR, a doorbell or garden camera must not record the neighbour's plot or the road). A detection-only mask does not satisfy this, because the stored footage still contains those pixels. A camera that saves and streams a blacked-out region is the clean way to stay compliant while still monitoring your own property.
Ideally the region would be defined the same way as the existing masks (a list of polygon
coordinates), so it can match arbitrary shapes — a neighbour's plot is rarely a neat rectangle.Proposed implementation
privacy_mask(name TBD) config block, per camera, taking polygoncoordinates— same schema as the detectionmask.Current workaround (recordings + snapshots only — NOT live)
For anyone who needs this today, it can be approximated with ffmpeg
drawboxfilters in the recordervideo_filters, before the encode step:This burns the mask into recordings and snapshots and works well. Two limitations a native feature would solve:
drawboxis rectangle-only, so a polygon (e.g. a neighbour's plot) has to be approximated with a staircase of many boxes.A native, polygon-based privacy mask applied at the source would cover all three outputs and handle arbitrary shapes cleanly.
Thanks for the great project!