# Video overlay use cases

Source: [https://docs.qualcomm.com/doc/80-70022-50/topic/overlay-use-cases.html](https://docs.qualcomm.com/doc/80-70022-50/topic/overlay-use-cases.html)

The pipelines show the use cases for video overlay. These use cases use the
            `dest-rect` property coordinates from the *overlay-mask* property of
        the [qtivoverlay](https://docs.qualcomm.com/doc/80-70022-50/topic/qtioverlay.html) plugin.

Before you run the use cases, ensure that you complete the preconditions mentioned in
                [GStreamer command-line use cases](https://docs.qualcomm.com/doc/80-70022-50/topic/gstreamer-application-use-cases.html).

Note: The commands in the following use cases use the 720p resolution.
            To change the resolution, update the respective `dest-rect` property
            coordinates in the command for that resolution. For more information, see [qtivoverlay](https://docs.qualcomm.com/doc/80-70022-50/topic/qtioverlay.html).

## User text overlay

Source: [https://docs.qualcomm.com/doc/80-70022-50/topic/overlay-use-cases.html](https://docs.qualcomm.com/doc/80-70022-50/topic/overlay-use-cases.html)

This use case overlays text on a video stream.

Run the following use cases on the target device:

- Overlay on a
                    video:

        setprop persist.overlay.use_c2d_blit 2Copy to clipboard

        gst-launch-1.0 filesrc location=/opt/Animals_000_720p_180s_30FPS.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! qtioverlay overlay-text="text0, text=\"Qualcomm\ Intelligence\", color=(uint)0xFFFF00FF, dest-rect=<160, 624, 944, 50>;" ! waylandsink fullscreen=trueCopy to clipboard

Figure : Pipeline for text overlay on video–file source
                    
                    <?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="1045.002105712890625" height="158.201599121094659" viewbox="0 0 1045.002105712890625 158.201599121094659">
  <g id="Layer_1" data-name="Layer 1">
    <g>
      <rect x=".500152587890625" y=".49981689453125" width="1044.00244140625" height="157.20166015625" rx="7.499999999999986" ry="7.499999999999986" style="fill: #fafafa;"></rect>
      <path d="M1037.002105712890625,1c3.85986328125,0,7,3.140132904052734,7,7v142.201599121094659c0,3.85986328125-3.14013671875,7-7,7H8c-3.85986328125,0-7-3.14013671875-7-7V8c0-3.859867095947266,3.14013671875-7,7-7h1029.002105712890625M1037.002105712890625,0H8C3.581733703613281,0,0,3.581733703613281,0,8v142.201599121094659c0,4.418273925780341,3.581733703613281,8,8,8h1029.002105712890625c4.418334960939319,0,8-3.581726074219659,8-8V8c0-4.418266296386719-3.581665039060681-8-8-8h0Z" style="fill: #d2d7e1;"></path>
    </g>
    <g>
      <g>
        <text transform="translate(843.858642578125 134.2930908203125)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Qualcomm </tspan></text>
        <rect x="823.607641423212044" y="122.201599121094659" width="16" height="16" rx="2" ry="2" style="fill: #2a2aea;"></rect>
      </g>
      <g>
        <text transform="translate(942.4404296875 134.2930908203125)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Open source</tspan></text>
        <rect x="922.189422836070662" y="122.201599121094659" width="16" height="16" rx="2" ry="2" style="fill: #007884;"></rect>
      </g>
    </g>
  </g>
  <g id="Layer_2" data-name="Layer 2">
    <g>
      <g>
        <rect x="350.002136832787073" y="52.201583862304688" width="150.000000000000909" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(387.209197998046875 80.708297729492188)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">h264parse</tspan></text>
      </g>
      <g>
        <line x1="500.002166748046875" y1="77.201583862304688" x2="519.261138916015625" y2="77.201583862304688" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="518.093963623046875 81.190643310546875 525.002166748046875 77.201583862304688 518.093963623046875 73.212516784667969 518.093963623046875 81.190643310546875"></polygon>
      </g>
      <g>
        <line x1="325.0010986328125" y1="77.201583862304688" x2="344.260101318359375" y2="77.201583862304688" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="343.092926025390625 81.190643310546875 350.0010986328125 77.201583862304688 343.092926025390625 73.212516784667969 343.092926025390625 81.190643310546875"></polygon>
      </g>
      <g>
        <rect x="525.002136832787073" y="52.201583862304688" width="150" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(554.381072998046875 80.708297729492188)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">v4l2h264dec</tspan></text>
      </g>
      <g>
        <line x1="675.002166748046875" y1="77.201583862304688" x2="694.261138916015625" y2="77.201583862304688" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="693.093963623046875 81.190643310546875 700.002166748046875 77.201583862304688 693.093963623046875 73.212516784667969 693.093963623046875 81.190643310546875"></polygon>
      </g>
      <g>
        <rect x="700.002136832787073" y="52.201583862304688" width="150" height="50" rx="4" ry="4" style="fill: #2a2aea;"></rect>
        <text transform="translate(740.43963623046875 80.708297729492188)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">qtioverlay</tspan></text>
      </g>
      <g>
        <line x1="850.002166748046875" y1="77.201583862304688" x2="869.261138916015625" y2="77.201583862304688" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="868.093963623046875 81.190643310546875 875.002166748046875 77.201583862304688 868.093963623046875 73.212516784667969 868.093963623046875 81.190643310546875"></polygon>
      </g>
      <g>
        <rect x="875.002136832787073" y="52.201583862304688" width="150.000000000003638" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(906.099945068359375 80.708297729492188)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">waylandsink</tspan></text>
      </g>
      <g>
        <rect x="20.001098030495086" y="52.201583862304688" width="139.999999999999091" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(68.083160400390625 80.708297729492188)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">filesrc</tspan></text>
      </g>
      <g>
        <line x1="160.0010986328125" y1="77.201583862304688" x2="179.260101318359375" y2="77.201583862304688" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="178.092926025390625 81.190643310546875 185.0010986328125 77.201583862304688 178.092926025390625 73.212516784667969 178.092926025390625 81.190643310546875"></polygon>
      </g>
      <g>
        <rect x="185.001098030494177" y="52.201583862304688" width="140" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(223.704254150390625 80.708297729492188)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">qtdemux</tspan></text>
      </g>
    </g>
    <text transform="translate(492.107086181640625 31.536170959472656)" style="font-family: Roboto-Bold, Roboto; font-size: 16px; font-weight: 700;"><tspan x="0" y="0">GST BIN</tspan></text>
  </g>
</svg>
- Overlay on a live stream from a
                    camera:

        setprop persist.overlay.use_c2d_blit 2Copy to clipboard

        gst-launch-1.0 -e qtiqmmfsrc name=camsrc video_0::type=video video_1::type=preview ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! qtioverlay overlay-text="text0, text=\"Qualcomm\ Intelligence\", color=(uint)0xFFFF00FF, dest-rect=<160, 624, 944, 50>;" ! waylandsink fullscreen=trueCopy to clipboard

Figure : Pipeline for text overlay on video–camera source
                    
                    <?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="570" height="149.842067718505859" viewbox="0 0 570 149.842067718505859">
  <g id="Layer_1" data-name="Layer 1">
    <g>
      <rect x=".5" y=".500179290771484" width="569" height="148.841796875" rx="7.499999999999997" ry="7.499999999999997" style="fill: #fafafa;"></rect>
      <path d="M562,1c3.85980224609375,0,7,3.140216827392578,7,7v133.842067718505859c0,3.859786987304688-3.14019775390625,7-7,7H8c-3.859771728515625,0-7-3.140213012695312-7-7V8c0-3.859783172607422,3.140228271484375-7,7-7h554M562,0H8C3.58172607421875,0,0,3.581714630126953,0,8v133.842067718505859c0,4.418289184570312,3.58172607421875,8,8,8h554c4.41827392578125,0,8-3.581710815429688,8-8V8c0-4.418285369873047-3.58172607421875-8-8-8h0Z" style="fill: #d2d7e1;"></path>
    </g>
    <text transform="translate(254.161079406738281 31.536102294921875)" style="font-family: Roboto-Bold, Roboto; font-size: 16px; font-weight: 700;"><tspan x="0" y="0">GST BIN</tspan></text>
    <g>
      <g>
        <text transform="translate(367.49224853515625 125.933559417724609)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Qualcomm </tspan></text>
        <rect x="347.241281918222739" y="113.842067718505859" width="16" height="16" rx="2" ry="2" style="fill: #2a2aea;"></rect>
      </g>
      <g>
        <text transform="translate(466.0740966796875 125.933559417724609)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Open source</tspan></text>
        <rect x="445.823063331081357" y="113.842067718505859" width="16" height="16" rx="2" ry="2" style="fill: #007884;"></rect>
      </g>
    </g>
  </g>
  <g id="Layer_2" data-name="Layer 2">
    <g>
      <g>
        <rect x="205" y="43.842043822251981" width="160" height="50.000000000000909" rx="4" ry="4" style="fill: #2a2aea;"></rect>
        <text transform="translate(250.437530517578125 72.3487548828125)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">qtioverlay</tspan></text>
      </g>
      <g>
        <line x1="365" y1="68.842044830322266" x2="384.259033203125" y2="68.842044830322266" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="383.091796875 72.831111907959894 390 68.842044830322266 383.091796875 64.852977752685547 383.091796875 72.831111907959894"></polygon>
      </g>
      <g>
        <line x1="180" y1="68.842044830322266" x2="199.259033203125" y2="68.842044830322266" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="198.091796875 72.831111907959894 205 68.842044830322266 198.091796875 64.852977752685547 198.091796875 72.831111907959894"></polygon>
      </g>
      <g>
        <rect x="390" y="43.842043822251981" width="160" height="50.000000000000909" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(426.097686767578125 72.3487548828125)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">waylandsink</tspan></text>
      </g>
      <g>
        <rect x="20" y="43.842043822251981" width="160" height="50.000000000000909" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(73.429718017578125 72.3487548828125)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">camsrc</tspan></text>
      </g>
    </g>
  </g>
</svg>

## Date and time overlay

Source: [https://docs.qualcomm.com/doc/80-70022-50/topic/overlay-use-cases.html](https://docs.qualcomm.com/doc/80-70022-50/topic/overlay-use-cases.html)

This use case shows the date (in MMDDYYYY) and time (in HHMMSS) to be overlaid on the
        video stream.

Run the following use cases on the target device:

- Overlay on a
                    video:

        setprop persist.overlay.use_c2d_blit 2Copy to clipboard

        gst-launch-1.0 filesrc location=/opt/<H264_file>.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! qtioverlay overlay-date="date0, date-format=\"MMDDYYYY\", time-format=\"HHMMSS_24HR\", color=(uint)0xFF00FFFF, dest-rect=<400, 400, 256, 80>;" ! waylandsink fullscreen=trueCopy to clipboard

Figure : Pipeline for text date and time overlay on video–file source
                    
                    <?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="1045.002105712890625" height="158.201599121094659" viewbox="0 0 1045.002105712890625 158.201599121094659">
  <g id="Layer_1" data-name="Layer 1">
    <g>
      <rect x=".500152587890625" y=".49981689453125" width="1044.00244140625" height="157.20166015625" rx="7.499999999999986" ry="7.499999999999986" style="fill: #fafafa;"></rect>
      <path d="M1037.002105712890625,1c3.85986328125,0,7,3.140132904052734,7,7v142.201599121094659c0,3.85986328125-3.14013671875,7-7,7H8c-3.85986328125,0-7-3.14013671875-7-7V8c0-3.859867095947266,3.14013671875-7,7-7h1029.002105712890625M1037.002105712890625,0H8C3.581733703613281,0,0,3.581733703613281,0,8v142.201599121094659c0,4.418273925780341,3.581733703613281,8,8,8h1029.002105712890625c4.418334960939319,0,8-3.581726074219659,8-8V8c0-4.418266296386719-3.581665039060681-8-8-8h0Z" style="fill: #d2d7e1;"></path>
    </g>
    <g>
      <g>
        <text transform="translate(843.858642578125 134.2930908203125)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Qualcomm </tspan></text>
        <rect x="823.607641423212044" y="122.201599121094659" width="16" height="16" rx="2" ry="2" style="fill: #2a2aea;"></rect>
      </g>
      <g>
        <text transform="translate(942.4404296875 134.2930908203125)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Open source</tspan></text>
        <rect x="922.189422836070662" y="122.201599121094659" width="16" height="16" rx="2" ry="2" style="fill: #007884;"></rect>
      </g>
    </g>
  </g>
  <g id="Layer_2" data-name="Layer 2">
    <g>
      <g>
        <rect x="350.002136832787073" y="52.201583862304688" width="150.000000000000909" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(387.209197998046875 80.708297729492188)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">h264parse</tspan></text>
      </g>
      <g>
        <line x1="500.002166748046875" y1="77.201583862304688" x2="519.261138916015625" y2="77.201583862304688" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="518.093963623046875 81.190643310546875 525.002166748046875 77.201583862304688 518.093963623046875 73.212516784667969 518.093963623046875 81.190643310546875"></polygon>
      </g>
      <g>
        <line x1="325.0010986328125" y1="77.201583862304688" x2="344.260101318359375" y2="77.201583862304688" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="343.092926025390625 81.190643310546875 350.0010986328125 77.201583862304688 343.092926025390625 73.212516784667969 343.092926025390625 81.190643310546875"></polygon>
      </g>
      <g>
        <rect x="525.002136832787073" y="52.201583862304688" width="150" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(554.381072998046875 80.708297729492188)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">v4l2h264dec</tspan></text>
      </g>
      <g>
        <line x1="675.002166748046875" y1="77.201583862304688" x2="694.261138916015625" y2="77.201583862304688" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="693.093963623046875 81.190643310546875 700.002166748046875 77.201583862304688 693.093963623046875 73.212516784667969 693.093963623046875 81.190643310546875"></polygon>
      </g>
      <g>
        <rect x="700.002136832787073" y="52.201583862304688" width="150" height="50" rx="4" ry="4" style="fill: #2a2aea;"></rect>
        <text transform="translate(740.43963623046875 80.708297729492188)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">qtioverlay</tspan></text>
      </g>
      <g>
        <line x1="850.002166748046875" y1="77.201583862304688" x2="869.261138916015625" y2="77.201583862304688" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="868.093963623046875 81.190643310546875 875.002166748046875 77.201583862304688 868.093963623046875 73.212516784667969 868.093963623046875 81.190643310546875"></polygon>
      </g>
      <g>
        <rect x="875.002136832787073" y="52.201583862304688" width="150.000000000003638" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(906.099945068359375 80.708297729492188)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">waylandsink</tspan></text>
      </g>
      <g>
        <rect x="20.001098030495086" y="52.201583862304688" width="139.999999999999091" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(68.083160400390625 80.708297729492188)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">filesrc</tspan></text>
      </g>
      <g>
        <line x1="160.0010986328125" y1="77.201583862304688" x2="179.260101318359375" y2="77.201583862304688" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="178.092926025390625 81.190643310546875 185.0010986328125 77.201583862304688 178.092926025390625 73.212516784667969 178.092926025390625 81.190643310546875"></polygon>
      </g>
      <g>
        <rect x="185.001098030494177" y="52.201583862304688" width="140" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(223.704254150390625 80.708297729492188)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">qtdemux</tspan></text>
      </g>
    </g>
    <text transform="translate(492.107086181640625 31.536170959472656)" style="font-family: Roboto-Bold, Roboto; font-size: 16px; font-weight: 700;"><tspan x="0" y="0">GST BIN</tspan></text>
  </g>
</svg>
- Overlay on a live stream from a
                    camera:

        setprop persist.overlay.use_c2d_blit 2Copy to clipboard

        gst-launch-1.0 -e qtiqmmfsrc name=camsrc video_0::type=video video_1::type=preview ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! qtioverlay overlay-date="date0, date-format=\"MMDDYYYY\", time-format= \"HHMMSS_24HR\", color=(uint)0xFF00FFFF, dest-rect=<400, 400, 256, 80>;" ! waylandsink fullscreen=trueCopy to clipboard

Figure : Pipeline for text date and time overlay on video–camera source
                    
                    <?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="570" height="149.842067718505859" viewbox="0 0 570 149.842067718505859">
  <g id="Layer_1" data-name="Layer 1">
    <g>
      <rect x=".5" y=".500179290771484" width="569" height="148.841796875" rx="7.499999999999997" ry="7.499999999999997" style="fill: #fafafa;"></rect>
      <path d="M562,1c3.85980224609375,0,7,3.140216827392578,7,7v133.842067718505859c0,3.859786987304688-3.14019775390625,7-7,7H8c-3.859771728515625,0-7-3.140213012695312-7-7V8c0-3.859783172607422,3.140228271484375-7,7-7h554M562,0H8C3.58172607421875,0,0,3.581714630126953,0,8v133.842067718505859c0,4.418289184570312,3.58172607421875,8,8,8h554c4.41827392578125,0,8-3.581710815429688,8-8V8c0-4.418285369873047-3.58172607421875-8-8-8h0Z" style="fill: #d2d7e1;"></path>
    </g>
    <text transform="translate(254.161079406738281 31.536102294921875)" style="font-family: Roboto-Bold, Roboto; font-size: 16px; font-weight: 700;"><tspan x="0" y="0">GST BIN</tspan></text>
    <g>
      <g>
        <text transform="translate(367.49224853515625 125.933559417724609)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Qualcomm </tspan></text>
        <rect x="347.241281918222739" y="113.842067718505859" width="16" height="16" rx="2" ry="2" style="fill: #2a2aea;"></rect>
      </g>
      <g>
        <text transform="translate(466.0740966796875 125.933559417724609)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Open source</tspan></text>
        <rect x="445.823063331081357" y="113.842067718505859" width="16" height="16" rx="2" ry="2" style="fill: #007884;"></rect>
      </g>
    </g>
  </g>
  <g id="Layer_2" data-name="Layer 2">
    <g>
      <g>
        <rect x="205" y="43.842043822251981" width="160" height="50.000000000000909" rx="4" ry="4" style="fill: #2a2aea;"></rect>
        <text transform="translate(250.437530517578125 72.3487548828125)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">qtioverlay</tspan></text>
      </g>
      <g>
        <line x1="365" y1="68.842044830322266" x2="384.259033203125" y2="68.842044830322266" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="383.091796875 72.831111907959894 390 68.842044830322266 383.091796875 64.852977752685547 383.091796875 72.831111907959894"></polygon>
      </g>
      <g>
        <line x1="180" y1="68.842044830322266" x2="199.259033203125" y2="68.842044830322266" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="198.091796875 72.831111907959894 205 68.842044830322266 198.091796875 64.852977752685547 198.091796875 72.831111907959894"></polygon>
      </g>
      <g>
        <rect x="390" y="43.842043822251981" width="160" height="50.000000000000909" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(426.097686767578125 72.3487548828125)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">waylandsink</tspan></text>
      </g>
      <g>
        <rect x="20" y="43.842043822251981" width="160" height="50.000000000000909" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(73.429718017578125 72.3487548828125)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">camsrc</tspan></text>
      </g>
    </g>
  </g>
</svg>

## Static image overlay

Source: [https://docs.qualcomm.com/doc/80-70022-50/topic/overlay-use-cases.html](https://docs.qualcomm.com/doc/80-70022-50/topic/overlay-use-cases.html)

This use case shows how to overlay a static image on a video stream.

1. In the terminal of the Linux host computer, run the following command to push the
                static image to the target
                device:

        scp -r <static_image>.rgba  root@[DEVICE IP-ADDR]:/optCopy to clipboard
2. Run the use cases on the target device:
    - Overlay on a
                            video:

            setprop persist.overlay.use_c2d_blit 2Copy to clipboard

            gst-launch-1.0 filesrc location=/opt/<H264_file>.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! qtioverlay overlay-simg="image0, image=\"/opt/overlay_test_464_109.rgba\", resolution=<464, 109>, dest-rect=<140, 130, 464, 109>;" ! waylandsink fullscreen=trueCopy to clipboard

Figure : Pipeline for static image overlay on video–file source
                            
                            <?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="1045.002105712890625" height="158.201599121094659" viewbox="0 0 1045.002105712890625 158.201599121094659">
  <g id="Layer_1" data-name="Layer 1">
    <g>
      <rect x=".500152587890625" y=".49981689453125" width="1044.00244140625" height="157.20166015625" rx="7.499999999999986" ry="7.499999999999986" style="fill: #fafafa;"></rect>
      <path d="M1037.002105712890625,1c3.85986328125,0,7,3.140132904052734,7,7v142.201599121094659c0,3.85986328125-3.14013671875,7-7,7H8c-3.85986328125,0-7-3.14013671875-7-7V8c0-3.859867095947266,3.14013671875-7,7-7h1029.002105712890625M1037.002105712890625,0H8C3.581733703613281,0,0,3.581733703613281,0,8v142.201599121094659c0,4.418273925780341,3.581733703613281,8,8,8h1029.002105712890625c4.418334960939319,0,8-3.581726074219659,8-8V8c0-4.418266296386719-3.581665039060681-8-8-8h0Z" style="fill: #d2d7e1;"></path>
    </g>
    <g>
      <g>
        <text transform="translate(843.858642578125 134.2930908203125)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Qualcomm </tspan></text>
        <rect x="823.607641423212044" y="122.201599121094659" width="16" height="16" rx="2" ry="2" style="fill: #2a2aea;"></rect>
      </g>
      <g>
        <text transform="translate(942.4404296875 134.2930908203125)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Open source</tspan></text>
        <rect x="922.189422836070662" y="122.201599121094659" width="16" height="16" rx="2" ry="2" style="fill: #007884;"></rect>
      </g>
    </g>
  </g>
  <g id="Layer_2" data-name="Layer 2">
    <g>
      <g>
        <rect x="350.002136832787073" y="52.201583862304688" width="150.000000000000909" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(387.209197998046875 80.708297729492188)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">h264parse</tspan></text>
      </g>
      <g>
        <line x1="500.002166748046875" y1="77.201583862304688" x2="519.261138916015625" y2="77.201583862304688" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="518.093963623046875 81.190643310546875 525.002166748046875 77.201583862304688 518.093963623046875 73.212516784667969 518.093963623046875 81.190643310546875"></polygon>
      </g>
      <g>
        <line x1="325.0010986328125" y1="77.201583862304688" x2="344.260101318359375" y2="77.201583862304688" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="343.092926025390625 81.190643310546875 350.0010986328125 77.201583862304688 343.092926025390625 73.212516784667969 343.092926025390625 81.190643310546875"></polygon>
      </g>
      <g>
        <rect x="525.002136832787073" y="52.201583862304688" width="150" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(554.381072998046875 80.708297729492188)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">v4l2h264dec</tspan></text>
      </g>
      <g>
        <line x1="675.002166748046875" y1="77.201583862304688" x2="694.261138916015625" y2="77.201583862304688" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="693.093963623046875 81.190643310546875 700.002166748046875 77.201583862304688 693.093963623046875 73.212516784667969 693.093963623046875 81.190643310546875"></polygon>
      </g>
      <g>
        <rect x="700.002136832787073" y="52.201583862304688" width="150" height="50" rx="4" ry="4" style="fill: #2a2aea;"></rect>
        <text transform="translate(740.43963623046875 80.708297729492188)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">qtioverlay</tspan></text>
      </g>
      <g>
        <line x1="850.002166748046875" y1="77.201583862304688" x2="869.261138916015625" y2="77.201583862304688" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="868.093963623046875 81.190643310546875 875.002166748046875 77.201583862304688 868.093963623046875 73.212516784667969 868.093963623046875 81.190643310546875"></polygon>
      </g>
      <g>
        <rect x="875.002136832787073" y="52.201583862304688" width="150.000000000003638" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(906.099945068359375 80.708297729492188)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">waylandsink</tspan></text>
      </g>
      <g>
        <rect x="20.001098030495086" y="52.201583862304688" width="139.999999999999091" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(68.083160400390625 80.708297729492188)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">filesrc</tspan></text>
      </g>
      <g>
        <line x1="160.0010986328125" y1="77.201583862304688" x2="179.260101318359375" y2="77.201583862304688" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="178.092926025390625 81.190643310546875 185.0010986328125 77.201583862304688 178.092926025390625 73.212516784667969 178.092926025390625 81.190643310546875"></polygon>
      </g>
      <g>
        <rect x="185.001098030494177" y="52.201583862304688" width="140" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(223.704254150390625 80.708297729492188)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">qtdemux</tspan></text>
      </g>
    </g>
    <text transform="translate(492.107086181640625 31.536170959472656)" style="font-family: Roboto-Bold, Roboto; font-size: 16px; font-weight: 700;"><tspan x="0" y="0">GST BIN</tspan></text>
  </g>
</svg>
    - Overlay on alive stream from a
                            camera:

            setprop persist.overlay.use_c2d_blit 2Copy to clipboard

            gst-launch-1.0 -e qtiqmmfsrc name=camsrc video_0::type=video video_1::type=preview ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! qtioverlay overlay-simg="image0, image=\"/opt/overlay_test_464_109.rgba\", resolution=<464, 109>, dest-rect=<140, 130, 464, 109>;" ! waylandsink fullscreen=trueCopy to clipboard

Figure : Pipeline for static image overlay on video–camera source
                            
                            <?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="570" height="149.842067718505859" viewbox="0 0 570 149.842067718505859">
  <g id="Layer_1" data-name="Layer 1">
    <g>
      <rect x=".5" y=".500179290771484" width="569" height="148.841796875" rx="7.499999999999997" ry="7.499999999999997" style="fill: #fafafa;"></rect>
      <path d="M562,1c3.85980224609375,0,7,3.140216827392578,7,7v133.842067718505859c0,3.859786987304688-3.14019775390625,7-7,7H8c-3.859771728515625,0-7-3.140213012695312-7-7V8c0-3.859783172607422,3.140228271484375-7,7-7h554M562,0H8C3.58172607421875,0,0,3.581714630126953,0,8v133.842067718505859c0,4.418289184570312,3.58172607421875,8,8,8h554c4.41827392578125,0,8-3.581710815429688,8-8V8c0-4.418285369873047-3.58172607421875-8-8-8h0Z" style="fill: #d2d7e1;"></path>
    </g>
    <text transform="translate(254.161079406738281 31.536102294921875)" style="font-family: Roboto-Bold, Roboto; font-size: 16px; font-weight: 700;"><tspan x="0" y="0">GST BIN</tspan></text>
    <g>
      <g>
        <text transform="translate(367.49224853515625 125.933559417724609)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Qualcomm </tspan></text>
        <rect x="347.241281918222739" y="113.842067718505859" width="16" height="16" rx="2" ry="2" style="fill: #2a2aea;"></rect>
      </g>
      <g>
        <text transform="translate(466.0740966796875 125.933559417724609)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Open source</tspan></text>
        <rect x="445.823063331081357" y="113.842067718505859" width="16" height="16" rx="2" ry="2" style="fill: #007884;"></rect>
      </g>
    </g>
  </g>
  <g id="Layer_2" data-name="Layer 2">
    <g>
      <g>
        <rect x="205" y="43.842043822251981" width="160" height="50.000000000000909" rx="4" ry="4" style="fill: #2a2aea;"></rect>
        <text transform="translate(250.437530517578125 72.3487548828125)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">qtioverlay</tspan></text>
      </g>
      <g>
        <line x1="365" y1="68.842044830322266" x2="384.259033203125" y2="68.842044830322266" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="383.091796875 72.831111907959894 390 68.842044830322266 383.091796875 64.852977752685547 383.091796875 72.831111907959894"></polygon>
      </g>
      <g>
        <line x1="180" y1="68.842044830322266" x2="199.259033203125" y2="68.842044830322266" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="198.091796875 72.831111907959894 205 68.842044830322266 198.091796875 64.852977752685547 198.091796875 72.831111907959894"></polygon>
      </g>
      <g>
        <rect x="390" y="43.842043822251981" width="160" height="50.000000000000909" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(426.097686767578125 72.3487548828125)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">waylandsink</tspan></text>
      </g>
      <g>
        <rect x="20" y="43.842043822251981" width="160" height="50.000000000000909" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(73.429718017578125 72.3487548828125)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">camsrc</tspan></text>
      </g>
    </g>
  </g>
</svg>

## Bounding box overlay

Source: [https://docs.qualcomm.com/doc/80-70022-50/topic/overlay-use-cases.html](https://docs.qualcomm.com/doc/80-70022-50/topic/overlay-use-cases.html)

This use case shows how to overlay a bounding box with a label on the video
        stream.

Run the following use cases on the target device:

- Overlay on a video:

        setprop persist.overlay.use_c2d_blit 2Copy to clipboard

        gst-launch-1.0 filesrc location=/opt/<H264_file>.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! qtioverlay overlay-bbox="bbox0, bbox=<140, 130, 100, 100>, label="Pet", color=0x0000FFFF;" ! waylandsink fullscreen=trueCopy to clipboard

Figure : Pipeline for bounding box overlay on video–file source
                    
                    <?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="1045.002105712890625" height="158.201599121094659" viewbox="0 0 1045.002105712890625 158.201599121094659">
  <g id="Layer_1" data-name="Layer 1">
    <g>
      <rect x=".500152587890625" y=".49981689453125" width="1044.00244140625" height="157.20166015625" rx="7.499999999999986" ry="7.499999999999986" style="fill: #fafafa;"></rect>
      <path d="M1037.002105712890625,1c3.85986328125,0,7,3.140132904052734,7,7v142.201599121094659c0,3.85986328125-3.14013671875,7-7,7H8c-3.85986328125,0-7-3.14013671875-7-7V8c0-3.859867095947266,3.14013671875-7,7-7h1029.002105712890625M1037.002105712890625,0H8C3.581733703613281,0,0,3.581733703613281,0,8v142.201599121094659c0,4.418273925780341,3.581733703613281,8,8,8h1029.002105712890625c4.418334960939319,0,8-3.581726074219659,8-8V8c0-4.418266296386719-3.581665039060681-8-8-8h0Z" style="fill: #d2d7e1;"></path>
    </g>
    <g>
      <g>
        <text transform="translate(843.858642578125 134.2930908203125)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Qualcomm </tspan></text>
        <rect x="823.607641423212044" y="122.201599121094659" width="16" height="16" rx="2" ry="2" style="fill: #2a2aea;"></rect>
      </g>
      <g>
        <text transform="translate(942.4404296875 134.2930908203125)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Open source</tspan></text>
        <rect x="922.189422836070662" y="122.201599121094659" width="16" height="16" rx="2" ry="2" style="fill: #007884;"></rect>
      </g>
    </g>
  </g>
  <g id="Layer_2" data-name="Layer 2">
    <g>
      <g>
        <rect x="350.002136832787073" y="52.201583862304688" width="150.000000000000909" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(387.209197998046875 80.708297729492188)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">h264parse</tspan></text>
      </g>
      <g>
        <line x1="500.002166748046875" y1="77.201583862304688" x2="519.261138916015625" y2="77.201583862304688" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="518.093963623046875 81.190643310546875 525.002166748046875 77.201583862304688 518.093963623046875 73.212516784667969 518.093963623046875 81.190643310546875"></polygon>
      </g>
      <g>
        <line x1="325.0010986328125" y1="77.201583862304688" x2="344.260101318359375" y2="77.201583862304688" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="343.092926025390625 81.190643310546875 350.0010986328125 77.201583862304688 343.092926025390625 73.212516784667969 343.092926025390625 81.190643310546875"></polygon>
      </g>
      <g>
        <rect x="525.002136832787073" y="52.201583862304688" width="150" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(554.381072998046875 80.708297729492188)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">v4l2h264dec</tspan></text>
      </g>
      <g>
        <line x1="675.002166748046875" y1="77.201583862304688" x2="694.261138916015625" y2="77.201583862304688" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="693.093963623046875 81.190643310546875 700.002166748046875 77.201583862304688 693.093963623046875 73.212516784667969 693.093963623046875 81.190643310546875"></polygon>
      </g>
      <g>
        <rect x="700.002136832787073" y="52.201583862304688" width="150" height="50" rx="4" ry="4" style="fill: #2a2aea;"></rect>
        <text transform="translate(740.43963623046875 80.708297729492188)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">qtioverlay</tspan></text>
      </g>
      <g>
        <line x1="850.002166748046875" y1="77.201583862304688" x2="869.261138916015625" y2="77.201583862304688" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="868.093963623046875 81.190643310546875 875.002166748046875 77.201583862304688 868.093963623046875 73.212516784667969 868.093963623046875 81.190643310546875"></polygon>
      </g>
      <g>
        <rect x="875.002136832787073" y="52.201583862304688" width="150.000000000003638" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(906.099945068359375 80.708297729492188)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">waylandsink</tspan></text>
      </g>
      <g>
        <rect x="20.001098030495086" y="52.201583862304688" width="139.999999999999091" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(68.083160400390625 80.708297729492188)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">filesrc</tspan></text>
      </g>
      <g>
        <line x1="160.0010986328125" y1="77.201583862304688" x2="179.260101318359375" y2="77.201583862304688" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="178.092926025390625 81.190643310546875 185.0010986328125 77.201583862304688 178.092926025390625 73.212516784667969 178.092926025390625 81.190643310546875"></polygon>
      </g>
      <g>
        <rect x="185.001098030494177" y="52.201583862304688" width="140" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(223.704254150390625 80.708297729492188)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">qtdemux</tspan></text>
      </g>
    </g>
    <text transform="translate(492.107086181640625 31.536170959472656)" style="font-family: Roboto-Bold, Roboto; font-size: 16px; font-weight: 700;"><tspan x="0" y="0">GST BIN</tspan></text>
  </g>
</svg>
- Overlay on a live stream from a camera:

        setprop persist.overlay.use_c2d_blit 2Copy to clipboard

        gst-launch-1.0 -e qtiqmmfsrc ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1,compression=ubwc ! qtioverlay overlay-bbox="bbox0, bbox=<140, 130, 100, 100>, label="Pet", color=0x0000FFFF;" ! waylandsink fullscreen=trueCopy to clipboard

Figure : Pipeline for bounding box overlay on video–camera source
                    
                    <?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="570" height="149.842067718505859" viewbox="0 0 570 149.842067718505859">
  <g id="Layer_1" data-name="Layer 1">
    <g>
      <rect x=".5" y=".500179290771484" width="569" height="148.841796875" rx="7.499999999999997" ry="7.499999999999997" style="fill: #fafafa;"></rect>
      <path d="M562,1c3.85980224609375,0,7,3.140216827392578,7,7v133.842067718505859c0,3.859786987304688-3.14019775390625,7-7,7H8c-3.859771728515625,0-7-3.140213012695312-7-7V8c0-3.859783172607422,3.140228271484375-7,7-7h554M562,0H8C3.58172607421875,0,0,3.581714630126953,0,8v133.842067718505859c0,4.418289184570312,3.58172607421875,8,8,8h554c4.41827392578125,0,8-3.581710815429688,8-8V8c0-4.418285369873047-3.58172607421875-8-8-8h0Z" style="fill: #d2d7e1;"></path>
    </g>
    <text transform="translate(254.161079406738281 31.536102294921875)" style="font-family: Roboto-Bold, Roboto; font-size: 16px; font-weight: 700;"><tspan x="0" y="0">GST BIN</tspan></text>
    <g>
      <g>
        <text transform="translate(367.49224853515625 125.933559417724609)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Qualcomm </tspan></text>
        <rect x="347.241281918222739" y="113.842067718505859" width="16" height="16" rx="2" ry="2" style="fill: #2a2aea;"></rect>
      </g>
      <g>
        <text transform="translate(466.0740966796875 125.933559417724609)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Open source</tspan></text>
        <rect x="445.823063331081357" y="113.842067718505859" width="16" height="16" rx="2" ry="2" style="fill: #007884;"></rect>
      </g>
    </g>
  </g>
  <g id="Layer_2" data-name="Layer 2">
    <g>
      <g>
        <rect x="205" y="43.842043822251981" width="160" height="50.000000000000909" rx="4" ry="4" style="fill: #2a2aea;"></rect>
        <text transform="translate(250.437530517578125 72.3487548828125)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">qtioverlay</tspan></text>
      </g>
      <g>
        <line x1="365" y1="68.842044830322266" x2="384.259033203125" y2="68.842044830322266" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="383.091796875 72.831111907959894 390 68.842044830322266 383.091796875 64.852977752685547 383.091796875 72.831111907959894"></polygon>
      </g>
      <g>
        <line x1="180" y1="68.842044830322266" x2="199.259033203125" y2="68.842044830322266" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="198.091796875 72.831111907959894 205 68.842044830322266 198.091796875 64.852977752685547 198.091796875 72.831111907959894"></polygon>
      </g>
      <g>
        <rect x="390" y="43.842043822251981" width="160" height="50.000000000000909" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(426.097686767578125 72.3487548828125)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">waylandsink</tspan></text>
      </g>
      <g>
        <rect x="20" y="43.842043822251981" width="160" height="50.000000000000909" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(73.429718017578125 72.3487548828125)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">camsrc</tspan></text>
      </g>
    </g>
  </g>
</svg>

## Inverse privacy mask

Source: [https://docs.qualcomm.com/doc/80-70022-50/topic/overlay-use-cases.html](https://docs.qualcomm.com/doc/80-70022-50/topic/overlay-use-cases.html)

This use case shows how to overlay the inverse privacy mask on the video
        stream.

The inverse privacy mask is applied on all other regions except the *circle* in the
                *overlay-mask* property.

Run the following use cases on the target device:

- Overlay on a video:

        setprop persist.overlay.use_c2d_blit 2Copy to clipboard

        gst-launch-1.0 filesrc location=/opt/<H264_file>.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! qtioverlay overlay-mask="mask0, circle=<960, 540, 400>, inverse=false, dest-rect=<0, 0, 1920, 1080>, color=0x202020FF" ! waylandsink fullscreen=trueCopy to clipboard

Figure : Pipeline for inverse privacy mask overlay on video–file source
                    
                    <?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="1045.002105712890625" height="158.201599121094659" viewbox="0 0 1045.002105712890625 158.201599121094659">
  <g id="Layer_1" data-name="Layer 1">
    <g>
      <rect x=".500152587890625" y=".49981689453125" width="1044.00244140625" height="157.20166015625" rx="7.499999999999986" ry="7.499999999999986" style="fill: #fafafa;"></rect>
      <path d="M1037.002105712890625,1c3.85986328125,0,7,3.140132904052734,7,7v142.201599121094659c0,3.85986328125-3.14013671875,7-7,7H8c-3.85986328125,0-7-3.14013671875-7-7V8c0-3.859867095947266,3.14013671875-7,7-7h1029.002105712890625M1037.002105712890625,0H8C3.581733703613281,0,0,3.581733703613281,0,8v142.201599121094659c0,4.418273925780341,3.581733703613281,8,8,8h1029.002105712890625c4.418334960939319,0,8-3.581726074219659,8-8V8c0-4.418266296386719-3.581665039060681-8-8-8h0Z" style="fill: #d2d7e1;"></path>
    </g>
    <g>
      <g>
        <text transform="translate(843.858642578125 134.2930908203125)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Qualcomm </tspan></text>
        <rect x="823.607641423212044" y="122.201599121094659" width="16" height="16" rx="2" ry="2" style="fill: #2a2aea;"></rect>
      </g>
      <g>
        <text transform="translate(942.4404296875 134.2930908203125)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Open source</tspan></text>
        <rect x="922.189422836070662" y="122.201599121094659" width="16" height="16" rx="2" ry="2" style="fill: #007884;"></rect>
      </g>
    </g>
  </g>
  <g id="Layer_2" data-name="Layer 2">
    <g>
      <g>
        <rect x="350.002136832787073" y="52.201583862304688" width="150.000000000000909" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(387.209197998046875 80.708297729492188)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">h264parse</tspan></text>
      </g>
      <g>
        <line x1="500.002166748046875" y1="77.201583862304688" x2="519.261138916015625" y2="77.201583862304688" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="518.093963623046875 81.190643310546875 525.002166748046875 77.201583862304688 518.093963623046875 73.212516784667969 518.093963623046875 81.190643310546875"></polygon>
      </g>
      <g>
        <line x1="325.0010986328125" y1="77.201583862304688" x2="344.260101318359375" y2="77.201583862304688" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="343.092926025390625 81.190643310546875 350.0010986328125 77.201583862304688 343.092926025390625 73.212516784667969 343.092926025390625 81.190643310546875"></polygon>
      </g>
      <g>
        <rect x="525.002136832787073" y="52.201583862304688" width="150" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(554.381072998046875 80.708297729492188)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">v4l2h264dec</tspan></text>
      </g>
      <g>
        <line x1="675.002166748046875" y1="77.201583862304688" x2="694.261138916015625" y2="77.201583862304688" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="693.093963623046875 81.190643310546875 700.002166748046875 77.201583862304688 693.093963623046875 73.212516784667969 693.093963623046875 81.190643310546875"></polygon>
      </g>
      <g>
        <rect x="700.002136832787073" y="52.201583862304688" width="150" height="50" rx="4" ry="4" style="fill: #2a2aea;"></rect>
        <text transform="translate(740.43963623046875 80.708297729492188)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">qtioverlay</tspan></text>
      </g>
      <g>
        <line x1="850.002166748046875" y1="77.201583862304688" x2="869.261138916015625" y2="77.201583862304688" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="868.093963623046875 81.190643310546875 875.002166748046875 77.201583862304688 868.093963623046875 73.212516784667969 868.093963623046875 81.190643310546875"></polygon>
      </g>
      <g>
        <rect x="875.002136832787073" y="52.201583862304688" width="150.000000000003638" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(906.099945068359375 80.708297729492188)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">waylandsink</tspan></text>
      </g>
      <g>
        <rect x="20.001098030495086" y="52.201583862304688" width="139.999999999999091" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(68.083160400390625 80.708297729492188)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">filesrc</tspan></text>
      </g>
      <g>
        <line x1="160.0010986328125" y1="77.201583862304688" x2="179.260101318359375" y2="77.201583862304688" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="178.092926025390625 81.190643310546875 185.0010986328125 77.201583862304688 178.092926025390625 73.212516784667969 178.092926025390625 81.190643310546875"></polygon>
      </g>
      <g>
        <rect x="185.001098030494177" y="52.201583862304688" width="140" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(223.704254150390625 80.708297729492188)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">qtdemux</tspan></text>
      </g>
    </g>
    <text transform="translate(492.107086181640625 31.536170959472656)" style="font-family: Roboto-Bold, Roboto; font-size: 16px; font-weight: 700;"><tspan x="0" y="0">GST BIN</tspan></text>
  </g>
</svg>
- Overlay on a live stream from a camera:

        setprop persist.overlay.use_c2d_blit 2Copy to clipboard

        gst-launch-1.0 -e qtiqmmfsrc ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! qtioverlay overlay-mask="mask0, circle=<960, 540, 400>, inverse=false, dest-rect=<0, 0, 1920, 1080>, color=0x202020FF" ! waylandsink fullscreen=trueCopy to clipboard

Figure : Pipeline for inverse privacy mask overlay on video–camera source
                    
                    <?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="570" height="149.842067718505859" viewbox="0 0 570 149.842067718505859">
  <g id="Layer_1" data-name="Layer 1">
    <g>
      <rect x=".5" y=".500179290771484" width="569" height="148.841796875" rx="7.499999999999997" ry="7.499999999999997" style="fill: #fafafa;"></rect>
      <path d="M562,1c3.85980224609375,0,7,3.140216827392578,7,7v133.842067718505859c0,3.859786987304688-3.14019775390625,7-7,7H8c-3.859771728515625,0-7-3.140213012695312-7-7V8c0-3.859783172607422,3.140228271484375-7,7-7h554M562,0H8C3.58172607421875,0,0,3.581714630126953,0,8v133.842067718505859c0,4.418289184570312,3.58172607421875,8,8,8h554c4.41827392578125,0,8-3.581710815429688,8-8V8c0-4.418285369873047-3.58172607421875-8-8-8h0Z" style="fill: #d2d7e1;"></path>
    </g>
    <text transform="translate(254.161079406738281 31.536102294921875)" style="font-family: Roboto-Bold, Roboto; font-size: 16px; font-weight: 700;"><tspan x="0" y="0">GST BIN</tspan></text>
    <g>
      <g>
        <text transform="translate(367.49224853515625 125.933559417724609)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Qualcomm </tspan></text>
        <rect x="347.241281918222739" y="113.842067718505859" width="16" height="16" rx="2" ry="2" style="fill: #2a2aea;"></rect>
      </g>
      <g>
        <text transform="translate(466.0740966796875 125.933559417724609)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Open source</tspan></text>
        <rect x="445.823063331081357" y="113.842067718505859" width="16" height="16" rx="2" ry="2" style="fill: #007884;"></rect>
      </g>
    </g>
  </g>
  <g id="Layer_2" data-name="Layer 2">
    <g>
      <g>
        <rect x="205" y="43.842043822251981" width="160" height="50.000000000000909" rx="4" ry="4" style="fill: #2a2aea;"></rect>
        <text transform="translate(250.437530517578125 72.3487548828125)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">qtioverlay</tspan></text>
      </g>
      <g>
        <line x1="365" y1="68.842044830322266" x2="384.259033203125" y2="68.842044830322266" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="383.091796875 72.831111907959894 390 68.842044830322266 383.091796875 64.852977752685547 383.091796875 72.831111907959894"></polygon>
      </g>
      <g>
        <line x1="180" y1="68.842044830322266" x2="199.259033203125" y2="68.842044830322266" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="198.091796875 72.831111907959894 205 68.842044830322266 198.091796875 64.852977752685547 198.091796875 72.831111907959894"></polygon>
      </g>
      <g>
        <rect x="390" y="43.842043822251981" width="160" height="50.000000000000909" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(426.097686767578125 72.3487548828125)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">waylandsink</tspan></text>
      </g>
      <g>
        <rect x="20" y="43.842043822251981" width="160" height="50.000000000000909" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(73.429718017578125 72.3487548828125)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">camsrc</tspan></text>
      </g>
    </g>
  </g>
</svg>

## Non-inverse privacy mask

Source: [https://docs.qualcomm.com/doc/80-70022-50/topic/overlay-use-cases.html](https://docs.qualcomm.com/doc/80-70022-50/topic/overlay-use-cases.html)

This use case shows how to overlay the non-inverse privacy mask on the video
        stream.

Run the following use cases on the target device:

- Overlay on a video:

        setprop persist.overlay.use_c2d_blit 2Copy to clipboard

        gst-launch-1.0 filesrc location=/opt/<input_file>.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! qtioverlay overlay-mask="mask0, circle=<640, 360, 200>, dest-rect=<0, 0, 1280, 720>, color=0x202020FF" ! waylandsink fullscreen=trueCopy to clipboard

Figure : Pipeline for non-inverse privacy mask overlay on video–file
                        source
                    
                    <?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="1045.002105712890625" height="158.201599121094659" viewbox="0 0 1045.002105712890625 158.201599121094659">
  <g id="Layer_1" data-name="Layer 1">
    <g>
      <rect x=".500152587890625" y=".49981689453125" width="1044.00244140625" height="157.20166015625" rx="7.499999999999986" ry="7.499999999999986" style="fill: #fafafa;"></rect>
      <path d="M1037.002105712890625,1c3.85986328125,0,7,3.140132904052734,7,7v142.201599121094659c0,3.85986328125-3.14013671875,7-7,7H8c-3.85986328125,0-7-3.14013671875-7-7V8c0-3.859867095947266,3.14013671875-7,7-7h1029.002105712890625M1037.002105712890625,0H8C3.581733703613281,0,0,3.581733703613281,0,8v142.201599121094659c0,4.418273925780341,3.581733703613281,8,8,8h1029.002105712890625c4.418334960939319,0,8-3.581726074219659,8-8V8c0-4.418266296386719-3.581665039060681-8-8-8h0Z" style="fill: #d2d7e1;"></path>
    </g>
    <g>
      <g>
        <text transform="translate(843.858642578125 134.2930908203125)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Qualcomm </tspan></text>
        <rect x="823.607641423212044" y="122.201599121094659" width="16" height="16" rx="2" ry="2" style="fill: #2a2aea;"></rect>
      </g>
      <g>
        <text transform="translate(942.4404296875 134.2930908203125)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Open source</tspan></text>
        <rect x="922.189422836070662" y="122.201599121094659" width="16" height="16" rx="2" ry="2" style="fill: #007884;"></rect>
      </g>
    </g>
  </g>
  <g id="Layer_2" data-name="Layer 2">
    <g>
      <g>
        <rect x="350.002136832787073" y="52.201583862304688" width="150.000000000000909" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(387.209197998046875 80.708297729492188)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">h264parse</tspan></text>
      </g>
      <g>
        <line x1="500.002166748046875" y1="77.201583862304688" x2="519.261138916015625" y2="77.201583862304688" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="518.093963623046875 81.190643310546875 525.002166748046875 77.201583862304688 518.093963623046875 73.212516784667969 518.093963623046875 81.190643310546875"></polygon>
      </g>
      <g>
        <line x1="325.0010986328125" y1="77.201583862304688" x2="344.260101318359375" y2="77.201583862304688" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="343.092926025390625 81.190643310546875 350.0010986328125 77.201583862304688 343.092926025390625 73.212516784667969 343.092926025390625 81.190643310546875"></polygon>
      </g>
      <g>
        <rect x="525.002136832787073" y="52.201583862304688" width="150" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(554.381072998046875 80.708297729492188)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">v4l2h264dec</tspan></text>
      </g>
      <g>
        <line x1="675.002166748046875" y1="77.201583862304688" x2="694.261138916015625" y2="77.201583862304688" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="693.093963623046875 81.190643310546875 700.002166748046875 77.201583862304688 693.093963623046875 73.212516784667969 693.093963623046875 81.190643310546875"></polygon>
      </g>
      <g>
        <rect x="700.002136832787073" y="52.201583862304688" width="150" height="50" rx="4" ry="4" style="fill: #2a2aea;"></rect>
        <text transform="translate(740.43963623046875 80.708297729492188)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">qtioverlay</tspan></text>
      </g>
      <g>
        <line x1="850.002166748046875" y1="77.201583862304688" x2="869.261138916015625" y2="77.201583862304688" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="868.093963623046875 81.190643310546875 875.002166748046875 77.201583862304688 868.093963623046875 73.212516784667969 868.093963623046875 81.190643310546875"></polygon>
      </g>
      <g>
        <rect x="875.002136832787073" y="52.201583862304688" width="150.000000000003638" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(906.099945068359375 80.708297729492188)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">waylandsink</tspan></text>
      </g>
      <g>
        <rect x="20.001098030495086" y="52.201583862304688" width="139.999999999999091" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(68.083160400390625 80.708297729492188)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">filesrc</tspan></text>
      </g>
      <g>
        <line x1="160.0010986328125" y1="77.201583862304688" x2="179.260101318359375" y2="77.201583862304688" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="178.092926025390625 81.190643310546875 185.0010986328125 77.201583862304688 178.092926025390625 73.212516784667969 178.092926025390625 81.190643310546875"></polygon>
      </g>
      <g>
        <rect x="185.001098030494177" y="52.201583862304688" width="140" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(223.704254150390625 80.708297729492188)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">qtdemux</tspan></text>
      </g>
    </g>
    <text transform="translate(492.107086181640625 31.536170959472656)" style="font-family: Roboto-Bold, Roboto; font-size: 16px; font-weight: 700;"><tspan x="0" y="0">GST BIN</tspan></text>
  </g>
</svg>
- Overlay on a live stream from a camera:

        setprop persist.overlay.use_c2d_blit 2Copy to clipboard

        gst-launch-1.0 -e qtiqmmfsrc ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! qtioverlay overlay-mask="mask0, circle=<960, 540, 400>, dest-rect=<0, 0, 1920, 1080>, color=0x202020FF" ! waylandsink fullscreen=trueCopy to clipboard

Figure : Pipeline for non-inverse privacy mask overlay on video–camera
                        source
                    
                    <?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="570" height="149.842067718505859" viewbox="0 0 570 149.842067718505859">
  <g id="Layer_1" data-name="Layer 1">
    <g>
      <rect x=".5" y=".500179290771484" width="569" height="148.841796875" rx="7.499999999999997" ry="7.499999999999997" style="fill: #fafafa;"></rect>
      <path d="M562,1c3.85980224609375,0,7,3.140216827392578,7,7v133.842067718505859c0,3.859786987304688-3.14019775390625,7-7,7H8c-3.859771728515625,0-7-3.140213012695312-7-7V8c0-3.859783172607422,3.140228271484375-7,7-7h554M562,0H8C3.58172607421875,0,0,3.581714630126953,0,8v133.842067718505859c0,4.418289184570312,3.58172607421875,8,8,8h554c4.41827392578125,0,8-3.581710815429688,8-8V8c0-4.418285369873047-3.58172607421875-8-8-8h0Z" style="fill: #d2d7e1;"></path>
    </g>
    <text transform="translate(254.161079406738281 31.536102294921875)" style="font-family: Roboto-Bold, Roboto; font-size: 16px; font-weight: 700;"><tspan x="0" y="0">GST BIN</tspan></text>
    <g>
      <g>
        <text transform="translate(367.49224853515625 125.933559417724609)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Qualcomm </tspan></text>
        <rect x="347.241281918222739" y="113.842067718505859" width="16" height="16" rx="2" ry="2" style="fill: #2a2aea;"></rect>
      </g>
      <g>
        <text transform="translate(466.0740966796875 125.933559417724609)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Open source</tspan></text>
        <rect x="445.823063331081357" y="113.842067718505859" width="16" height="16" rx="2" ry="2" style="fill: #007884;"></rect>
      </g>
    </g>
  </g>
  <g id="Layer_2" data-name="Layer 2">
    <g>
      <g>
        <rect x="205" y="43.842043822251981" width="160" height="50.000000000000909" rx="4" ry="4" style="fill: #2a2aea;"></rect>
        <text transform="translate(250.437530517578125 72.3487548828125)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">qtioverlay</tspan></text>
      </g>
      <g>
        <line x1="365" y1="68.842044830322266" x2="384.259033203125" y2="68.842044830322266" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="383.091796875 72.831111907959894 390 68.842044830322266 383.091796875 64.852977752685547 383.091796875 72.831111907959894"></polygon>
      </g>
      <g>
        <line x1="180" y1="68.842044830322266" x2="199.259033203125" y2="68.842044830322266" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="198.091796875 72.831111907959894 205 68.842044830322266 198.091796875 64.852977752685547 198.091796875 72.831111907959894"></polygon>
      </g>
      <g>
        <rect x="390" y="43.842043822251981" width="160" height="50.000000000000909" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(426.097686767578125 72.3487548828125)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">waylandsink</tspan></text>
      </g>
      <g>
        <rect x="20" y="43.842043822251981" width="160" height="50.000000000000909" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(73.429718017578125 72.3487548828125)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">camsrc</tspan></text>
      </g>
    </g>
  </g>
</svg>

## Polygon privacy mask

Source: [https://docs.qualcomm.com/doc/80-70022-50/topic/overlay-use-cases.html](https://docs.qualcomm.com/doc/80-70022-50/topic/overlay-use-cases.html)

A polygon privacy mask allows you to create privacy zones on an image using a
        polygonal shape. Using a polygon allows you to make the masking smoother and more
        exact.

- The polygon privacy mask is applied to the region enclosed within the polygon.
- The inverse polygon privacy mask is applied to all regions except the one enclosed
                within the polygon.

Before you begin, run the following commands on the target device to configure the
            display:

    export XDG_RUNTIME_DIR=/dev/socket/weston && export WAYLAND_DISPLAY=wayland-1Copy to clipboard

    setprop persist.overlay.use_c2d_blit 2Copy to clipboard

Run the following use cases on the target device.

### Enable polygon privacy mask

- File
                    source:

        gst-launch-1.0 filesrc location=/opt/<input_file>.mp4 ! qtdemux ! queue ! h264parse !  v4l2h264dec capture-io-mode=4 output-io-mode=4 ! 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,format=NV12,width=1920,height=1080,framerate=30/1 ! 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

### Enable inverse polygon privacy mask

- File
                    source:

        gst-launch-1.0 filesrc location=/opt/<input_file>.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! 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,format=NV12,width=1920,height=1080,framerate=30/1 ! 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

### Update polygon privacy mask property at runtime

1. Set the privacy
                    mask:

        gst-pipeline-app -e qtiqmmfsrc ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! 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

Last Published: Feb 20, 2026

[Previous Topic
Video composition use cases](https://docs.qualcomm.com/bundle/publicresource/80-70022-50/topics/video-composition.md) [Next Topic
Video split use cases](https://docs.qualcomm.com/bundle/publicresource/80-70022-50/topics/video-split-use-cases.md)