# Polygon privacy mask Source: [https://docs.qualcomm.com/doc/80-70014-50/topic/polygon-privacy-mask.html](https://docs.qualcomm.com/doc/80-70014-50/topic/polygon-privacy-mask.html) Polygon privacy mask enables you to create privacy zones on an image using a polygonal shape. Using a polygon gives you the flexibility to make the masking smoother and more accurate. Run the following commands to enable the polygon support: - Filesrc: gst-launch-1.0 filesrc location=/opt/.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=5 output-io-mode=5 ! qtioverlay overlay-mask="mask0, polygon=<5, <360, 640, 780, 500, 300>, <360, 540, 180, 180, 100>>, dest-rect=<0, 0, 1280, 720>, color=0x202020FF" ! waylandsink fullscreen=trueCopy to clipboard - Camera: gst-launch-1.0 -e qtiqmmfsrc ! video/x-raw\(memory:GBM\),format=NV12,width=1920,height=1080,framerate=30/1,compression=ubwc ! qtioverlay overlay-mask="mask0, polygon=<5, <360, 640, 780, 500, 300>, <360, 540, 180, 180, 100>>, dest-rect=<0, 0, 1920, 1080>, color=0x202020FF" ! waylandsink fullscreen=trueCopy to clipboard ## Update polygon privacy mask property at runtime 1. Run the following command to set the privacy mask: gst-pipeline-app -e qtiqmmfsrc ! video/x-raw\(memory:GBM\),format=NV12,width=1920,height=1080,framerate=30/1,compression=ubwc ! qtioverlay overlay-mask="mask0, polygon=<7, <360, 640, 780, 640, 500, 360, 180>, <360, 360, 180, 120, 200, 120, 180>>, inverse=true, dest-rect=<0, 0, 1920, 1080>, color=0x202020FF" ! waylandsink fullscreen=trueCopy to clipboard 2. In the pipeline controls, select `Playing mode - 3`. 3. To change the property in the pipeline controls, select `Plugin mode - p`. 4. From the plugins, select `overlay - 2`. 5. In the plugin properties, select `overlay-mask - 4`. 6. Add the following value: mask0, polygon=<5, <360, 640, 780, 500, 300>, <360, 540, 180, 180, 100>>, inverse=true, dest-rect=<0, 0, 1920, 1080>, color=0x202020FFCopy to clipboard ## Inverse polygon privacy mask Run the following commands to enable the inverse polygon mask: - Filesrc: gst-launch-1.0 filesrc location=/opt/.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=5 output-io-mode=5 ! qtioverlay overlay-mask="mask0, polygon=<3, <360, 640, 780>, <360, 540, 180>>, inverse=true, dest-rect=<0, 0, 1280, 720>, color=0x202020FF" ! waylandsink fullscreen=trueCopy to clipboard - Camera: gst-launch-1.0 -e qtiqmmfsrc ! video/x-raw\(memory:GBM\),format=NV12,width=1920,height=1080,framerate=30/1,compression=ubwc ! qtioverlay overlay-mask="mask0, polygon=<3, <360, 640, 780>, <360, 540, 180>>, inverse=true, dest-rect=<0, 0, 1920, 1080>, color=0x202020FF" ! waylandsink fullscreen=trueCopy to clipboard **Parent Topic:** [Video overlay use cases](https://docs.qualcomm.com/doc/80-70014-50/topic/overlay-use-cases.html) Last Published: Oct 27, 2025 [Previous Topic Non-inverse privacy mask](https://docs.qualcomm.com/bundle/publicresource/80-70014-50/topics/non-inverse-privacy-mask.md) [Next Topic Video split use cases](https://docs.qualcomm.com/bundle/publicresource/80-70014-50/topics/video-split-use-cases.md)