# Video overlay use cases
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 [qtioverlay](https://docs.qualcomm.com/doc/80-70029-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-70029-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-70029-50/topic/qtioverlay.html).
## User text overlay
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 2
Copy 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=true
Copy to clipboard
**Figure : Pipeline for text overlay on video–file source**
- Overlay on a live stream from a camera:
setprop persist.overlay.use_c2d_blit 2
Copy 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=true
Copy to clipboard
**Figure : Pipeline for text overlay on video–camera source**
## Date and time overlay
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 2
Copy to clipboard
gst-launch-1.0 filesrc location=/opt/.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=true
Copy to clipboard
**Figure : Pipeline for text date and time overlay on video–file source**
- Overlay on a live stream from a camera:
setprop persist.overlay.use_c2d_blit 2
Copy 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=true
Copy to clipboard
**Figure : Pipeline for text date and time overlay on video–camera source**
## Static image overlay
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 .rgba root@[DEVICE IP-ADDR]:/opt
Copy to clipboard
2. Run the use cases on the target device:
- Overlay on a video:
setprop persist.overlay.use_c2d_blit 2
Copy to clipboard
gst-launch-1.0 filesrc location=/opt/.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=true
Copy to clipboard
**Figure : Pipeline for static image overlay on video–file source**
- Overlay on alive stream from a camera:
setprop persist.overlay.use_c2d_blit 2
Copy 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=true
Copy to clipboard
**Figure : Pipeline for static image overlay on video–camera source**
## Bounding box overlay
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 2
Copy to clipboard
gst-launch-1.0 filesrc location=/opt/.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=true
Copy to clipboard
**Figure : Pipeline for bounding box overlay on video–file source**
- Overlay on a live stream from a camera:
setprop persist.overlay.use_c2d_blit 2
Copy 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=true
Copy to clipboard
**Figure : Pipeline for bounding box overlay on video–camera source**
## Inverse privacy mask
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 2
Copy to clipboard
gst-launch-1.0 filesrc location=/opt/.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! qtioverlay overlay-mask="mask0, circle=<960, 540, 400>, inverse=true, dest-rect=<0, 0, 1920, 1080>, color=0x202020FF" ! waylandsink fullscreen=true
Copy to clipboard
**Figure : Pipeline for inverse privacy mask overlay on video–file source**
- Overlay on a live stream from a camera:
setprop persist.overlay.use_c2d_blit 2
Copy 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=true, dest-rect=<0, 0, 1920, 1080>, color=0x202020FF" ! waylandsink fullscreen=true
Copy to clipboard
**Figure : Pipeline for inverse privacy mask overlay on video–camera source**
## Non-inverse privacy mask
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 2
Copy to clipboard
gst-launch-1.0 filesrc location=/opt/.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=true
Copy to clipboard
[\*\*](https://docs.qualcomm.com/doc/80-70029-50/topic/overlay-use-cases.html#id10)Figure : Pipeline for non-inverse privacy mask overlay on video–file source\*
- Overlay on a live stream from a camera:
setprop persist.overlay.use_c2d_blit 2
Copy 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=true
Copy to clipboard
**Figure : Pipeline for non-inverse privacy mask overlay on video–camera source**
## Polygon privacy mask
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-1
Copy to clipboard
setprop persist.overlay.use_c2d_blit 2
Copy to clipboard
Run the following use cases on the target device.
### Enable polygon privacy mask
- File source:
gst-launch-1.0 filesrc location=/opt/.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=true
Copy 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=true
Copy to clipboard
### Enable inverse polygon privacy mask
- File source:
gst-launch-1.0 filesrc location=/opt/.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=true
Copy 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=true
Copy 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=true
Copy 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=0x202020FF
Copy to clipboard
Last Published: Jun 03, 2026
[Previous Topic
Video composition use cases](https://docs.qualcomm.com/bundle/publicresource/80-70029-50/topics/video-composition.md) [Next Topic
Video split use cases](https://docs.qualcomm.com/bundle/publicresource/80-70029-50/topics/video-split-use-cases.md)