# 视频叠加用例

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

该 pipeline 展示了视频叠加的用例。这些用例使用 [qtivoverlay](https://docs.qualcomm.com/doc/80-70022-50SC/topic/qtioverlay.html) 插件的 *overlay-mask* 属性中的 `dest-rect` 属性坐标。

在运行用例之前，请确保完成 [GStreamer 命令行用例](https://docs.qualcomm.com/doc/80-70022-50SC/topic/gstreamer-application-use-cases.html)中提到的先决条件。

Note: 以下用例中的命令使用 720p 分辨率。要更改分辨率，请在该分辨率的命令中更新相应的
                `dest-rect`属性坐标。关于更多详细信息，请参阅 [qtivoverlay](https://docs.qualcomm.com/doc/80-70022-50SC/topic/qtioverlay.html)。

## 用户文本叠加

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

该用例展示了如何在视频流上叠加文本。

在目标设备上运行以下用例：

- 叠加在视频上：

        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 – 文件源
                    
                    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by Microsoft Visio, SVG Export pipeline_textoverlay_video_filesource.svg pipeline_textoverlay_video_file -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:v="http://schemas.microsoft.com/visio/2003/SVGExtensions/" width="10.8854in" height="1.64793in" viewbox="0 0 783.752 118.651" xml:space="preserve" color-interpolation-filters="sRGB" class="st12"><v:documentproperties v:langid="1033" v:viewmarkup="false"></v:documentproperties>
<style>.svg-1 .st1 { fill: #fafafa; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st2 { fill: #000000; font-family: Roboto; font-size: 1.00001em; font-weight: bold }
.svg-1 .st3 { fill: #d2d7e1; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st4 { fill: #007884; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st5 { fill: #ffffff; font-family: Roboto; font-size: 1.00001em }
.svg-1 .st6 { stroke: #000000; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st7 { fill: #000000; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st8 { fill: #2a2aea; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st9 { fill: none; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st10 { fill: #000000; font-family: Roboto; font-size: 0.874992em }
.svg-1 .st11 { fill: #000000; font-family: SimHei; font-size: 0.874992em }
.svg-1 .st12 { fill: none; fill-rule: evenodd; font-size: 12px; overflow: visible; stroke-linecap: square; stroke-miterlimit: 3 }</style>
<g v:mid="0" v:index="1" v:groupcontext="foregroundPage">	<title>pipeline_textoverlay_video_file</title>	<v:pageproperties v:drawingscale="1" v:pagescale="1" v:drawingunits="19" v:shadowoffsetx="9" v:shadowoffsety="-9"></v:pageproperties>	<g id="shape3-1" v:mid="3" v:groupcontext="shape" transform="translate(0.375114,-0.375092)">		<title>Sheet.3</title>		<desc>GST BIN</desc>		<v:textblock v:margins="rect(7.2,0,0,0)" v:verticalalign="0"></v:textblock>		<v:textrect cx="391.501" cy="59.7006" width="783.01" height="117.901"></v:textrect>		<path d="M0 113.03 A5.62513 5.62513 -180 0 0 5.62 118.65 L777.38 118.65 A5.62513 5.62513 -180 0 0 783 113.03 L783 6.37					 A5.62513 5.62513 -180 0 0 777.38 0.75 L5.62 0.75 A5.62513 5.62513 -180 0 0 0 6.37 L0 113.03 Z" class="st1"></path>		<text x="368.7" y="18.75" class="st2" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>GST BIN</text>		</g>	<g id="shape4-4" v:mid="4" v:groupcontext="shape">		<title>Sheet.4</title>		<path d="M777.75 0.75 C780.65 0.75 783 3.11 783 6 L783 112.65 C783 115.55 780.65 117.9 777.75 117.9 L6 117.9 C3.11 117.9					 0.75 115.55 0.75 112.65 L0.75 6 C0.75 3.11 3.11 0.75 6 0.75 L777.75 0.75 ZM777.75 0 L6 0 C2.69 0 0 2.69					 0 6 L0 112.65 C0 115.96 2.69 118.65 6 118.65 L777.75 118.65 C781.07 118.65 783.75 115.96 783.75 112.65 L783.75					 6 C783.75 2.69 781.07 0 777.75 0 Z" class="st3"></path>	</g>	<g id="shape15-6" v:mid="15" v:groupcontext="shape" transform="translate(262.502,-42)">		<title>Sheet.15</title>		<desc>h264parse</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="56.25" cy="99.9012" width="112.5" height="37.5"></v:textrect>		<path d="M0 115.65 A3.00007 3.00007 -180 0 0 3 118.65 L109.5 118.65 A3.00007 3.00007 -180 0 0 112.5 115.65 L112.5 84.15					 A3.00007 3.00007 -180 0 0 109.5 81.15 L3 81.15 A3.00007 3.00007 -180 0 0 0 84.15 L0 115.65 Z" class="st4"></path>		<text x="27.9" y="103.5" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>h264parse</text>		</g>	<g id="group17-9" transform="translate(375.002,-57.7582)" v:mid="17" v:groupcontext="group">		<title>Sheet.17</title>		<g id="shape18-10" v:mid="18" v:groupcontext="shape" transform="translate(0,-2.99179)">			<title>Sheet.18</title>			<path d="M0 118.65 L14.44 118.65" class="st6"></path>		</g>		<g id="shape19-13" v:mid="19" v:groupcontext="shape" transform="translate(13.5688,-1.42109E-14)">			<title>Sheet.19</title>			<path d="M0 118.65 L5.18 115.66 L0 112.67 L0 118.65 Z" class="st7"></path>		</g>	</g>	<g id="group20-15" transform="translate(243.751,-57.7582)" v:mid="20" v:groupcontext="group">		<title>Sheet.20</title>		<g id="shape21-16" v:mid="21" v:groupcontext="shape" transform="translate(0,-2.99179)">			<title>Sheet.21</title>			<path d="M0 118.65 L14.44 118.65" class="st6"></path>		</g>		<g id="shape22-19" v:mid="22" v:groupcontext="shape" transform="translate(13.5689,-1.42109E-14)">			<title>Sheet.22</title>			<path d="M0 118.65 L5.18 115.66 L0 112.67 L0 118.65 Z" class="st7"></path>		</g>	</g>	<g id="shape24-21" v:mid="24" v:groupcontext="shape" transform="translate(393.752,-42)">		<title>Sheet.24</title>		<desc>v4l2h264dec</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="56.25" cy="99.9012" width="112.5" height="37.5"></v:textrect>		<path d="M0 115.65 A3.00007 3.00007 -180 0 0 3 118.65 L109.5 118.65 A3.00007 3.00007 -180 0 0 112.5 115.65 L112.5 84.15					 A3.00007 3.00007 -180 0 0 109.5 81.15 L3 81.15 A3.00007 3.00007 -180 0 0 0 84.15 L0 115.65 Z" class="st4"></path>		<text x="22.03" y="103.5" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>v4l2h264dec</text>		</g>	<g id="group26-24" transform="translate(506.252,-57.7582)" v:mid="26" v:groupcontext="group">		<title>Sheet.26</title>		<g id="shape27-25" v:mid="27" v:groupcontext="shape" transform="translate(0,-2.99179)">			<title>Sheet.27</title>			<path d="M0 118.65 L14.44 118.65" class="st6"></path>		</g>		<g id="shape28-28" v:mid="28" v:groupcontext="shape" transform="translate(13.5688,-1.42109E-14)">			<title>Sheet.28</title>			<path d="M0 118.65 L5.18 115.66 L0 112.67 L0 118.65 Z" class="st7"></path>		</g>	</g>	<g id="shape30-30" v:mid="30" v:groupcontext="shape" transform="translate(525.002,-42)">		<title>Sheet.30</title>		<desc>qtioverlay</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="56.25" cy="99.9012" width="112.51" height="37.5"></v:textrect>		<path d="M0 115.65 A3.00007 3.00007 -180 0 0 3 118.65 L109.5 118.65 A3.00007 3.00007 -180 0 0 112.5 115.65 L112.5 84.15					 A3.00007 3.00007 -180 0 0 109.5 81.15 L3 81.15 A3.00007 3.00007 -180 0 0 0 84.15 L0 115.65 Z" class="st8"></path>		<text x="30.33" y="103.5" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtioverlay</text>		</g>	<g id="group32-33" transform="translate(637.502,-57.7582)" v:mid="32" v:groupcontext="group">		<title>Sheet.32</title>		<g id="shape33-34" v:mid="33" v:groupcontext="shape" transform="translate(0,-2.99179)">			<title>Sheet.33</title>			<path d="M0 118.65 L14.44 118.65" class="st6"></path>		</g>		<g id="shape34-37" v:mid="34" v:groupcontext="shape" transform="translate(13.5688,-1.42109E-14)">			<title>Sheet.34</title>			<path d="M0 118.65 L5.18 115.66 L0 112.67 L0 118.65 Z" class="st7"></path>		</g>	</g>	<g id="shape36-39" v:mid="36" v:groupcontext="shape" transform="translate(656.252,-42)">		<title>Sheet.36</title>		<desc>Waylandsink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="56.25" cy="99.9012" width="112.51" height="37.5"></v:textrect>		<path d="M0 115.65 A3.00007 3.00007 -180 0 0 3 118.65 L109.5 118.65 A3.00007 3.00007 -180 0 0 112.5 115.65 L112.5 84.15					 A3.00007 3.00007 -180 0 0 109.5 81.15 L3 81.15 A3.00007 3.00007 -180 0 0 -0 84.15 L0 115.65 Z" class="st4"></path>		<text x="22.51" y="103.5" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Waylandsink</text>		</g>	<g id="shape39-42" v:mid="39" v:groupcontext="shape" transform="translate(15.0008,-42)">		<title>Sheet.39</title>		<desc>filesrc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="52.5" cy="99.9012" width="105" height="37.5"></v:textrect>		<path d="M0 115.65 A3.00007 3.00007 -180 0 0 3 118.65 L102 118.65 A3.00007 3.00007 -180 0 0 105 115.65 L105 84.15 A3.00007					 3.00007 -180 0 0 102 81.15 L3 81.15 A3.00007 3.00007 -180 0 0 0 84.15 L0 115.65 Z" class="st4"></path>		<text x="36.06" y="103.5" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>filesrc</text>		</g>	<g id="group41-45" transform="translate(120.001,-57.7582)" v:mid="41" v:groupcontext="group">		<title>Sheet.41</title>		<g id="shape42-46" v:mid="42" v:groupcontext="shape" transform="translate(0,-2.99179)">			<title>Sheet.42</title>			<path d="M0 118.65 L14.44 118.65" class="st6"></path>		</g>		<g id="shape43-49" v:mid="43" v:groupcontext="shape" transform="translate(13.5689,-1.42109E-14)">			<title>Sheet.43</title>			<path d="M0 118.65 L5.18 115.66 L0 112.67 L0 118.65 Z" class="st7"></path>		</g>	</g>	<g id="shape45-51" v:mid="45" v:groupcontext="shape" transform="translate(138.751,-42)">		<title>Sheet.45</title>		<desc>qtdemux</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="52.5" cy="99.9012" width="105" height="37.5"></v:textrect>		<path d="M0 115.65 A3.00007 3.00007 -180 0 0 3 118.65 L102 118.65 A3.00007 3.00007 -180 0 0 105 115.65 L105 84.15 A3.00007					 3.00007 -180 0 0 102 81.15 L3 81.15 A3.00007 3.00007 -180 0 0 0 84.15 L0 115.65 Z" class="st4"></path>		<text x="29.03" y="103.5" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtdemux</text>		</g>	<g id="group48-54" transform="translate(658.627,-14.7814)" v:mid="48" v:groupcontext="group">		<title>Sheet.48</title>		<g id="shape7-55" v:mid="7" v:groupcontext="shape" transform="translate(15.1883,0)">			<title>Sheet.7</title>			<desc>Qualcomm</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="27.803" cy="112.351" width="55.61" height="12.6"></v:textrect>			<rect x="0" y="106.051" width="55.606" height="12.6" class="st9"></rect>			<text x="0" y="115.5" class="st10" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>Qualcomm  </text>			</g>		<g id="shape8-58" v:mid="8" v:groupcontext="shape" transform="translate(1.26898E-13,-0.218619)">			<title>Sheet.8</title>			<path d="M0 117.15 A1.50003 1.50003 -180 0 0 1.5 118.65 L10.5 118.65 A1.50003 1.50003 -180 0 0 12 117.15 L12 108.15						 A1.50003 1.50003 -180 0 0 10.5 106.65 L1.5 106.65 A1.50003 1.50003 -180 0 0 0 108.15 L0 117.15 Z" class="st8"></path>		</g>		<g id="shape10-60" v:mid="10" v:groupcontext="shape" transform="translate(89.1246,0)">			<title>Sheet.10</title>			<desc>开源</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="10.5" cy="112.351" width="21" height="12.6"></v:textrect>			<rect x="0" y="106.051" width="21" height="12.6" class="st9"></rect>			<text x="0" y="115.85" class="st11" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>开源</text>			</g>		<g id="shape11-63" v:mid="11" v:groupcontext="shape" transform="translate(73.9363,-0.218619)">			<title>Sheet.11</title>			<path d="M0 117.15 A1.50003 1.50003 -180 0 0 1.5 118.65 L10.5 118.65 A1.50003 1.50003 -180 0 0 12 117.15 L12 108.15						 A1.50003 1.50003 -180 0 0 10.5 106.65 L1.5 106.65 A1.50003 1.50003 -180 0 0 0 108.15 L0 117.15 Z" class="st4"></path>		</g>	</g></g>
</svg>
- 覆盖来自摄像头的实时流：

        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 – 摄像头源
                    
                    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by Microsoft Visio, SVG Export pipeline_textoverlay_video_camsource.svg pipeline_textoverlay_video_cams -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:v="http://schemas.microsoft.com/visio/2003/SVGExtensions/" width="5.9375in" height="1.56085in" viewbox="0 0 427.5 112.382" xml:space="preserve" color-interpolation-filters="sRGB" class="st12"><v:documentproperties v:langid="1033" v:viewmarkup="false"></v:documentproperties>
<style>.svg-2 .st1 { fill: #fafafa; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-2 .st2 { fill: #000000; font-family: Roboto; font-size: 1.00001em; font-weight: bold }
.svg-2 .st3 { fill: #d2d7e1; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-2 .st4 { fill: #2a2aea; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-2 .st5 { fill: #ffffff; font-family: Roboto; font-size: 1.00001em }
.svg-2 .st6 { stroke: #000000; stroke-linecap: butt; stroke-width: 0.75 }
.svg-2 .st7 { fill: #000000; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-2 .st8 { fill: #007884; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-2 .st9 { fill: none; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-2 .st10 { fill: #000000; font-family: Roboto; font-size: 0.874992em }
.svg-2 .st11 { fill: #000000; font-family: SimHei; font-size: 0.874992em }
.svg-2 .st12 { fill: none; fill-rule: evenodd; font-size: 12px; overflow: visible; stroke-linecap: square; stroke-miterlimit: 3 }</style>
<g v:mid="0" v:index="1" v:groupcontext="foregroundPage">	<title>pipeline_textoverlay_video_cams</title>	<v:pageproperties v:drawingscale="1" v:pagescale="1" v:drawingunits="19" v:shadowoffsetx="9" v:shadowoffsety="-9"></v:pageproperties>	<v:layer v:name="Connector" v:index="0"></v:layer>	<g id="shape3-1" v:mid="3" v:groupcontext="shape" transform="translate(0.375,-0.375069)">		<title>Sheet.3</title>		<desc>GST BIN</desc>		<v:textblock v:margins="rect(7.2,0,0,0)" v:verticalalign="0"></v:textblock>		<v:textrect cx="213.375" cy="56.5659" width="426.76" height="111.631"></v:textrect>		<path d="M0 106.76 A5.62513 5.62513 -180 0 0 5.63 112.38 L421.13 112.38 A5.62513 5.62513 -180 0 0 426.75 106.76 L426.75					 6.38 A5.62513 5.62513 -180 0 0 421.13 0.75 L5.63 0.75 A5.62513 5.62513 -180 0 0 0 6.38 L0 106.76 Z" class="st1"></path>		<text x="190.58" y="18.75" class="st2" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>GST BIN</text>		</g>	<g id="shape4-4" v:mid="4" v:groupcontext="shape">		<title>Sheet.4</title>		<path d="M421.5 0.75 C424.39 0.75 426.75 3.11 426.75 6 L426.75 106.38 C426.75 109.28 424.39 111.63 421.5 111.63 L6 111.63					 C3.11 111.63 0.75 109.28 0.75 106.38 L0.75 6 C0.75 3.11 3.11 0.75 6 0.75 L421.5 0.75 ZM421.5 0 L6 0 C2.69					 0 0 2.69 0 6 L0 106.38 C0 109.7 2.69 112.38 6 112.38 L421.5 112.38 C424.81 112.38 427.5 109.7 427.5 106.38					 L427.5 6 C427.5 2.69 424.81 0 421.5 0 Z" class="st3"></path>	</g>	<g id="shape15-6" v:mid="15" v:groupcontext="shape" transform="translate(153.75,-42)">		<title>Sheet.15</title>		<desc>qtioverlay</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="93.6316" width="120" height="37.5"></v:textrect>		<path d="M0 109.38 A3.00007 3.00007 -180 0 0 3 112.38 L117 112.38 A3.00007 3.00007 -180 0 0 120 109.38 L120 77.88 A3.00007					 3.00007 -180 0 0 117 74.88 L3 74.88 A3.00007 3.00007 -180 0 0 0 77.88 L0 109.38 Z" class="st4"></path>		<text x="34.08" y="97.23" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtioverlay</text>		</g>	<g id="shape18-9" v:mid="18" v:groupcontext="shape" transform="translate(273.75,-60.75)">		<title>Sheet.18</title>		<path d="M0 112.38 L14.44 112.38" class="st6"></path>	</g>	<g id="shape19-12" v:mid="19" v:groupcontext="shape" transform="translate(287.319,-57.7582)">		<title>Sheet.19</title>		<path d="M0 112.38 L5.18 109.39 L0 106.4 L0 112.38 Z" class="st7"></path>	</g>	<g id="shape21-14" v:mid="21" v:groupcontext="shape" transform="translate(135,-60.75)">		<title>Sheet.21</title>		<path d="M0 112.38 L14.44 112.38" class="st6"></path>	</g>	<g id="shape22-17" v:mid="22" v:groupcontext="shape" transform="translate(148.569,-57.7582)">		<title>Sheet.22</title>		<path d="M0 112.38 L5.18 109.39 L0 106.4 L0 112.38 Z" class="st7"></path>	</g>	<g id="shape24-19" v:mid="24" v:groupcontext="shape" transform="translate(292.5,-42)">		<title>Sheet.24</title>		<desc>Waylandsink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="93.6316" width="120" height="37.5"></v:textrect>		<path d="M0 109.38 A3.00007 3.00007 -180 0 0 3 112.38 L117 112.38 A3.00007 3.00007 -180 0 0 120 109.38 L120 77.88 A3.00007					 3.00007 -180 0 0 117 74.88 L3 74.88 A3.00007 3.00007 -180 0 0 0 77.88 L0 109.38 Z" class="st8"></path>		<text x="26.26" y="97.23" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Waylandsink</text>		</g>	<g id="shape27-22" v:mid="27" v:groupcontext="shape" transform="translate(15,-42)">		<title>Sheet.27</title>		<desc>camsrc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="93.6316" width="120" height="37.5"></v:textrect>		<path d="M0 109.38 A3.00007 3.00007 -180 0 0 3 112.38 L117 112.38 A3.00007 3.00007 -180 0 0 120 109.38 L120 77.88 A3.00007					 3.00007 -180 0 0 117 74.88 L3 74.88 A3.00007 3.00007 -180 0 0 0 77.88 L0 109.38 Z" class="st8"></path>		<text x="40.07" y="97.23" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>camsrc</text>		</g>	<g id="group32-25" transform="translate(302.375,-14.7814)" v:mid="32" v:groupcontext="group">		<title>Sheet.32</title>		<g id="shape8-26" v:mid="8" v:groupcontext="shape" transform="translate(15.1882,1.42109E-14)">			<title>Sheet.8</title>			<desc>Qualcomm</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="27.5654" cy="106.082" width="55.14" height="12.6"></v:textrect>			<rect x="0" y="99.7816" width="55.1308" height="12.6" class="st9"></rect>			<text x="-0" y="109.23" class="st10" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>Qualcomm  </text>			</g>		<g id="shape9-29" v:mid="9" v:groupcontext="shape" transform="translate(9.99201E-16,-0.218619)">			<title>Sheet.9</title>			<path d="M0 110.88 A1.50003 1.50003 -180 0 0 1.5 112.38 L10.5 112.38 A1.50003 1.50003 -180 0 0 12 110.88 L12 101.88						 A1.50003 1.50003 -180 0 0 10.5 100.38 L1.5 100.38 A1.50003 1.50003 -180 0 0 -0 101.88 L0 110.88 Z" class="st4"></path>		</g>		<g id="shape11-31" v:mid="11" v:groupcontext="shape" transform="translate(89.1246,1.42109E-14)">			<title>Sheet.11</title>			<desc>开源</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="10.5" cy="106.082" width="21" height="12.6"></v:textrect>			<rect x="0" y="99.7816" width="21" height="12.6" class="st9"></rect>			<text x="0" y="109.58" class="st11" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>开源</text>			</g>		<g id="shape12-34" v:mid="12" v:groupcontext="shape" transform="translate(73.9363,-0.218619)">			<title>Sheet.12</title>			<path d="M0 110.88 A1.50003 1.50003 -180 0 0 1.5 112.38 L10.5 112.38 A1.50003 1.50003 -180 0 0 12 110.88 L12 101.88						 A1.50003 1.50003 -180 0 0 10.5 100.38 L1.5 100.38 A1.50003 1.50003 -180 0 0 0 101.88 L0 110.88 Z" class="st8"></path>		</g>	</g></g>
</svg>

## 日期和时间叠加

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

该用例展示了将日期（以 MMDDYYYY 为格式）和时间（以 HHMMSS 为格式）叠加到视频流的过程。

在目标设备上运行以下用例：

- 叠加在视频上：

        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 - 文件源
                    
                    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by Microsoft Visio, SVG Export pipeline_textoverlay_video_filesource.svg pipeline_textoverlay_video_file -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:v="http://schemas.microsoft.com/visio/2003/SVGExtensions/" width="10.8854in" height="1.64793in" viewbox="0 0 783.752 118.651" xml:space="preserve" color-interpolation-filters="sRGB" class="st12"><v:documentproperties v:langid="1033" v:viewmarkup="false"></v:documentproperties>
<style>.svg-3 .st1 { fill: #fafafa; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-3 .st2 { fill: #000000; font-family: Roboto; font-size: 1.00001em; font-weight: bold }
.svg-3 .st3 { fill: #d2d7e1; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-3 .st4 { fill: #007884; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-3 .st5 { fill: #ffffff; font-family: Roboto; font-size: 1.00001em }
.svg-3 .st6 { stroke: #000000; stroke-linecap: butt; stroke-width: 0.75 }
.svg-3 .st7 { fill: #000000; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-3 .st8 { fill: #2a2aea; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-3 .st9 { fill: none; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-3 .st10 { fill: #000000; font-family: Roboto; font-size: 0.874992em }
.svg-3 .st11 { fill: #000000; font-family: SimHei; font-size: 0.874992em }
.svg-3 .st12 { fill: none; fill-rule: evenodd; font-size: 12px; overflow: visible; stroke-linecap: square; stroke-miterlimit: 3 }</style>
<g v:mid="0" v:index="1" v:groupcontext="foregroundPage">	<title>pipeline_textoverlay_video_file</title>	<v:pageproperties v:drawingscale="1" v:pagescale="1" v:drawingunits="19" v:shadowoffsetx="9" v:shadowoffsety="-9"></v:pageproperties>	<g id="shape3-1" v:mid="3" v:groupcontext="shape" transform="translate(0.375114,-0.375092)">		<title>Sheet.3</title>		<desc>GST BIN</desc>		<v:textblock v:margins="rect(7.2,0,0,0)" v:verticalalign="0"></v:textblock>		<v:textrect cx="391.501" cy="59.7006" width="783.01" height="117.901"></v:textrect>		<path d="M0 113.03 A5.62513 5.62513 -180 0 0 5.62 118.65 L777.38 118.65 A5.62513 5.62513 -180 0 0 783 113.03 L783 6.37					 A5.62513 5.62513 -180 0 0 777.38 0.75 L5.62 0.75 A5.62513 5.62513 -180 0 0 0 6.37 L0 113.03 Z" class="st1"></path>		<text x="368.7" y="18.75" class="st2" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>GST BIN</text>		</g>	<g id="shape4-4" v:mid="4" v:groupcontext="shape">		<title>Sheet.4</title>		<path d="M777.75 0.75 C780.65 0.75 783 3.11 783 6 L783 112.65 C783 115.55 780.65 117.9 777.75 117.9 L6 117.9 C3.11 117.9					 0.75 115.55 0.75 112.65 L0.75 6 C0.75 3.11 3.11 0.75 6 0.75 L777.75 0.75 ZM777.75 0 L6 0 C2.69 0 0 2.69					 0 6 L0 112.65 C0 115.96 2.69 118.65 6 118.65 L777.75 118.65 C781.07 118.65 783.75 115.96 783.75 112.65 L783.75					 6 C783.75 2.69 781.07 0 777.75 0 Z" class="st3"></path>	</g>	<g id="shape15-6" v:mid="15" v:groupcontext="shape" transform="translate(262.502,-42)">		<title>Sheet.15</title>		<desc>h264parse</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="56.25" cy="99.9012" width="112.5" height="37.5"></v:textrect>		<path d="M0 115.65 A3.00007 3.00007 -180 0 0 3 118.65 L109.5 118.65 A3.00007 3.00007 -180 0 0 112.5 115.65 L112.5 84.15					 A3.00007 3.00007 -180 0 0 109.5 81.15 L3 81.15 A3.00007 3.00007 -180 0 0 0 84.15 L0 115.65 Z" class="st4"></path>		<text x="27.9" y="103.5" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>h264parse</text>		</g>	<g id="group17-9" transform="translate(375.002,-57.7582)" v:mid="17" v:groupcontext="group">		<title>Sheet.17</title>		<g id="shape18-10" v:mid="18" v:groupcontext="shape" transform="translate(0,-2.99179)">			<title>Sheet.18</title>			<path d="M0 118.65 L14.44 118.65" class="st6"></path>		</g>		<g id="shape19-13" v:mid="19" v:groupcontext="shape" transform="translate(13.5688,-1.42109E-14)">			<title>Sheet.19</title>			<path d="M0 118.65 L5.18 115.66 L0 112.67 L0 118.65 Z" class="st7"></path>		</g>	</g>	<g id="group20-15" transform="translate(243.751,-57.7582)" v:mid="20" v:groupcontext="group">		<title>Sheet.20</title>		<g id="shape21-16" v:mid="21" v:groupcontext="shape" transform="translate(0,-2.99179)">			<title>Sheet.21</title>			<path d="M0 118.65 L14.44 118.65" class="st6"></path>		</g>		<g id="shape22-19" v:mid="22" v:groupcontext="shape" transform="translate(13.5689,-1.42109E-14)">			<title>Sheet.22</title>			<path d="M0 118.65 L5.18 115.66 L0 112.67 L0 118.65 Z" class="st7"></path>		</g>	</g>	<g id="shape24-21" v:mid="24" v:groupcontext="shape" transform="translate(393.752,-42)">		<title>Sheet.24</title>		<desc>v4l2h264dec</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="56.25" cy="99.9012" width="112.5" height="37.5"></v:textrect>		<path d="M0 115.65 A3.00007 3.00007 -180 0 0 3 118.65 L109.5 118.65 A3.00007 3.00007 -180 0 0 112.5 115.65 L112.5 84.15					 A3.00007 3.00007 -180 0 0 109.5 81.15 L3 81.15 A3.00007 3.00007 -180 0 0 0 84.15 L0 115.65 Z" class="st4"></path>		<text x="22.03" y="103.5" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>v4l2h264dec</text>		</g>	<g id="group26-24" transform="translate(506.252,-57.7582)" v:mid="26" v:groupcontext="group">		<title>Sheet.26</title>		<g id="shape27-25" v:mid="27" v:groupcontext="shape" transform="translate(0,-2.99179)">			<title>Sheet.27</title>			<path d="M0 118.65 L14.44 118.65" class="st6"></path>		</g>		<g id="shape28-28" v:mid="28" v:groupcontext="shape" transform="translate(13.5688,-1.42109E-14)">			<title>Sheet.28</title>			<path d="M0 118.65 L5.18 115.66 L0 112.67 L0 118.65 Z" class="st7"></path>		</g>	</g>	<g id="shape30-30" v:mid="30" v:groupcontext="shape" transform="translate(525.002,-42)">		<title>Sheet.30</title>		<desc>qtioverlay</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="56.25" cy="99.9012" width="112.51" height="37.5"></v:textrect>		<path d="M0 115.65 A3.00007 3.00007 -180 0 0 3 118.65 L109.5 118.65 A3.00007 3.00007 -180 0 0 112.5 115.65 L112.5 84.15					 A3.00007 3.00007 -180 0 0 109.5 81.15 L3 81.15 A3.00007 3.00007 -180 0 0 0 84.15 L0 115.65 Z" class="st8"></path>		<text x="30.33" y="103.5" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtioverlay</text>		</g>	<g id="group32-33" transform="translate(637.502,-57.7582)" v:mid="32" v:groupcontext="group">		<title>Sheet.32</title>		<g id="shape33-34" v:mid="33" v:groupcontext="shape" transform="translate(0,-2.99179)">			<title>Sheet.33</title>			<path d="M0 118.65 L14.44 118.65" class="st6"></path>		</g>		<g id="shape34-37" v:mid="34" v:groupcontext="shape" transform="translate(13.5688,-1.42109E-14)">			<title>Sheet.34</title>			<path d="M0 118.65 L5.18 115.66 L0 112.67 L0 118.65 Z" class="st7"></path>		</g>	</g>	<g id="shape36-39" v:mid="36" v:groupcontext="shape" transform="translate(656.252,-42)">		<title>Sheet.36</title>		<desc>Waylandsink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="56.25" cy="99.9012" width="112.51" height="37.5"></v:textrect>		<path d="M0 115.65 A3.00007 3.00007 -180 0 0 3 118.65 L109.5 118.65 A3.00007 3.00007 -180 0 0 112.5 115.65 L112.5 84.15					 A3.00007 3.00007 -180 0 0 109.5 81.15 L3 81.15 A3.00007 3.00007 -180 0 0 -0 84.15 L0 115.65 Z" class="st4"></path>		<text x="22.51" y="103.5" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Waylandsink</text>		</g>	<g id="shape39-42" v:mid="39" v:groupcontext="shape" transform="translate(15.0008,-42)">		<title>Sheet.39</title>		<desc>filesrc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="52.5" cy="99.9012" width="105" height="37.5"></v:textrect>		<path d="M0 115.65 A3.00007 3.00007 -180 0 0 3 118.65 L102 118.65 A3.00007 3.00007 -180 0 0 105 115.65 L105 84.15 A3.00007					 3.00007 -180 0 0 102 81.15 L3 81.15 A3.00007 3.00007 -180 0 0 0 84.15 L0 115.65 Z" class="st4"></path>		<text x="36.06" y="103.5" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>filesrc</text>		</g>	<g id="group41-45" transform="translate(120.001,-57.7582)" v:mid="41" v:groupcontext="group">		<title>Sheet.41</title>		<g id="shape42-46" v:mid="42" v:groupcontext="shape" transform="translate(0,-2.99179)">			<title>Sheet.42</title>			<path d="M0 118.65 L14.44 118.65" class="st6"></path>		</g>		<g id="shape43-49" v:mid="43" v:groupcontext="shape" transform="translate(13.5689,-1.42109E-14)">			<title>Sheet.43</title>			<path d="M0 118.65 L5.18 115.66 L0 112.67 L0 118.65 Z" class="st7"></path>		</g>	</g>	<g id="shape45-51" v:mid="45" v:groupcontext="shape" transform="translate(138.751,-42)">		<title>Sheet.45</title>		<desc>qtdemux</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="52.5" cy="99.9012" width="105" height="37.5"></v:textrect>		<path d="M0 115.65 A3.00007 3.00007 -180 0 0 3 118.65 L102 118.65 A3.00007 3.00007 -180 0 0 105 115.65 L105 84.15 A3.00007					 3.00007 -180 0 0 102 81.15 L3 81.15 A3.00007 3.00007 -180 0 0 0 84.15 L0 115.65 Z" class="st4"></path>		<text x="29.03" y="103.5" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtdemux</text>		</g>	<g id="group48-54" transform="translate(658.627,-14.7814)" v:mid="48" v:groupcontext="group">		<title>Sheet.48</title>		<g id="shape7-55" v:mid="7" v:groupcontext="shape" transform="translate(15.1883,0)">			<title>Sheet.7</title>			<desc>Qualcomm</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="27.803" cy="112.351" width="55.61" height="12.6"></v:textrect>			<rect x="0" y="106.051" width="55.606" height="12.6" class="st9"></rect>			<text x="0" y="115.5" class="st10" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>Qualcomm  </text>			</g>		<g id="shape8-58" v:mid="8" v:groupcontext="shape" transform="translate(1.26898E-13,-0.218619)">			<title>Sheet.8</title>			<path d="M0 117.15 A1.50003 1.50003 -180 0 0 1.5 118.65 L10.5 118.65 A1.50003 1.50003 -180 0 0 12 117.15 L12 108.15						 A1.50003 1.50003 -180 0 0 10.5 106.65 L1.5 106.65 A1.50003 1.50003 -180 0 0 0 108.15 L0 117.15 Z" class="st8"></path>		</g>		<g id="shape10-60" v:mid="10" v:groupcontext="shape" transform="translate(89.1246,0)">			<title>Sheet.10</title>			<desc>开源</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="10.5" cy="112.351" width="21" height="12.6"></v:textrect>			<rect x="0" y="106.051" width="21" height="12.6" class="st9"></rect>			<text x="0" y="115.85" class="st11" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>开源</text>			</g>		<g id="shape11-63" v:mid="11" v:groupcontext="shape" transform="translate(73.9363,-0.218619)">			<title>Sheet.11</title>			<path d="M0 117.15 A1.50003 1.50003 -180 0 0 1.5 118.65 L10.5 118.65 A1.50003 1.50003 -180 0 0 12 117.15 L12 108.15						 A1.50003 1.50003 -180 0 0 10.5 106.65 L1.5 106.65 A1.50003 1.50003 -180 0 0 0 108.15 L0 117.15 Z" class="st4"></path>		</g>	</g></g>
</svg>
- 覆盖来自摄像头的实时流：

        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 - 摄像头源
                    
                    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by Microsoft Visio, SVG Export pipeline_textoverlay_video_camsource.svg pipeline_textoverlay_video_cams -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:v="http://schemas.microsoft.com/visio/2003/SVGExtensions/" width="5.9375in" height="1.56085in" viewbox="0 0 427.5 112.382" xml:space="preserve" color-interpolation-filters="sRGB" class="st12"><v:documentproperties v:langid="1033" v:viewmarkup="false"></v:documentproperties>
<style>.svg-4 .st1 { fill: #fafafa; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-4 .st2 { fill: #000000; font-family: Roboto; font-size: 1.00001em; font-weight: bold }
.svg-4 .st3 { fill: #d2d7e1; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-4 .st4 { fill: #2a2aea; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-4 .st5 { fill: #ffffff; font-family: Roboto; font-size: 1.00001em }
.svg-4 .st6 { stroke: #000000; stroke-linecap: butt; stroke-width: 0.75 }
.svg-4 .st7 { fill: #000000; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-4 .st8 { fill: #007884; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-4 .st9 { fill: none; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-4 .st10 { fill: #000000; font-family: Roboto; font-size: 0.874992em }
.svg-4 .st11 { fill: #000000; font-family: SimHei; font-size: 0.874992em }
.svg-4 .st12 { fill: none; fill-rule: evenodd; font-size: 12px; overflow: visible; stroke-linecap: square; stroke-miterlimit: 3 }</style>
<g v:mid="0" v:index="1" v:groupcontext="foregroundPage">	<title>pipeline_textoverlay_video_cams</title>	<v:pageproperties v:drawingscale="1" v:pagescale="1" v:drawingunits="19" v:shadowoffsetx="9" v:shadowoffsety="-9"></v:pageproperties>	<v:layer v:name="Connector" v:index="0"></v:layer>	<g id="shape3-1" v:mid="3" v:groupcontext="shape" transform="translate(0.375,-0.375069)">		<title>Sheet.3</title>		<desc>GST BIN</desc>		<v:textblock v:margins="rect(7.2,0,0,0)" v:verticalalign="0"></v:textblock>		<v:textrect cx="213.375" cy="56.5659" width="426.76" height="111.631"></v:textrect>		<path d="M0 106.76 A5.62513 5.62513 -180 0 0 5.63 112.38 L421.13 112.38 A5.62513 5.62513 -180 0 0 426.75 106.76 L426.75					 6.38 A5.62513 5.62513 -180 0 0 421.13 0.75 L5.63 0.75 A5.62513 5.62513 -180 0 0 0 6.38 L0 106.76 Z" class="st1"></path>		<text x="190.58" y="18.75" class="st2" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>GST BIN</text>		</g>	<g id="shape4-4" v:mid="4" v:groupcontext="shape">		<title>Sheet.4</title>		<path d="M421.5 0.75 C424.39 0.75 426.75 3.11 426.75 6 L426.75 106.38 C426.75 109.28 424.39 111.63 421.5 111.63 L6 111.63					 C3.11 111.63 0.75 109.28 0.75 106.38 L0.75 6 C0.75 3.11 3.11 0.75 6 0.75 L421.5 0.75 ZM421.5 0 L6 0 C2.69					 0 0 2.69 0 6 L0 106.38 C0 109.7 2.69 112.38 6 112.38 L421.5 112.38 C424.81 112.38 427.5 109.7 427.5 106.38					 L427.5 6 C427.5 2.69 424.81 0 421.5 0 Z" class="st3"></path>	</g>	<g id="shape15-6" v:mid="15" v:groupcontext="shape" transform="translate(153.75,-42)">		<title>Sheet.15</title>		<desc>qtioverlay</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="93.6316" width="120" height="37.5"></v:textrect>		<path d="M0 109.38 A3.00007 3.00007 -180 0 0 3 112.38 L117 112.38 A3.00007 3.00007 -180 0 0 120 109.38 L120 77.88 A3.00007					 3.00007 -180 0 0 117 74.88 L3 74.88 A3.00007 3.00007 -180 0 0 0 77.88 L0 109.38 Z" class="st4"></path>		<text x="34.08" y="97.23" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtioverlay</text>		</g>	<g id="shape18-9" v:mid="18" v:groupcontext="shape" transform="translate(273.75,-60.75)">		<title>Sheet.18</title>		<path d="M0 112.38 L14.44 112.38" class="st6"></path>	</g>	<g id="shape19-12" v:mid="19" v:groupcontext="shape" transform="translate(287.319,-57.7582)">		<title>Sheet.19</title>		<path d="M0 112.38 L5.18 109.39 L0 106.4 L0 112.38 Z" class="st7"></path>	</g>	<g id="shape21-14" v:mid="21" v:groupcontext="shape" transform="translate(135,-60.75)">		<title>Sheet.21</title>		<path d="M0 112.38 L14.44 112.38" class="st6"></path>	</g>	<g id="shape22-17" v:mid="22" v:groupcontext="shape" transform="translate(148.569,-57.7582)">		<title>Sheet.22</title>		<path d="M0 112.38 L5.18 109.39 L0 106.4 L0 112.38 Z" class="st7"></path>	</g>	<g id="shape24-19" v:mid="24" v:groupcontext="shape" transform="translate(292.5,-42)">		<title>Sheet.24</title>		<desc>Waylandsink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="93.6316" width="120" height="37.5"></v:textrect>		<path d="M0 109.38 A3.00007 3.00007 -180 0 0 3 112.38 L117 112.38 A3.00007 3.00007 -180 0 0 120 109.38 L120 77.88 A3.00007					 3.00007 -180 0 0 117 74.88 L3 74.88 A3.00007 3.00007 -180 0 0 0 77.88 L0 109.38 Z" class="st8"></path>		<text x="26.26" y="97.23" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Waylandsink</text>		</g>	<g id="shape27-22" v:mid="27" v:groupcontext="shape" transform="translate(15,-42)">		<title>Sheet.27</title>		<desc>camsrc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="93.6316" width="120" height="37.5"></v:textrect>		<path d="M0 109.38 A3.00007 3.00007 -180 0 0 3 112.38 L117 112.38 A3.00007 3.00007 -180 0 0 120 109.38 L120 77.88 A3.00007					 3.00007 -180 0 0 117 74.88 L3 74.88 A3.00007 3.00007 -180 0 0 0 77.88 L0 109.38 Z" class="st8"></path>		<text x="40.07" y="97.23" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>camsrc</text>		</g>	<g id="group32-25" transform="translate(302.375,-14.7814)" v:mid="32" v:groupcontext="group">		<title>Sheet.32</title>		<g id="shape8-26" v:mid="8" v:groupcontext="shape" transform="translate(15.1882,1.42109E-14)">			<title>Sheet.8</title>			<desc>Qualcomm</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="27.5654" cy="106.082" width="55.14" height="12.6"></v:textrect>			<rect x="0" y="99.7816" width="55.1308" height="12.6" class="st9"></rect>			<text x="-0" y="109.23" class="st10" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>Qualcomm  </text>			</g>		<g id="shape9-29" v:mid="9" v:groupcontext="shape" transform="translate(9.99201E-16,-0.218619)">			<title>Sheet.9</title>			<path d="M0 110.88 A1.50003 1.50003 -180 0 0 1.5 112.38 L10.5 112.38 A1.50003 1.50003 -180 0 0 12 110.88 L12 101.88						 A1.50003 1.50003 -180 0 0 10.5 100.38 L1.5 100.38 A1.50003 1.50003 -180 0 0 -0 101.88 L0 110.88 Z" class="st4"></path>		</g>		<g id="shape11-31" v:mid="11" v:groupcontext="shape" transform="translate(89.1246,1.42109E-14)">			<title>Sheet.11</title>			<desc>开源</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="10.5" cy="106.082" width="21" height="12.6"></v:textrect>			<rect x="0" y="99.7816" width="21" height="12.6" class="st9"></rect>			<text x="0" y="109.58" class="st11" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>开源</text>			</g>		<g id="shape12-34" v:mid="12" v:groupcontext="shape" transform="translate(73.9363,-0.218619)">			<title>Sheet.12</title>			<path d="M0 110.88 A1.50003 1.50003 -180 0 0 1.5 112.38 L10.5 112.38 A1.50003 1.50003 -180 0 0 12 110.88 L12 101.88						 A1.50003 1.50003 -180 0 0 10.5 100.38 L1.5 100.38 A1.50003 1.50003 -180 0 0 0 101.88 L0 110.88 Z" class="st8"></path>		</g>	</g></g>
</svg>

## 静态图像叠加

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

该用例展示了如何在视频流上叠加静态图像。

1. 在 Linux 主机的终端中，运行以下命令将静态图像推送到目标设备：

        scp -r <static_image>.rgba  root@[DEVICE IP-ADDR]:/optCopy to clipboard
2. 在目标设备上运行用例：
    - 叠加在视频上：

            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 - 文件源
                            
                            <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by Microsoft Visio, SVG Export pipeline_textoverlay_video_filesource.svg pipeline_textoverlay_video_file -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:v="http://schemas.microsoft.com/visio/2003/SVGExtensions/" width="10.8854in" height="1.64793in" viewbox="0 0 783.752 118.651" xml:space="preserve" color-interpolation-filters="sRGB" class="st12"><v:documentproperties v:langid="1033" v:viewmarkup="false"></v:documentproperties>
<style>.svg-5 .st1 { fill: #fafafa; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-5 .st2 { fill: #000000; font-family: Roboto; font-size: 1.00001em; font-weight: bold }
.svg-5 .st3 { fill: #d2d7e1; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-5 .st4 { fill: #007884; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-5 .st5 { fill: #ffffff; font-family: Roboto; font-size: 1.00001em }
.svg-5 .st6 { stroke: #000000; stroke-linecap: butt; stroke-width: 0.75 }
.svg-5 .st7 { fill: #000000; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-5 .st8 { fill: #2a2aea; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-5 .st9 { fill: none; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-5 .st10 { fill: #000000; font-family: Roboto; font-size: 0.874992em }
.svg-5 .st11 { fill: #000000; font-family: SimHei; font-size: 0.874992em }
.svg-5 .st12 { fill: none; fill-rule: evenodd; font-size: 12px; overflow: visible; stroke-linecap: square; stroke-miterlimit: 3 }</style>
<g v:mid="0" v:index="1" v:groupcontext="foregroundPage">	<title>pipeline_textoverlay_video_file</title>	<v:pageproperties v:drawingscale="1" v:pagescale="1" v:drawingunits="19" v:shadowoffsetx="9" v:shadowoffsety="-9"></v:pageproperties>	<g id="shape3-1" v:mid="3" v:groupcontext="shape" transform="translate(0.375114,-0.375092)">		<title>Sheet.3</title>		<desc>GST BIN</desc>		<v:textblock v:margins="rect(7.2,0,0,0)" v:verticalalign="0"></v:textblock>		<v:textrect cx="391.501" cy="59.7006" width="783.01" height="117.901"></v:textrect>		<path d="M0 113.03 A5.62513 5.62513 -180 0 0 5.62 118.65 L777.38 118.65 A5.62513 5.62513 -180 0 0 783 113.03 L783 6.37					 A5.62513 5.62513 -180 0 0 777.38 0.75 L5.62 0.75 A5.62513 5.62513 -180 0 0 0 6.37 L0 113.03 Z" class="st1"></path>		<text x="368.7" y="18.75" class="st2" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>GST BIN</text>		</g>	<g id="shape4-4" v:mid="4" v:groupcontext="shape">		<title>Sheet.4</title>		<path d="M777.75 0.75 C780.65 0.75 783 3.11 783 6 L783 112.65 C783 115.55 780.65 117.9 777.75 117.9 L6 117.9 C3.11 117.9					 0.75 115.55 0.75 112.65 L0.75 6 C0.75 3.11 3.11 0.75 6 0.75 L777.75 0.75 ZM777.75 0 L6 0 C2.69 0 0 2.69					 0 6 L0 112.65 C0 115.96 2.69 118.65 6 118.65 L777.75 118.65 C781.07 118.65 783.75 115.96 783.75 112.65 L783.75					 6 C783.75 2.69 781.07 0 777.75 0 Z" class="st3"></path>	</g>	<g id="shape15-6" v:mid="15" v:groupcontext="shape" transform="translate(262.502,-42)">		<title>Sheet.15</title>		<desc>h264parse</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="56.25" cy="99.9012" width="112.5" height="37.5"></v:textrect>		<path d="M0 115.65 A3.00007 3.00007 -180 0 0 3 118.65 L109.5 118.65 A3.00007 3.00007 -180 0 0 112.5 115.65 L112.5 84.15					 A3.00007 3.00007 -180 0 0 109.5 81.15 L3 81.15 A3.00007 3.00007 -180 0 0 0 84.15 L0 115.65 Z" class="st4"></path>		<text x="27.9" y="103.5" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>h264parse</text>		</g>	<g id="group17-9" transform="translate(375.002,-57.7582)" v:mid="17" v:groupcontext="group">		<title>Sheet.17</title>		<g id="shape18-10" v:mid="18" v:groupcontext="shape" transform="translate(0,-2.99179)">			<title>Sheet.18</title>			<path d="M0 118.65 L14.44 118.65" class="st6"></path>		</g>		<g id="shape19-13" v:mid="19" v:groupcontext="shape" transform="translate(13.5688,-1.42109E-14)">			<title>Sheet.19</title>			<path d="M0 118.65 L5.18 115.66 L0 112.67 L0 118.65 Z" class="st7"></path>		</g>	</g>	<g id="group20-15" transform="translate(243.751,-57.7582)" v:mid="20" v:groupcontext="group">		<title>Sheet.20</title>		<g id="shape21-16" v:mid="21" v:groupcontext="shape" transform="translate(0,-2.99179)">			<title>Sheet.21</title>			<path d="M0 118.65 L14.44 118.65" class="st6"></path>		</g>		<g id="shape22-19" v:mid="22" v:groupcontext="shape" transform="translate(13.5689,-1.42109E-14)">			<title>Sheet.22</title>			<path d="M0 118.65 L5.18 115.66 L0 112.67 L0 118.65 Z" class="st7"></path>		</g>	</g>	<g id="shape24-21" v:mid="24" v:groupcontext="shape" transform="translate(393.752,-42)">		<title>Sheet.24</title>		<desc>v4l2h264dec</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="56.25" cy="99.9012" width="112.5" height="37.5"></v:textrect>		<path d="M0 115.65 A3.00007 3.00007 -180 0 0 3 118.65 L109.5 118.65 A3.00007 3.00007 -180 0 0 112.5 115.65 L112.5 84.15					 A3.00007 3.00007 -180 0 0 109.5 81.15 L3 81.15 A3.00007 3.00007 -180 0 0 0 84.15 L0 115.65 Z" class="st4"></path>		<text x="22.03" y="103.5" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>v4l2h264dec</text>		</g>	<g id="group26-24" transform="translate(506.252,-57.7582)" v:mid="26" v:groupcontext="group">		<title>Sheet.26</title>		<g id="shape27-25" v:mid="27" v:groupcontext="shape" transform="translate(0,-2.99179)">			<title>Sheet.27</title>			<path d="M0 118.65 L14.44 118.65" class="st6"></path>		</g>		<g id="shape28-28" v:mid="28" v:groupcontext="shape" transform="translate(13.5688,-1.42109E-14)">			<title>Sheet.28</title>			<path d="M0 118.65 L5.18 115.66 L0 112.67 L0 118.65 Z" class="st7"></path>		</g>	</g>	<g id="shape30-30" v:mid="30" v:groupcontext="shape" transform="translate(525.002,-42)">		<title>Sheet.30</title>		<desc>qtioverlay</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="56.25" cy="99.9012" width="112.51" height="37.5"></v:textrect>		<path d="M0 115.65 A3.00007 3.00007 -180 0 0 3 118.65 L109.5 118.65 A3.00007 3.00007 -180 0 0 112.5 115.65 L112.5 84.15					 A3.00007 3.00007 -180 0 0 109.5 81.15 L3 81.15 A3.00007 3.00007 -180 0 0 0 84.15 L0 115.65 Z" class="st8"></path>		<text x="30.33" y="103.5" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtioverlay</text>		</g>	<g id="group32-33" transform="translate(637.502,-57.7582)" v:mid="32" v:groupcontext="group">		<title>Sheet.32</title>		<g id="shape33-34" v:mid="33" v:groupcontext="shape" transform="translate(0,-2.99179)">			<title>Sheet.33</title>			<path d="M0 118.65 L14.44 118.65" class="st6"></path>		</g>		<g id="shape34-37" v:mid="34" v:groupcontext="shape" transform="translate(13.5688,-1.42109E-14)">			<title>Sheet.34</title>			<path d="M0 118.65 L5.18 115.66 L0 112.67 L0 118.65 Z" class="st7"></path>		</g>	</g>	<g id="shape36-39" v:mid="36" v:groupcontext="shape" transform="translate(656.252,-42)">		<title>Sheet.36</title>		<desc>Waylandsink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="56.25" cy="99.9012" width="112.51" height="37.5"></v:textrect>		<path d="M0 115.65 A3.00007 3.00007 -180 0 0 3 118.65 L109.5 118.65 A3.00007 3.00007 -180 0 0 112.5 115.65 L112.5 84.15					 A3.00007 3.00007 -180 0 0 109.5 81.15 L3 81.15 A3.00007 3.00007 -180 0 0 -0 84.15 L0 115.65 Z" class="st4"></path>		<text x="22.51" y="103.5" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Waylandsink</text>		</g>	<g id="shape39-42" v:mid="39" v:groupcontext="shape" transform="translate(15.0008,-42)">		<title>Sheet.39</title>		<desc>filesrc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="52.5" cy="99.9012" width="105" height="37.5"></v:textrect>		<path d="M0 115.65 A3.00007 3.00007 -180 0 0 3 118.65 L102 118.65 A3.00007 3.00007 -180 0 0 105 115.65 L105 84.15 A3.00007					 3.00007 -180 0 0 102 81.15 L3 81.15 A3.00007 3.00007 -180 0 0 0 84.15 L0 115.65 Z" class="st4"></path>		<text x="36.06" y="103.5" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>filesrc</text>		</g>	<g id="group41-45" transform="translate(120.001,-57.7582)" v:mid="41" v:groupcontext="group">		<title>Sheet.41</title>		<g id="shape42-46" v:mid="42" v:groupcontext="shape" transform="translate(0,-2.99179)">			<title>Sheet.42</title>			<path d="M0 118.65 L14.44 118.65" class="st6"></path>		</g>		<g id="shape43-49" v:mid="43" v:groupcontext="shape" transform="translate(13.5689,-1.42109E-14)">			<title>Sheet.43</title>			<path d="M0 118.65 L5.18 115.66 L0 112.67 L0 118.65 Z" class="st7"></path>		</g>	</g>	<g id="shape45-51" v:mid="45" v:groupcontext="shape" transform="translate(138.751,-42)">		<title>Sheet.45</title>		<desc>qtdemux</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="52.5" cy="99.9012" width="105" height="37.5"></v:textrect>		<path d="M0 115.65 A3.00007 3.00007 -180 0 0 3 118.65 L102 118.65 A3.00007 3.00007 -180 0 0 105 115.65 L105 84.15 A3.00007					 3.00007 -180 0 0 102 81.15 L3 81.15 A3.00007 3.00007 -180 0 0 0 84.15 L0 115.65 Z" class="st4"></path>		<text x="29.03" y="103.5" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtdemux</text>		</g>	<g id="group48-54" transform="translate(658.627,-14.7814)" v:mid="48" v:groupcontext="group">		<title>Sheet.48</title>		<g id="shape7-55" v:mid="7" v:groupcontext="shape" transform="translate(15.1883,0)">			<title>Sheet.7</title>			<desc>Qualcomm</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="27.803" cy="112.351" width="55.61" height="12.6"></v:textrect>			<rect x="0" y="106.051" width="55.606" height="12.6" class="st9"></rect>			<text x="0" y="115.5" class="st10" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>Qualcomm  </text>			</g>		<g id="shape8-58" v:mid="8" v:groupcontext="shape" transform="translate(1.26898E-13,-0.218619)">			<title>Sheet.8</title>			<path d="M0 117.15 A1.50003 1.50003 -180 0 0 1.5 118.65 L10.5 118.65 A1.50003 1.50003 -180 0 0 12 117.15 L12 108.15						 A1.50003 1.50003 -180 0 0 10.5 106.65 L1.5 106.65 A1.50003 1.50003 -180 0 0 0 108.15 L0 117.15 Z" class="st8"></path>		</g>		<g id="shape10-60" v:mid="10" v:groupcontext="shape" transform="translate(89.1246,0)">			<title>Sheet.10</title>			<desc>开源</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="10.5" cy="112.351" width="21" height="12.6"></v:textrect>			<rect x="0" y="106.051" width="21" height="12.6" class="st9"></rect>			<text x="0" y="115.85" class="st11" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>开源</text>			</g>		<g id="shape11-63" v:mid="11" v:groupcontext="shape" transform="translate(73.9363,-0.218619)">			<title>Sheet.11</title>			<path d="M0 117.15 A1.50003 1.50003 -180 0 0 1.5 118.65 L10.5 118.65 A1.50003 1.50003 -180 0 0 12 117.15 L12 108.15						 A1.50003 1.50003 -180 0 0 10.5 106.65 L1.5 106.65 A1.50003 1.50003 -180 0 0 0 108.15 L0 117.15 Z" class="st4"></path>		</g>	</g></g>
</svg>
    - 覆盖来自摄像头的实时流：

            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 - 摄像头源
                            
                            <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by Microsoft Visio, SVG Export pipeline_textoverlay_video_camsource.svg pipeline_textoverlay_video_cams -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:v="http://schemas.microsoft.com/visio/2003/SVGExtensions/" width="5.9375in" height="1.56085in" viewbox="0 0 427.5 112.382" xml:space="preserve" color-interpolation-filters="sRGB" class="st12"><v:documentproperties v:langid="1033" v:viewmarkup="false"></v:documentproperties>
<style>.svg-6 .st1 { fill: #fafafa; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-6 .st2 { fill: #000000; font-family: Roboto; font-size: 1.00001em; font-weight: bold }
.svg-6 .st3 { fill: #d2d7e1; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-6 .st4 { fill: #2a2aea; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-6 .st5 { fill: #ffffff; font-family: Roboto; font-size: 1.00001em }
.svg-6 .st6 { stroke: #000000; stroke-linecap: butt; stroke-width: 0.75 }
.svg-6 .st7 { fill: #000000; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-6 .st8 { fill: #007884; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-6 .st9 { fill: none; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-6 .st10 { fill: #000000; font-family: Roboto; font-size: 0.874992em }
.svg-6 .st11 { fill: #000000; font-family: SimHei; font-size: 0.874992em }
.svg-6 .st12 { fill: none; fill-rule: evenodd; font-size: 12px; overflow: visible; stroke-linecap: square; stroke-miterlimit: 3 }</style>
<g v:mid="0" v:index="1" v:groupcontext="foregroundPage">	<title>pipeline_textoverlay_video_cams</title>	<v:pageproperties v:drawingscale="1" v:pagescale="1" v:drawingunits="19" v:shadowoffsetx="9" v:shadowoffsety="-9"></v:pageproperties>	<v:layer v:name="Connector" v:index="0"></v:layer>	<g id="shape3-1" v:mid="3" v:groupcontext="shape" transform="translate(0.375,-0.375069)">		<title>Sheet.3</title>		<desc>GST BIN</desc>		<v:textblock v:margins="rect(7.2,0,0,0)" v:verticalalign="0"></v:textblock>		<v:textrect cx="213.375" cy="56.5659" width="426.76" height="111.631"></v:textrect>		<path d="M0 106.76 A5.62513 5.62513 -180 0 0 5.63 112.38 L421.13 112.38 A5.62513 5.62513 -180 0 0 426.75 106.76 L426.75					 6.38 A5.62513 5.62513 -180 0 0 421.13 0.75 L5.63 0.75 A5.62513 5.62513 -180 0 0 0 6.38 L0 106.76 Z" class="st1"></path>		<text x="190.58" y="18.75" class="st2" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>GST BIN</text>		</g>	<g id="shape4-4" v:mid="4" v:groupcontext="shape">		<title>Sheet.4</title>		<path d="M421.5 0.75 C424.39 0.75 426.75 3.11 426.75 6 L426.75 106.38 C426.75 109.28 424.39 111.63 421.5 111.63 L6 111.63					 C3.11 111.63 0.75 109.28 0.75 106.38 L0.75 6 C0.75 3.11 3.11 0.75 6 0.75 L421.5 0.75 ZM421.5 0 L6 0 C2.69					 0 0 2.69 0 6 L0 106.38 C0 109.7 2.69 112.38 6 112.38 L421.5 112.38 C424.81 112.38 427.5 109.7 427.5 106.38					 L427.5 6 C427.5 2.69 424.81 0 421.5 0 Z" class="st3"></path>	</g>	<g id="shape15-6" v:mid="15" v:groupcontext="shape" transform="translate(153.75,-42)">		<title>Sheet.15</title>		<desc>qtioverlay</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="93.6316" width="120" height="37.5"></v:textrect>		<path d="M0 109.38 A3.00007 3.00007 -180 0 0 3 112.38 L117 112.38 A3.00007 3.00007 -180 0 0 120 109.38 L120 77.88 A3.00007					 3.00007 -180 0 0 117 74.88 L3 74.88 A3.00007 3.00007 -180 0 0 0 77.88 L0 109.38 Z" class="st4"></path>		<text x="34.08" y="97.23" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtioverlay</text>		</g>	<g id="shape18-9" v:mid="18" v:groupcontext="shape" transform="translate(273.75,-60.75)">		<title>Sheet.18</title>		<path d="M0 112.38 L14.44 112.38" class="st6"></path>	</g>	<g id="shape19-12" v:mid="19" v:groupcontext="shape" transform="translate(287.319,-57.7582)">		<title>Sheet.19</title>		<path d="M0 112.38 L5.18 109.39 L0 106.4 L0 112.38 Z" class="st7"></path>	</g>	<g id="shape21-14" v:mid="21" v:groupcontext="shape" transform="translate(135,-60.75)">		<title>Sheet.21</title>		<path d="M0 112.38 L14.44 112.38" class="st6"></path>	</g>	<g id="shape22-17" v:mid="22" v:groupcontext="shape" transform="translate(148.569,-57.7582)">		<title>Sheet.22</title>		<path d="M0 112.38 L5.18 109.39 L0 106.4 L0 112.38 Z" class="st7"></path>	</g>	<g id="shape24-19" v:mid="24" v:groupcontext="shape" transform="translate(292.5,-42)">		<title>Sheet.24</title>		<desc>Waylandsink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="93.6316" width="120" height="37.5"></v:textrect>		<path d="M0 109.38 A3.00007 3.00007 -180 0 0 3 112.38 L117 112.38 A3.00007 3.00007 -180 0 0 120 109.38 L120 77.88 A3.00007					 3.00007 -180 0 0 117 74.88 L3 74.88 A3.00007 3.00007 -180 0 0 0 77.88 L0 109.38 Z" class="st8"></path>		<text x="26.26" y="97.23" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Waylandsink</text>		</g>	<g id="shape27-22" v:mid="27" v:groupcontext="shape" transform="translate(15,-42)">		<title>Sheet.27</title>		<desc>camsrc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="93.6316" width="120" height="37.5"></v:textrect>		<path d="M0 109.38 A3.00007 3.00007 -180 0 0 3 112.38 L117 112.38 A3.00007 3.00007 -180 0 0 120 109.38 L120 77.88 A3.00007					 3.00007 -180 0 0 117 74.88 L3 74.88 A3.00007 3.00007 -180 0 0 0 77.88 L0 109.38 Z" class="st8"></path>		<text x="40.07" y="97.23" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>camsrc</text>		</g>	<g id="group32-25" transform="translate(302.375,-14.7814)" v:mid="32" v:groupcontext="group">		<title>Sheet.32</title>		<g id="shape8-26" v:mid="8" v:groupcontext="shape" transform="translate(15.1882,1.42109E-14)">			<title>Sheet.8</title>			<desc>Qualcomm</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="27.5654" cy="106.082" width="55.14" height="12.6"></v:textrect>			<rect x="0" y="99.7816" width="55.1308" height="12.6" class="st9"></rect>			<text x="-0" y="109.23" class="st10" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>Qualcomm  </text>			</g>		<g id="shape9-29" v:mid="9" v:groupcontext="shape" transform="translate(9.99201E-16,-0.218619)">			<title>Sheet.9</title>			<path d="M0 110.88 A1.50003 1.50003 -180 0 0 1.5 112.38 L10.5 112.38 A1.50003 1.50003 -180 0 0 12 110.88 L12 101.88						 A1.50003 1.50003 -180 0 0 10.5 100.38 L1.5 100.38 A1.50003 1.50003 -180 0 0 -0 101.88 L0 110.88 Z" class="st4"></path>		</g>		<g id="shape11-31" v:mid="11" v:groupcontext="shape" transform="translate(89.1246,1.42109E-14)">			<title>Sheet.11</title>			<desc>开源</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="10.5" cy="106.082" width="21" height="12.6"></v:textrect>			<rect x="0" y="99.7816" width="21" height="12.6" class="st9"></rect>			<text x="0" y="109.58" class="st11" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>开源</text>			</g>		<g id="shape12-34" v:mid="12" v:groupcontext="shape" transform="translate(73.9363,-0.218619)">			<title>Sheet.12</title>			<path d="M0 110.88 A1.50003 1.50003 -180 0 0 1.5 112.38 L10.5 112.38 A1.50003 1.50003 -180 0 0 12 110.88 L12 101.88						 A1.50003 1.50003 -180 0 0 10.5 100.38 L1.5 100.38 A1.50003 1.50003 -180 0 0 0 101.88 L0 110.88 Z" class="st8"></path>		</g>	</g></g>
</svg>

## 边界框叠加

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

该用例展示了如何在视频流上叠加带标签的边界框。

在目标设备上运行以下用例：

- 叠加在视频上：

        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 - 文件源
                    
                    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by Microsoft Visio, SVG Export pipeline_textoverlay_video_filesource.svg pipeline_textoverlay_video_file -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:v="http://schemas.microsoft.com/visio/2003/SVGExtensions/" width="10.8854in" height="1.64793in" viewbox="0 0 783.752 118.651" xml:space="preserve" color-interpolation-filters="sRGB" class="st12"><v:documentproperties v:langid="1033" v:viewmarkup="false"></v:documentproperties>
<style>.svg-7 .st1 { fill: #fafafa; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-7 .st2 { fill: #000000; font-family: Roboto; font-size: 1.00001em; font-weight: bold }
.svg-7 .st3 { fill: #d2d7e1; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-7 .st4 { fill: #007884; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-7 .st5 { fill: #ffffff; font-family: Roboto; font-size: 1.00001em }
.svg-7 .st6 { stroke: #000000; stroke-linecap: butt; stroke-width: 0.75 }
.svg-7 .st7 { fill: #000000; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-7 .st8 { fill: #2a2aea; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-7 .st9 { fill: none; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-7 .st10 { fill: #000000; font-family: Roboto; font-size: 0.874992em }
.svg-7 .st11 { fill: #000000; font-family: SimHei; font-size: 0.874992em }
.svg-7 .st12 { fill: none; fill-rule: evenodd; font-size: 12px; overflow: visible; stroke-linecap: square; stroke-miterlimit: 3 }</style>
<g v:mid="0" v:index="1" v:groupcontext="foregroundPage">	<title>pipeline_textoverlay_video_file</title>	<v:pageproperties v:drawingscale="1" v:pagescale="1" v:drawingunits="19" v:shadowoffsetx="9" v:shadowoffsety="-9"></v:pageproperties>	<g id="shape3-1" v:mid="3" v:groupcontext="shape" transform="translate(0.375114,-0.375092)">		<title>Sheet.3</title>		<desc>GST BIN</desc>		<v:textblock v:margins="rect(7.2,0,0,0)" v:verticalalign="0"></v:textblock>		<v:textrect cx="391.501" cy="59.7006" width="783.01" height="117.901"></v:textrect>		<path d="M0 113.03 A5.62513 5.62513 -180 0 0 5.62 118.65 L777.38 118.65 A5.62513 5.62513 -180 0 0 783 113.03 L783 6.37					 A5.62513 5.62513 -180 0 0 777.38 0.75 L5.62 0.75 A5.62513 5.62513 -180 0 0 0 6.37 L0 113.03 Z" class="st1"></path>		<text x="368.7" y="18.75" class="st2" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>GST BIN</text>		</g>	<g id="shape4-4" v:mid="4" v:groupcontext="shape">		<title>Sheet.4</title>		<path d="M777.75 0.75 C780.65 0.75 783 3.11 783 6 L783 112.65 C783 115.55 780.65 117.9 777.75 117.9 L6 117.9 C3.11 117.9					 0.75 115.55 0.75 112.65 L0.75 6 C0.75 3.11 3.11 0.75 6 0.75 L777.75 0.75 ZM777.75 0 L6 0 C2.69 0 0 2.69					 0 6 L0 112.65 C0 115.96 2.69 118.65 6 118.65 L777.75 118.65 C781.07 118.65 783.75 115.96 783.75 112.65 L783.75					 6 C783.75 2.69 781.07 0 777.75 0 Z" class="st3"></path>	</g>	<g id="shape15-6" v:mid="15" v:groupcontext="shape" transform="translate(262.502,-42)">		<title>Sheet.15</title>		<desc>h264parse</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="56.25" cy="99.9012" width="112.5" height="37.5"></v:textrect>		<path d="M0 115.65 A3.00007 3.00007 -180 0 0 3 118.65 L109.5 118.65 A3.00007 3.00007 -180 0 0 112.5 115.65 L112.5 84.15					 A3.00007 3.00007 -180 0 0 109.5 81.15 L3 81.15 A3.00007 3.00007 -180 0 0 0 84.15 L0 115.65 Z" class="st4"></path>		<text x="27.9" y="103.5" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>h264parse</text>		</g>	<g id="group17-9" transform="translate(375.002,-57.7582)" v:mid="17" v:groupcontext="group">		<title>Sheet.17</title>		<g id="shape18-10" v:mid="18" v:groupcontext="shape" transform="translate(0,-2.99179)">			<title>Sheet.18</title>			<path d="M0 118.65 L14.44 118.65" class="st6"></path>		</g>		<g id="shape19-13" v:mid="19" v:groupcontext="shape" transform="translate(13.5688,-1.42109E-14)">			<title>Sheet.19</title>			<path d="M0 118.65 L5.18 115.66 L0 112.67 L0 118.65 Z" class="st7"></path>		</g>	</g>	<g id="group20-15" transform="translate(243.751,-57.7582)" v:mid="20" v:groupcontext="group">		<title>Sheet.20</title>		<g id="shape21-16" v:mid="21" v:groupcontext="shape" transform="translate(0,-2.99179)">			<title>Sheet.21</title>			<path d="M0 118.65 L14.44 118.65" class="st6"></path>		</g>		<g id="shape22-19" v:mid="22" v:groupcontext="shape" transform="translate(13.5689,-1.42109E-14)">			<title>Sheet.22</title>			<path d="M0 118.65 L5.18 115.66 L0 112.67 L0 118.65 Z" class="st7"></path>		</g>	</g>	<g id="shape24-21" v:mid="24" v:groupcontext="shape" transform="translate(393.752,-42)">		<title>Sheet.24</title>		<desc>v4l2h264dec</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="56.25" cy="99.9012" width="112.5" height="37.5"></v:textrect>		<path d="M0 115.65 A3.00007 3.00007 -180 0 0 3 118.65 L109.5 118.65 A3.00007 3.00007 -180 0 0 112.5 115.65 L112.5 84.15					 A3.00007 3.00007 -180 0 0 109.5 81.15 L3 81.15 A3.00007 3.00007 -180 0 0 0 84.15 L0 115.65 Z" class="st4"></path>		<text x="22.03" y="103.5" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>v4l2h264dec</text>		</g>	<g id="group26-24" transform="translate(506.252,-57.7582)" v:mid="26" v:groupcontext="group">		<title>Sheet.26</title>		<g id="shape27-25" v:mid="27" v:groupcontext="shape" transform="translate(0,-2.99179)">			<title>Sheet.27</title>			<path d="M0 118.65 L14.44 118.65" class="st6"></path>		</g>		<g id="shape28-28" v:mid="28" v:groupcontext="shape" transform="translate(13.5688,-1.42109E-14)">			<title>Sheet.28</title>			<path d="M0 118.65 L5.18 115.66 L0 112.67 L0 118.65 Z" class="st7"></path>		</g>	</g>	<g id="shape30-30" v:mid="30" v:groupcontext="shape" transform="translate(525.002,-42)">		<title>Sheet.30</title>		<desc>qtioverlay</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="56.25" cy="99.9012" width="112.51" height="37.5"></v:textrect>		<path d="M0 115.65 A3.00007 3.00007 -180 0 0 3 118.65 L109.5 118.65 A3.00007 3.00007 -180 0 0 112.5 115.65 L112.5 84.15					 A3.00007 3.00007 -180 0 0 109.5 81.15 L3 81.15 A3.00007 3.00007 -180 0 0 0 84.15 L0 115.65 Z" class="st8"></path>		<text x="30.33" y="103.5" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtioverlay</text>		</g>	<g id="group32-33" transform="translate(637.502,-57.7582)" v:mid="32" v:groupcontext="group">		<title>Sheet.32</title>		<g id="shape33-34" v:mid="33" v:groupcontext="shape" transform="translate(0,-2.99179)">			<title>Sheet.33</title>			<path d="M0 118.65 L14.44 118.65" class="st6"></path>		</g>		<g id="shape34-37" v:mid="34" v:groupcontext="shape" transform="translate(13.5688,-1.42109E-14)">			<title>Sheet.34</title>			<path d="M0 118.65 L5.18 115.66 L0 112.67 L0 118.65 Z" class="st7"></path>		</g>	</g>	<g id="shape36-39" v:mid="36" v:groupcontext="shape" transform="translate(656.252,-42)">		<title>Sheet.36</title>		<desc>Waylandsink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="56.25" cy="99.9012" width="112.51" height="37.5"></v:textrect>		<path d="M0 115.65 A3.00007 3.00007 -180 0 0 3 118.65 L109.5 118.65 A3.00007 3.00007 -180 0 0 112.5 115.65 L112.5 84.15					 A3.00007 3.00007 -180 0 0 109.5 81.15 L3 81.15 A3.00007 3.00007 -180 0 0 -0 84.15 L0 115.65 Z" class="st4"></path>		<text x="22.51" y="103.5" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Waylandsink</text>		</g>	<g id="shape39-42" v:mid="39" v:groupcontext="shape" transform="translate(15.0008,-42)">		<title>Sheet.39</title>		<desc>filesrc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="52.5" cy="99.9012" width="105" height="37.5"></v:textrect>		<path d="M0 115.65 A3.00007 3.00007 -180 0 0 3 118.65 L102 118.65 A3.00007 3.00007 -180 0 0 105 115.65 L105 84.15 A3.00007					 3.00007 -180 0 0 102 81.15 L3 81.15 A3.00007 3.00007 -180 0 0 0 84.15 L0 115.65 Z" class="st4"></path>		<text x="36.06" y="103.5" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>filesrc</text>		</g>	<g id="group41-45" transform="translate(120.001,-57.7582)" v:mid="41" v:groupcontext="group">		<title>Sheet.41</title>		<g id="shape42-46" v:mid="42" v:groupcontext="shape" transform="translate(0,-2.99179)">			<title>Sheet.42</title>			<path d="M0 118.65 L14.44 118.65" class="st6"></path>		</g>		<g id="shape43-49" v:mid="43" v:groupcontext="shape" transform="translate(13.5689,-1.42109E-14)">			<title>Sheet.43</title>			<path d="M0 118.65 L5.18 115.66 L0 112.67 L0 118.65 Z" class="st7"></path>		</g>	</g>	<g id="shape45-51" v:mid="45" v:groupcontext="shape" transform="translate(138.751,-42)">		<title>Sheet.45</title>		<desc>qtdemux</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="52.5" cy="99.9012" width="105" height="37.5"></v:textrect>		<path d="M0 115.65 A3.00007 3.00007 -180 0 0 3 118.65 L102 118.65 A3.00007 3.00007 -180 0 0 105 115.65 L105 84.15 A3.00007					 3.00007 -180 0 0 102 81.15 L3 81.15 A3.00007 3.00007 -180 0 0 0 84.15 L0 115.65 Z" class="st4"></path>		<text x="29.03" y="103.5" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtdemux</text>		</g>	<g id="group48-54" transform="translate(658.627,-14.7814)" v:mid="48" v:groupcontext="group">		<title>Sheet.48</title>		<g id="shape7-55" v:mid="7" v:groupcontext="shape" transform="translate(15.1883,0)">			<title>Sheet.7</title>			<desc>Qualcomm</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="27.803" cy="112.351" width="55.61" height="12.6"></v:textrect>			<rect x="0" y="106.051" width="55.606" height="12.6" class="st9"></rect>			<text x="0" y="115.5" class="st10" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>Qualcomm  </text>			</g>		<g id="shape8-58" v:mid="8" v:groupcontext="shape" transform="translate(1.26898E-13,-0.218619)">			<title>Sheet.8</title>			<path d="M0 117.15 A1.50003 1.50003 -180 0 0 1.5 118.65 L10.5 118.65 A1.50003 1.50003 -180 0 0 12 117.15 L12 108.15						 A1.50003 1.50003 -180 0 0 10.5 106.65 L1.5 106.65 A1.50003 1.50003 -180 0 0 0 108.15 L0 117.15 Z" class="st8"></path>		</g>		<g id="shape10-60" v:mid="10" v:groupcontext="shape" transform="translate(89.1246,0)">			<title>Sheet.10</title>			<desc>开源</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="10.5" cy="112.351" width="21" height="12.6"></v:textrect>			<rect x="0" y="106.051" width="21" height="12.6" class="st9"></rect>			<text x="0" y="115.85" class="st11" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>开源</text>			</g>		<g id="shape11-63" v:mid="11" v:groupcontext="shape" transform="translate(73.9363,-0.218619)">			<title>Sheet.11</title>			<path d="M0 117.15 A1.50003 1.50003 -180 0 0 1.5 118.65 L10.5 118.65 A1.50003 1.50003 -180 0 0 12 117.15 L12 108.15						 A1.50003 1.50003 -180 0 0 10.5 106.65 L1.5 106.65 A1.50003 1.50003 -180 0 0 0 108.15 L0 117.15 Z" class="st4"></path>		</g>	</g></g>
</svg>
- 覆盖来自摄像头的实时流：

        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 - 摄像头源
                    
                    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by Microsoft Visio, SVG Export pipeline_textoverlay_video_camsource.svg pipeline_textoverlay_video_cams -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:v="http://schemas.microsoft.com/visio/2003/SVGExtensions/" width="5.9375in" height="1.56085in" viewbox="0 0 427.5 112.382" xml:space="preserve" color-interpolation-filters="sRGB" class="st12"><v:documentproperties v:langid="1033" v:viewmarkup="false"></v:documentproperties>
<style>.svg-8 .st1 { fill: #fafafa; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-8 .st2 { fill: #000000; font-family: Roboto; font-size: 1.00001em; font-weight: bold }
.svg-8 .st3 { fill: #d2d7e1; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-8 .st4 { fill: #2a2aea; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-8 .st5 { fill: #ffffff; font-family: Roboto; font-size: 1.00001em }
.svg-8 .st6 { stroke: #000000; stroke-linecap: butt; stroke-width: 0.75 }
.svg-8 .st7 { fill: #000000; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-8 .st8 { fill: #007884; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-8 .st9 { fill: none; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-8 .st10 { fill: #000000; font-family: Roboto; font-size: 0.874992em }
.svg-8 .st11 { fill: #000000; font-family: SimHei; font-size: 0.874992em }
.svg-8 .st12 { fill: none; fill-rule: evenodd; font-size: 12px; overflow: visible; stroke-linecap: square; stroke-miterlimit: 3 }</style>
<g v:mid="0" v:index="1" v:groupcontext="foregroundPage">	<title>pipeline_textoverlay_video_cams</title>	<v:pageproperties v:drawingscale="1" v:pagescale="1" v:drawingunits="19" v:shadowoffsetx="9" v:shadowoffsety="-9"></v:pageproperties>	<v:layer v:name="Connector" v:index="0"></v:layer>	<g id="shape3-1" v:mid="3" v:groupcontext="shape" transform="translate(0.375,-0.375069)">		<title>Sheet.3</title>		<desc>GST BIN</desc>		<v:textblock v:margins="rect(7.2,0,0,0)" v:verticalalign="0"></v:textblock>		<v:textrect cx="213.375" cy="56.5659" width="426.76" height="111.631"></v:textrect>		<path d="M0 106.76 A5.62513 5.62513 -180 0 0 5.63 112.38 L421.13 112.38 A5.62513 5.62513 -180 0 0 426.75 106.76 L426.75					 6.38 A5.62513 5.62513 -180 0 0 421.13 0.75 L5.63 0.75 A5.62513 5.62513 -180 0 0 0 6.38 L0 106.76 Z" class="st1"></path>		<text x="190.58" y="18.75" class="st2" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>GST BIN</text>		</g>	<g id="shape4-4" v:mid="4" v:groupcontext="shape">		<title>Sheet.4</title>		<path d="M421.5 0.75 C424.39 0.75 426.75 3.11 426.75 6 L426.75 106.38 C426.75 109.28 424.39 111.63 421.5 111.63 L6 111.63					 C3.11 111.63 0.75 109.28 0.75 106.38 L0.75 6 C0.75 3.11 3.11 0.75 6 0.75 L421.5 0.75 ZM421.5 0 L6 0 C2.69					 0 0 2.69 0 6 L0 106.38 C0 109.7 2.69 112.38 6 112.38 L421.5 112.38 C424.81 112.38 427.5 109.7 427.5 106.38					 L427.5 6 C427.5 2.69 424.81 0 421.5 0 Z" class="st3"></path>	</g>	<g id="shape15-6" v:mid="15" v:groupcontext="shape" transform="translate(153.75,-42)">		<title>Sheet.15</title>		<desc>qtioverlay</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="93.6316" width="120" height="37.5"></v:textrect>		<path d="M0 109.38 A3.00007 3.00007 -180 0 0 3 112.38 L117 112.38 A3.00007 3.00007 -180 0 0 120 109.38 L120 77.88 A3.00007					 3.00007 -180 0 0 117 74.88 L3 74.88 A3.00007 3.00007 -180 0 0 0 77.88 L0 109.38 Z" class="st4"></path>		<text x="34.08" y="97.23" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtioverlay</text>		</g>	<g id="shape18-9" v:mid="18" v:groupcontext="shape" transform="translate(273.75,-60.75)">		<title>Sheet.18</title>		<path d="M0 112.38 L14.44 112.38" class="st6"></path>	</g>	<g id="shape19-12" v:mid="19" v:groupcontext="shape" transform="translate(287.319,-57.7582)">		<title>Sheet.19</title>		<path d="M0 112.38 L5.18 109.39 L0 106.4 L0 112.38 Z" class="st7"></path>	</g>	<g id="shape21-14" v:mid="21" v:groupcontext="shape" transform="translate(135,-60.75)">		<title>Sheet.21</title>		<path d="M0 112.38 L14.44 112.38" class="st6"></path>	</g>	<g id="shape22-17" v:mid="22" v:groupcontext="shape" transform="translate(148.569,-57.7582)">		<title>Sheet.22</title>		<path d="M0 112.38 L5.18 109.39 L0 106.4 L0 112.38 Z" class="st7"></path>	</g>	<g id="shape24-19" v:mid="24" v:groupcontext="shape" transform="translate(292.5,-42)">		<title>Sheet.24</title>		<desc>Waylandsink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="93.6316" width="120" height="37.5"></v:textrect>		<path d="M0 109.38 A3.00007 3.00007 -180 0 0 3 112.38 L117 112.38 A3.00007 3.00007 -180 0 0 120 109.38 L120 77.88 A3.00007					 3.00007 -180 0 0 117 74.88 L3 74.88 A3.00007 3.00007 -180 0 0 0 77.88 L0 109.38 Z" class="st8"></path>		<text x="26.26" y="97.23" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Waylandsink</text>		</g>	<g id="shape27-22" v:mid="27" v:groupcontext="shape" transform="translate(15,-42)">		<title>Sheet.27</title>		<desc>camsrc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="93.6316" width="120" height="37.5"></v:textrect>		<path d="M0 109.38 A3.00007 3.00007 -180 0 0 3 112.38 L117 112.38 A3.00007 3.00007 -180 0 0 120 109.38 L120 77.88 A3.00007					 3.00007 -180 0 0 117 74.88 L3 74.88 A3.00007 3.00007 -180 0 0 0 77.88 L0 109.38 Z" class="st8"></path>		<text x="40.07" y="97.23" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>camsrc</text>		</g>	<g id="group32-25" transform="translate(302.375,-14.7814)" v:mid="32" v:groupcontext="group">		<title>Sheet.32</title>		<g id="shape8-26" v:mid="8" v:groupcontext="shape" transform="translate(15.1882,1.42109E-14)">			<title>Sheet.8</title>			<desc>Qualcomm</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="27.5654" cy="106.082" width="55.14" height="12.6"></v:textrect>			<rect x="0" y="99.7816" width="55.1308" height="12.6" class="st9"></rect>			<text x="-0" y="109.23" class="st10" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>Qualcomm  </text>			</g>		<g id="shape9-29" v:mid="9" v:groupcontext="shape" transform="translate(9.99201E-16,-0.218619)">			<title>Sheet.9</title>			<path d="M0 110.88 A1.50003 1.50003 -180 0 0 1.5 112.38 L10.5 112.38 A1.50003 1.50003 -180 0 0 12 110.88 L12 101.88						 A1.50003 1.50003 -180 0 0 10.5 100.38 L1.5 100.38 A1.50003 1.50003 -180 0 0 -0 101.88 L0 110.88 Z" class="st4"></path>		</g>		<g id="shape11-31" v:mid="11" v:groupcontext="shape" transform="translate(89.1246,1.42109E-14)">			<title>Sheet.11</title>			<desc>开源</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="10.5" cy="106.082" width="21" height="12.6"></v:textrect>			<rect x="0" y="99.7816" width="21" height="12.6" class="st9"></rect>			<text x="0" y="109.58" class="st11" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>开源</text>			</g>		<g id="shape12-34" v:mid="12" v:groupcontext="shape" transform="translate(73.9363,-0.218619)">			<title>Sheet.12</title>			<path d="M0 110.88 A1.50003 1.50003 -180 0 0 1.5 112.38 L10.5 112.38 A1.50003 1.50003 -180 0 0 12 110.88 L12 101.88						 A1.50003 1.50003 -180 0 0 10.5 100.38 L1.5 100.38 A1.50003 1.50003 -180 0 0 0 101.88 L0 110.88 Z" class="st8"></path>		</g>	</g></g>
</svg>

## 反向隐私遮罩

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

该用例展示了如何在视频流上叠加反向隐私遮罩。

反向隐私遮罩应用于除 *overlay-mask* 属性中的 *circle* 之外的所有其他区域。

在目标设备上运行以下用例：

- 叠加在视频上：

        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 - 文件源
                    
                    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by Microsoft Visio, SVG Export pipeline_textoverlay_video_filesource.svg pipeline_textoverlay_video_file -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:v="http://schemas.microsoft.com/visio/2003/SVGExtensions/" width="10.8854in" height="1.64793in" viewbox="0 0 783.752 118.651" xml:space="preserve" color-interpolation-filters="sRGB" class="st12"><v:documentproperties v:langid="1033" v:viewmarkup="false"></v:documentproperties>
<style>.svg-9 .st1 { fill: #fafafa; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-9 .st2 { fill: #000000; font-family: Roboto; font-size: 1.00001em; font-weight: bold }
.svg-9 .st3 { fill: #d2d7e1; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-9 .st4 { fill: #007884; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-9 .st5 { fill: #ffffff; font-family: Roboto; font-size: 1.00001em }
.svg-9 .st6 { stroke: #000000; stroke-linecap: butt; stroke-width: 0.75 }
.svg-9 .st7 { fill: #000000; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-9 .st8 { fill: #2a2aea; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-9 .st9 { fill: none; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-9 .st10 { fill: #000000; font-family: Roboto; font-size: 0.874992em }
.svg-9 .st11 { fill: #000000; font-family: SimHei; font-size: 0.874992em }
.svg-9 .st12 { fill: none; fill-rule: evenodd; font-size: 12px; overflow: visible; stroke-linecap: square; stroke-miterlimit: 3 }</style>
<g v:mid="0" v:index="1" v:groupcontext="foregroundPage">	<title>pipeline_textoverlay_video_file</title>	<v:pageproperties v:drawingscale="1" v:pagescale="1" v:drawingunits="19" v:shadowoffsetx="9" v:shadowoffsety="-9"></v:pageproperties>	<g id="shape3-1" v:mid="3" v:groupcontext="shape" transform="translate(0.375114,-0.375092)">		<title>Sheet.3</title>		<desc>GST BIN</desc>		<v:textblock v:margins="rect(7.2,0,0,0)" v:verticalalign="0"></v:textblock>		<v:textrect cx="391.501" cy="59.7006" width="783.01" height="117.901"></v:textrect>		<path d="M0 113.03 A5.62513 5.62513 -180 0 0 5.62 118.65 L777.38 118.65 A5.62513 5.62513 -180 0 0 783 113.03 L783 6.37					 A5.62513 5.62513 -180 0 0 777.38 0.75 L5.62 0.75 A5.62513 5.62513 -180 0 0 0 6.37 L0 113.03 Z" class="st1"></path>		<text x="368.7" y="18.75" class="st2" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>GST BIN</text>		</g>	<g id="shape4-4" v:mid="4" v:groupcontext="shape">		<title>Sheet.4</title>		<path d="M777.75 0.75 C780.65 0.75 783 3.11 783 6 L783 112.65 C783 115.55 780.65 117.9 777.75 117.9 L6 117.9 C3.11 117.9					 0.75 115.55 0.75 112.65 L0.75 6 C0.75 3.11 3.11 0.75 6 0.75 L777.75 0.75 ZM777.75 0 L6 0 C2.69 0 0 2.69					 0 6 L0 112.65 C0 115.96 2.69 118.65 6 118.65 L777.75 118.65 C781.07 118.65 783.75 115.96 783.75 112.65 L783.75					 6 C783.75 2.69 781.07 0 777.75 0 Z" class="st3"></path>	</g>	<g id="shape15-6" v:mid="15" v:groupcontext="shape" transform="translate(262.502,-42)">		<title>Sheet.15</title>		<desc>h264parse</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="56.25" cy="99.9012" width="112.5" height="37.5"></v:textrect>		<path d="M0 115.65 A3.00007 3.00007 -180 0 0 3 118.65 L109.5 118.65 A3.00007 3.00007 -180 0 0 112.5 115.65 L112.5 84.15					 A3.00007 3.00007 -180 0 0 109.5 81.15 L3 81.15 A3.00007 3.00007 -180 0 0 0 84.15 L0 115.65 Z" class="st4"></path>		<text x="27.9" y="103.5" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>h264parse</text>		</g>	<g id="group17-9" transform="translate(375.002,-57.7582)" v:mid="17" v:groupcontext="group">		<title>Sheet.17</title>		<g id="shape18-10" v:mid="18" v:groupcontext="shape" transform="translate(0,-2.99179)">			<title>Sheet.18</title>			<path d="M0 118.65 L14.44 118.65" class="st6"></path>		</g>		<g id="shape19-13" v:mid="19" v:groupcontext="shape" transform="translate(13.5688,-1.42109E-14)">			<title>Sheet.19</title>			<path d="M0 118.65 L5.18 115.66 L0 112.67 L0 118.65 Z" class="st7"></path>		</g>	</g>	<g id="group20-15" transform="translate(243.751,-57.7582)" v:mid="20" v:groupcontext="group">		<title>Sheet.20</title>		<g id="shape21-16" v:mid="21" v:groupcontext="shape" transform="translate(0,-2.99179)">			<title>Sheet.21</title>			<path d="M0 118.65 L14.44 118.65" class="st6"></path>		</g>		<g id="shape22-19" v:mid="22" v:groupcontext="shape" transform="translate(13.5689,-1.42109E-14)">			<title>Sheet.22</title>			<path d="M0 118.65 L5.18 115.66 L0 112.67 L0 118.65 Z" class="st7"></path>		</g>	</g>	<g id="shape24-21" v:mid="24" v:groupcontext="shape" transform="translate(393.752,-42)">		<title>Sheet.24</title>		<desc>v4l2h264dec</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="56.25" cy="99.9012" width="112.5" height="37.5"></v:textrect>		<path d="M0 115.65 A3.00007 3.00007 -180 0 0 3 118.65 L109.5 118.65 A3.00007 3.00007 -180 0 0 112.5 115.65 L112.5 84.15					 A3.00007 3.00007 -180 0 0 109.5 81.15 L3 81.15 A3.00007 3.00007 -180 0 0 0 84.15 L0 115.65 Z" class="st4"></path>		<text x="22.03" y="103.5" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>v4l2h264dec</text>		</g>	<g id="group26-24" transform="translate(506.252,-57.7582)" v:mid="26" v:groupcontext="group">		<title>Sheet.26</title>		<g id="shape27-25" v:mid="27" v:groupcontext="shape" transform="translate(0,-2.99179)">			<title>Sheet.27</title>			<path d="M0 118.65 L14.44 118.65" class="st6"></path>		</g>		<g id="shape28-28" v:mid="28" v:groupcontext="shape" transform="translate(13.5688,-1.42109E-14)">			<title>Sheet.28</title>			<path d="M0 118.65 L5.18 115.66 L0 112.67 L0 118.65 Z" class="st7"></path>		</g>	</g>	<g id="shape30-30" v:mid="30" v:groupcontext="shape" transform="translate(525.002,-42)">		<title>Sheet.30</title>		<desc>qtioverlay</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="56.25" cy="99.9012" width="112.51" height="37.5"></v:textrect>		<path d="M0 115.65 A3.00007 3.00007 -180 0 0 3 118.65 L109.5 118.65 A3.00007 3.00007 -180 0 0 112.5 115.65 L112.5 84.15					 A3.00007 3.00007 -180 0 0 109.5 81.15 L3 81.15 A3.00007 3.00007 -180 0 0 0 84.15 L0 115.65 Z" class="st8"></path>		<text x="30.33" y="103.5" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtioverlay</text>		</g>	<g id="group32-33" transform="translate(637.502,-57.7582)" v:mid="32" v:groupcontext="group">		<title>Sheet.32</title>		<g id="shape33-34" v:mid="33" v:groupcontext="shape" transform="translate(0,-2.99179)">			<title>Sheet.33</title>			<path d="M0 118.65 L14.44 118.65" class="st6"></path>		</g>		<g id="shape34-37" v:mid="34" v:groupcontext="shape" transform="translate(13.5688,-1.42109E-14)">			<title>Sheet.34</title>			<path d="M0 118.65 L5.18 115.66 L0 112.67 L0 118.65 Z" class="st7"></path>		</g>	</g>	<g id="shape36-39" v:mid="36" v:groupcontext="shape" transform="translate(656.252,-42)">		<title>Sheet.36</title>		<desc>Waylandsink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="56.25" cy="99.9012" width="112.51" height="37.5"></v:textrect>		<path d="M0 115.65 A3.00007 3.00007 -180 0 0 3 118.65 L109.5 118.65 A3.00007 3.00007 -180 0 0 112.5 115.65 L112.5 84.15					 A3.00007 3.00007 -180 0 0 109.5 81.15 L3 81.15 A3.00007 3.00007 -180 0 0 -0 84.15 L0 115.65 Z" class="st4"></path>		<text x="22.51" y="103.5" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Waylandsink</text>		</g>	<g id="shape39-42" v:mid="39" v:groupcontext="shape" transform="translate(15.0008,-42)">		<title>Sheet.39</title>		<desc>filesrc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="52.5" cy="99.9012" width="105" height="37.5"></v:textrect>		<path d="M0 115.65 A3.00007 3.00007 -180 0 0 3 118.65 L102 118.65 A3.00007 3.00007 -180 0 0 105 115.65 L105 84.15 A3.00007					 3.00007 -180 0 0 102 81.15 L3 81.15 A3.00007 3.00007 -180 0 0 0 84.15 L0 115.65 Z" class="st4"></path>		<text x="36.06" y="103.5" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>filesrc</text>		</g>	<g id="group41-45" transform="translate(120.001,-57.7582)" v:mid="41" v:groupcontext="group">		<title>Sheet.41</title>		<g id="shape42-46" v:mid="42" v:groupcontext="shape" transform="translate(0,-2.99179)">			<title>Sheet.42</title>			<path d="M0 118.65 L14.44 118.65" class="st6"></path>		</g>		<g id="shape43-49" v:mid="43" v:groupcontext="shape" transform="translate(13.5689,-1.42109E-14)">			<title>Sheet.43</title>			<path d="M0 118.65 L5.18 115.66 L0 112.67 L0 118.65 Z" class="st7"></path>		</g>	</g>	<g id="shape45-51" v:mid="45" v:groupcontext="shape" transform="translate(138.751,-42)">		<title>Sheet.45</title>		<desc>qtdemux</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="52.5" cy="99.9012" width="105" height="37.5"></v:textrect>		<path d="M0 115.65 A3.00007 3.00007 -180 0 0 3 118.65 L102 118.65 A3.00007 3.00007 -180 0 0 105 115.65 L105 84.15 A3.00007					 3.00007 -180 0 0 102 81.15 L3 81.15 A3.00007 3.00007 -180 0 0 0 84.15 L0 115.65 Z" class="st4"></path>		<text x="29.03" y="103.5" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtdemux</text>		</g>	<g id="group48-54" transform="translate(658.627,-14.7814)" v:mid="48" v:groupcontext="group">		<title>Sheet.48</title>		<g id="shape7-55" v:mid="7" v:groupcontext="shape" transform="translate(15.1883,0)">			<title>Sheet.7</title>			<desc>Qualcomm</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="27.803" cy="112.351" width="55.61" height="12.6"></v:textrect>			<rect x="0" y="106.051" width="55.606" height="12.6" class="st9"></rect>			<text x="0" y="115.5" class="st10" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>Qualcomm  </text>			</g>		<g id="shape8-58" v:mid="8" v:groupcontext="shape" transform="translate(1.26898E-13,-0.218619)">			<title>Sheet.8</title>			<path d="M0 117.15 A1.50003 1.50003 -180 0 0 1.5 118.65 L10.5 118.65 A1.50003 1.50003 -180 0 0 12 117.15 L12 108.15						 A1.50003 1.50003 -180 0 0 10.5 106.65 L1.5 106.65 A1.50003 1.50003 -180 0 0 0 108.15 L0 117.15 Z" class="st8"></path>		</g>		<g id="shape10-60" v:mid="10" v:groupcontext="shape" transform="translate(89.1246,0)">			<title>Sheet.10</title>			<desc>开源</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="10.5" cy="112.351" width="21" height="12.6"></v:textrect>			<rect x="0" y="106.051" width="21" height="12.6" class="st9"></rect>			<text x="0" y="115.85" class="st11" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>开源</text>			</g>		<g id="shape11-63" v:mid="11" v:groupcontext="shape" transform="translate(73.9363,-0.218619)">			<title>Sheet.11</title>			<path d="M0 117.15 A1.50003 1.50003 -180 0 0 1.5 118.65 L10.5 118.65 A1.50003 1.50003 -180 0 0 12 117.15 L12 108.15						 A1.50003 1.50003 -180 0 0 10.5 106.65 L1.5 106.65 A1.50003 1.50003 -180 0 0 0 108.15 L0 117.15 Z" class="st4"></path>		</g>	</g></g>
</svg>
- 覆盖来自摄像头的实时流：

        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 - 摄像头源
                    
                    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by Microsoft Visio, SVG Export pipeline_textoverlay_video_camsource.svg pipeline_textoverlay_video_cams -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:v="http://schemas.microsoft.com/visio/2003/SVGExtensions/" width="5.9375in" height="1.56085in" viewbox="0 0 427.5 112.382" xml:space="preserve" color-interpolation-filters="sRGB" class="st12"><v:documentproperties v:langid="1033" v:viewmarkup="false"></v:documentproperties>
<style>.svg-10 .st1 { fill: #fafafa; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-10 .st2 { fill: #000000; font-family: Roboto; font-size: 1.00001em; font-weight: bold }
.svg-10 .st3 { fill: #d2d7e1; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-10 .st4 { fill: #2a2aea; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-10 .st5 { fill: #ffffff; font-family: Roboto; font-size: 1.00001em }
.svg-10 .st6 { stroke: #000000; stroke-linecap: butt; stroke-width: 0.75 }
.svg-10 .st7 { fill: #000000; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-10 .st8 { fill: #007884; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-10 .st9 { fill: none; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-10 .st10 { fill: #000000; font-family: Roboto; font-size: 0.874992em }
.svg-10 .st11 { fill: #000000; font-family: SimHei; font-size: 0.874992em }
.svg-10 .st12 { fill: none; fill-rule: evenodd; font-size: 12px; overflow: visible; stroke-linecap: square; stroke-miterlimit: 3 }</style>
<g v:mid="0" v:index="1" v:groupcontext="foregroundPage">	<title>pipeline_textoverlay_video_cams</title>	<v:pageproperties v:drawingscale="1" v:pagescale="1" v:drawingunits="19" v:shadowoffsetx="9" v:shadowoffsety="-9"></v:pageproperties>	<v:layer v:name="Connector" v:index="0"></v:layer>	<g id="shape3-1" v:mid="3" v:groupcontext="shape" transform="translate(0.375,-0.375069)">		<title>Sheet.3</title>		<desc>GST BIN</desc>		<v:textblock v:margins="rect(7.2,0,0,0)" v:verticalalign="0"></v:textblock>		<v:textrect cx="213.375" cy="56.5659" width="426.76" height="111.631"></v:textrect>		<path d="M0 106.76 A5.62513 5.62513 -180 0 0 5.63 112.38 L421.13 112.38 A5.62513 5.62513 -180 0 0 426.75 106.76 L426.75					 6.38 A5.62513 5.62513 -180 0 0 421.13 0.75 L5.63 0.75 A5.62513 5.62513 -180 0 0 0 6.38 L0 106.76 Z" class="st1"></path>		<text x="190.58" y="18.75" class="st2" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>GST BIN</text>		</g>	<g id="shape4-4" v:mid="4" v:groupcontext="shape">		<title>Sheet.4</title>		<path d="M421.5 0.75 C424.39 0.75 426.75 3.11 426.75 6 L426.75 106.38 C426.75 109.28 424.39 111.63 421.5 111.63 L6 111.63					 C3.11 111.63 0.75 109.28 0.75 106.38 L0.75 6 C0.75 3.11 3.11 0.75 6 0.75 L421.5 0.75 ZM421.5 0 L6 0 C2.69					 0 0 2.69 0 6 L0 106.38 C0 109.7 2.69 112.38 6 112.38 L421.5 112.38 C424.81 112.38 427.5 109.7 427.5 106.38					 L427.5 6 C427.5 2.69 424.81 0 421.5 0 Z" class="st3"></path>	</g>	<g id="shape15-6" v:mid="15" v:groupcontext="shape" transform="translate(153.75,-42)">		<title>Sheet.15</title>		<desc>qtioverlay</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="93.6316" width="120" height="37.5"></v:textrect>		<path d="M0 109.38 A3.00007 3.00007 -180 0 0 3 112.38 L117 112.38 A3.00007 3.00007 -180 0 0 120 109.38 L120 77.88 A3.00007					 3.00007 -180 0 0 117 74.88 L3 74.88 A3.00007 3.00007 -180 0 0 0 77.88 L0 109.38 Z" class="st4"></path>		<text x="34.08" y="97.23" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtioverlay</text>		</g>	<g id="shape18-9" v:mid="18" v:groupcontext="shape" transform="translate(273.75,-60.75)">		<title>Sheet.18</title>		<path d="M0 112.38 L14.44 112.38" class="st6"></path>	</g>	<g id="shape19-12" v:mid="19" v:groupcontext="shape" transform="translate(287.319,-57.7582)">		<title>Sheet.19</title>		<path d="M0 112.38 L5.18 109.39 L0 106.4 L0 112.38 Z" class="st7"></path>	</g>	<g id="shape21-14" v:mid="21" v:groupcontext="shape" transform="translate(135,-60.75)">		<title>Sheet.21</title>		<path d="M0 112.38 L14.44 112.38" class="st6"></path>	</g>	<g id="shape22-17" v:mid="22" v:groupcontext="shape" transform="translate(148.569,-57.7582)">		<title>Sheet.22</title>		<path d="M0 112.38 L5.18 109.39 L0 106.4 L0 112.38 Z" class="st7"></path>	</g>	<g id="shape24-19" v:mid="24" v:groupcontext="shape" transform="translate(292.5,-42)">		<title>Sheet.24</title>		<desc>Waylandsink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="93.6316" width="120" height="37.5"></v:textrect>		<path d="M0 109.38 A3.00007 3.00007 -180 0 0 3 112.38 L117 112.38 A3.00007 3.00007 -180 0 0 120 109.38 L120 77.88 A3.00007					 3.00007 -180 0 0 117 74.88 L3 74.88 A3.00007 3.00007 -180 0 0 0 77.88 L0 109.38 Z" class="st8"></path>		<text x="26.26" y="97.23" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Waylandsink</text>		</g>	<g id="shape27-22" v:mid="27" v:groupcontext="shape" transform="translate(15,-42)">		<title>Sheet.27</title>		<desc>camsrc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="93.6316" width="120" height="37.5"></v:textrect>		<path d="M0 109.38 A3.00007 3.00007 -180 0 0 3 112.38 L117 112.38 A3.00007 3.00007 -180 0 0 120 109.38 L120 77.88 A3.00007					 3.00007 -180 0 0 117 74.88 L3 74.88 A3.00007 3.00007 -180 0 0 0 77.88 L0 109.38 Z" class="st8"></path>		<text x="40.07" y="97.23" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>camsrc</text>		</g>	<g id="group32-25" transform="translate(302.375,-14.7814)" v:mid="32" v:groupcontext="group">		<title>Sheet.32</title>		<g id="shape8-26" v:mid="8" v:groupcontext="shape" transform="translate(15.1882,1.42109E-14)">			<title>Sheet.8</title>			<desc>Qualcomm</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="27.5654" cy="106.082" width="55.14" height="12.6"></v:textrect>			<rect x="0" y="99.7816" width="55.1308" height="12.6" class="st9"></rect>			<text x="-0" y="109.23" class="st10" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>Qualcomm  </text>			</g>		<g id="shape9-29" v:mid="9" v:groupcontext="shape" transform="translate(9.99201E-16,-0.218619)">			<title>Sheet.9</title>			<path d="M0 110.88 A1.50003 1.50003 -180 0 0 1.5 112.38 L10.5 112.38 A1.50003 1.50003 -180 0 0 12 110.88 L12 101.88						 A1.50003 1.50003 -180 0 0 10.5 100.38 L1.5 100.38 A1.50003 1.50003 -180 0 0 -0 101.88 L0 110.88 Z" class="st4"></path>		</g>		<g id="shape11-31" v:mid="11" v:groupcontext="shape" transform="translate(89.1246,1.42109E-14)">			<title>Sheet.11</title>			<desc>开源</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="10.5" cy="106.082" width="21" height="12.6"></v:textrect>			<rect x="0" y="99.7816" width="21" height="12.6" class="st9"></rect>			<text x="0" y="109.58" class="st11" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>开源</text>			</g>		<g id="shape12-34" v:mid="12" v:groupcontext="shape" transform="translate(73.9363,-0.218619)">			<title>Sheet.12</title>			<path d="M0 110.88 A1.50003 1.50003 -180 0 0 1.5 112.38 L10.5 112.38 A1.50003 1.50003 -180 0 0 12 110.88 L12 101.88						 A1.50003 1.50003 -180 0 0 10.5 100.38 L1.5 100.38 A1.50003 1.50003 -180 0 0 0 101.88 L0 110.88 Z" class="st8"></path>		</g>	</g></g>
</svg>

## 非反向隐私遮罩

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

该用例展示了如何在视频流上叠加非反向隐私遮罩。

在目标设备上运行以下用例：

- 叠加在视频上：

        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 - 文件源
                    
                    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by Microsoft Visio, SVG Export pipeline_textoverlay_video_filesource.svg pipeline_textoverlay_video_file -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:v="http://schemas.microsoft.com/visio/2003/SVGExtensions/" width="10.8854in" height="1.64793in" viewbox="0 0 783.752 118.651" xml:space="preserve" color-interpolation-filters="sRGB" class="st12"><v:documentproperties v:langid="1033" v:viewmarkup="false"></v:documentproperties>
<style>.svg-11 .st1 { fill: #fafafa; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-11 .st2 { fill: #000000; font-family: Roboto; font-size: 1.00001em; font-weight: bold }
.svg-11 .st3 { fill: #d2d7e1; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-11 .st4 { fill: #007884; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-11 .st5 { fill: #ffffff; font-family: Roboto; font-size: 1.00001em }
.svg-11 .st6 { stroke: #000000; stroke-linecap: butt; stroke-width: 0.75 }
.svg-11 .st7 { fill: #000000; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-11 .st8 { fill: #2a2aea; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-11 .st9 { fill: none; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-11 .st10 { fill: #000000; font-family: Roboto; font-size: 0.874992em }
.svg-11 .st11 { fill: #000000; font-family: SimHei; font-size: 0.874992em }
.svg-11 .st12 { fill: none; fill-rule: evenodd; font-size: 12px; overflow: visible; stroke-linecap: square; stroke-miterlimit: 3 }</style>
<g v:mid="0" v:index="1" v:groupcontext="foregroundPage">	<title>pipeline_textoverlay_video_file</title>	<v:pageproperties v:drawingscale="1" v:pagescale="1" v:drawingunits="19" v:shadowoffsetx="9" v:shadowoffsety="-9"></v:pageproperties>	<g id="shape3-1" v:mid="3" v:groupcontext="shape" transform="translate(0.375114,-0.375092)">		<title>Sheet.3</title>		<desc>GST BIN</desc>		<v:textblock v:margins="rect(7.2,0,0,0)" v:verticalalign="0"></v:textblock>		<v:textrect cx="391.501" cy="59.7006" width="783.01" height="117.901"></v:textrect>		<path d="M0 113.03 A5.62513 5.62513 -180 0 0 5.62 118.65 L777.38 118.65 A5.62513 5.62513 -180 0 0 783 113.03 L783 6.37					 A5.62513 5.62513 -180 0 0 777.38 0.75 L5.62 0.75 A5.62513 5.62513 -180 0 0 0 6.37 L0 113.03 Z" class="st1"></path>		<text x="368.7" y="18.75" class="st2" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>GST BIN</text>		</g>	<g id="shape4-4" v:mid="4" v:groupcontext="shape">		<title>Sheet.4</title>		<path d="M777.75 0.75 C780.65 0.75 783 3.11 783 6 L783 112.65 C783 115.55 780.65 117.9 777.75 117.9 L6 117.9 C3.11 117.9					 0.75 115.55 0.75 112.65 L0.75 6 C0.75 3.11 3.11 0.75 6 0.75 L777.75 0.75 ZM777.75 0 L6 0 C2.69 0 0 2.69					 0 6 L0 112.65 C0 115.96 2.69 118.65 6 118.65 L777.75 118.65 C781.07 118.65 783.75 115.96 783.75 112.65 L783.75					 6 C783.75 2.69 781.07 0 777.75 0 Z" class="st3"></path>	</g>	<g id="shape15-6" v:mid="15" v:groupcontext="shape" transform="translate(262.502,-42)">		<title>Sheet.15</title>		<desc>h264parse</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="56.25" cy="99.9012" width="112.5" height="37.5"></v:textrect>		<path d="M0 115.65 A3.00007 3.00007 -180 0 0 3 118.65 L109.5 118.65 A3.00007 3.00007 -180 0 0 112.5 115.65 L112.5 84.15					 A3.00007 3.00007 -180 0 0 109.5 81.15 L3 81.15 A3.00007 3.00007 -180 0 0 0 84.15 L0 115.65 Z" class="st4"></path>		<text x="27.9" y="103.5" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>h264parse</text>		</g>	<g id="group17-9" transform="translate(375.002,-57.7582)" v:mid="17" v:groupcontext="group">		<title>Sheet.17</title>		<g id="shape18-10" v:mid="18" v:groupcontext="shape" transform="translate(0,-2.99179)">			<title>Sheet.18</title>			<path d="M0 118.65 L14.44 118.65" class="st6"></path>		</g>		<g id="shape19-13" v:mid="19" v:groupcontext="shape" transform="translate(13.5688,-1.42109E-14)">			<title>Sheet.19</title>			<path d="M0 118.65 L5.18 115.66 L0 112.67 L0 118.65 Z" class="st7"></path>		</g>	</g>	<g id="group20-15" transform="translate(243.751,-57.7582)" v:mid="20" v:groupcontext="group">		<title>Sheet.20</title>		<g id="shape21-16" v:mid="21" v:groupcontext="shape" transform="translate(0,-2.99179)">			<title>Sheet.21</title>			<path d="M0 118.65 L14.44 118.65" class="st6"></path>		</g>		<g id="shape22-19" v:mid="22" v:groupcontext="shape" transform="translate(13.5689,-1.42109E-14)">			<title>Sheet.22</title>			<path d="M0 118.65 L5.18 115.66 L0 112.67 L0 118.65 Z" class="st7"></path>		</g>	</g>	<g id="shape24-21" v:mid="24" v:groupcontext="shape" transform="translate(393.752,-42)">		<title>Sheet.24</title>		<desc>v4l2h264dec</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="56.25" cy="99.9012" width="112.5" height="37.5"></v:textrect>		<path d="M0 115.65 A3.00007 3.00007 -180 0 0 3 118.65 L109.5 118.65 A3.00007 3.00007 -180 0 0 112.5 115.65 L112.5 84.15					 A3.00007 3.00007 -180 0 0 109.5 81.15 L3 81.15 A3.00007 3.00007 -180 0 0 0 84.15 L0 115.65 Z" class="st4"></path>		<text x="22.03" y="103.5" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>v4l2h264dec</text>		</g>	<g id="group26-24" transform="translate(506.252,-57.7582)" v:mid="26" v:groupcontext="group">		<title>Sheet.26</title>		<g id="shape27-25" v:mid="27" v:groupcontext="shape" transform="translate(0,-2.99179)">			<title>Sheet.27</title>			<path d="M0 118.65 L14.44 118.65" class="st6"></path>		</g>		<g id="shape28-28" v:mid="28" v:groupcontext="shape" transform="translate(13.5688,-1.42109E-14)">			<title>Sheet.28</title>			<path d="M0 118.65 L5.18 115.66 L0 112.67 L0 118.65 Z" class="st7"></path>		</g>	</g>	<g id="shape30-30" v:mid="30" v:groupcontext="shape" transform="translate(525.002,-42)">		<title>Sheet.30</title>		<desc>qtioverlay</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="56.25" cy="99.9012" width="112.51" height="37.5"></v:textrect>		<path d="M0 115.65 A3.00007 3.00007 -180 0 0 3 118.65 L109.5 118.65 A3.00007 3.00007 -180 0 0 112.5 115.65 L112.5 84.15					 A3.00007 3.00007 -180 0 0 109.5 81.15 L3 81.15 A3.00007 3.00007 -180 0 0 0 84.15 L0 115.65 Z" class="st8"></path>		<text x="30.33" y="103.5" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtioverlay</text>		</g>	<g id="group32-33" transform="translate(637.502,-57.7582)" v:mid="32" v:groupcontext="group">		<title>Sheet.32</title>		<g id="shape33-34" v:mid="33" v:groupcontext="shape" transform="translate(0,-2.99179)">			<title>Sheet.33</title>			<path d="M0 118.65 L14.44 118.65" class="st6"></path>		</g>		<g id="shape34-37" v:mid="34" v:groupcontext="shape" transform="translate(13.5688,-1.42109E-14)">			<title>Sheet.34</title>			<path d="M0 118.65 L5.18 115.66 L0 112.67 L0 118.65 Z" class="st7"></path>		</g>	</g>	<g id="shape36-39" v:mid="36" v:groupcontext="shape" transform="translate(656.252,-42)">		<title>Sheet.36</title>		<desc>Waylandsink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="56.25" cy="99.9012" width="112.51" height="37.5"></v:textrect>		<path d="M0 115.65 A3.00007 3.00007 -180 0 0 3 118.65 L109.5 118.65 A3.00007 3.00007 -180 0 0 112.5 115.65 L112.5 84.15					 A3.00007 3.00007 -180 0 0 109.5 81.15 L3 81.15 A3.00007 3.00007 -180 0 0 -0 84.15 L0 115.65 Z" class="st4"></path>		<text x="22.51" y="103.5" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Waylandsink</text>		</g>	<g id="shape39-42" v:mid="39" v:groupcontext="shape" transform="translate(15.0008,-42)">		<title>Sheet.39</title>		<desc>filesrc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="52.5" cy="99.9012" width="105" height="37.5"></v:textrect>		<path d="M0 115.65 A3.00007 3.00007 -180 0 0 3 118.65 L102 118.65 A3.00007 3.00007 -180 0 0 105 115.65 L105 84.15 A3.00007					 3.00007 -180 0 0 102 81.15 L3 81.15 A3.00007 3.00007 -180 0 0 0 84.15 L0 115.65 Z" class="st4"></path>		<text x="36.06" y="103.5" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>filesrc</text>		</g>	<g id="group41-45" transform="translate(120.001,-57.7582)" v:mid="41" v:groupcontext="group">		<title>Sheet.41</title>		<g id="shape42-46" v:mid="42" v:groupcontext="shape" transform="translate(0,-2.99179)">			<title>Sheet.42</title>			<path d="M0 118.65 L14.44 118.65" class="st6"></path>		</g>		<g id="shape43-49" v:mid="43" v:groupcontext="shape" transform="translate(13.5689,-1.42109E-14)">			<title>Sheet.43</title>			<path d="M0 118.65 L5.18 115.66 L0 112.67 L0 118.65 Z" class="st7"></path>		</g>	</g>	<g id="shape45-51" v:mid="45" v:groupcontext="shape" transform="translate(138.751,-42)">		<title>Sheet.45</title>		<desc>qtdemux</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="52.5" cy="99.9012" width="105" height="37.5"></v:textrect>		<path d="M0 115.65 A3.00007 3.00007 -180 0 0 3 118.65 L102 118.65 A3.00007 3.00007 -180 0 0 105 115.65 L105 84.15 A3.00007					 3.00007 -180 0 0 102 81.15 L3 81.15 A3.00007 3.00007 -180 0 0 0 84.15 L0 115.65 Z" class="st4"></path>		<text x="29.03" y="103.5" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtdemux</text>		</g>	<g id="group48-54" transform="translate(658.627,-14.7814)" v:mid="48" v:groupcontext="group">		<title>Sheet.48</title>		<g id="shape7-55" v:mid="7" v:groupcontext="shape" transform="translate(15.1883,0)">			<title>Sheet.7</title>			<desc>Qualcomm</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="27.803" cy="112.351" width="55.61" height="12.6"></v:textrect>			<rect x="0" y="106.051" width="55.606" height="12.6" class="st9"></rect>			<text x="0" y="115.5" class="st10" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>Qualcomm  </text>			</g>		<g id="shape8-58" v:mid="8" v:groupcontext="shape" transform="translate(1.26898E-13,-0.218619)">			<title>Sheet.8</title>			<path d="M0 117.15 A1.50003 1.50003 -180 0 0 1.5 118.65 L10.5 118.65 A1.50003 1.50003 -180 0 0 12 117.15 L12 108.15						 A1.50003 1.50003 -180 0 0 10.5 106.65 L1.5 106.65 A1.50003 1.50003 -180 0 0 0 108.15 L0 117.15 Z" class="st8"></path>		</g>		<g id="shape10-60" v:mid="10" v:groupcontext="shape" transform="translate(89.1246,0)">			<title>Sheet.10</title>			<desc>开源</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="10.5" cy="112.351" width="21" height="12.6"></v:textrect>			<rect x="0" y="106.051" width="21" height="12.6" class="st9"></rect>			<text x="0" y="115.85" class="st11" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>开源</text>			</g>		<g id="shape11-63" v:mid="11" v:groupcontext="shape" transform="translate(73.9363,-0.218619)">			<title>Sheet.11</title>			<path d="M0 117.15 A1.50003 1.50003 -180 0 0 1.5 118.65 L10.5 118.65 A1.50003 1.50003 -180 0 0 12 117.15 L12 108.15						 A1.50003 1.50003 -180 0 0 10.5 106.65 L1.5 106.65 A1.50003 1.50003 -180 0 0 0 108.15 L0 117.15 Z" class="st4"></path>		</g>	</g></g>
</svg>
- 覆盖来自摄像头的实时流：

        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 - 摄像头源
                    
                    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by Microsoft Visio, SVG Export pipeline_textoverlay_video_camsource.svg pipeline_textoverlay_video_cams -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:v="http://schemas.microsoft.com/visio/2003/SVGExtensions/" width="5.9375in" height="1.56085in" viewbox="0 0 427.5 112.382" xml:space="preserve" color-interpolation-filters="sRGB" class="st12"><v:documentproperties v:langid="1033" v:viewmarkup="false"></v:documentproperties>
<style>.svg-12 .st1 { fill: #fafafa; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-12 .st2 { fill: #000000; font-family: Roboto; font-size: 1.00001em; font-weight: bold }
.svg-12 .st3 { fill: #d2d7e1; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-12 .st4 { fill: #2a2aea; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-12 .st5 { fill: #ffffff; font-family: Roboto; font-size: 1.00001em }
.svg-12 .st6 { stroke: #000000; stroke-linecap: butt; stroke-width: 0.75 }
.svg-12 .st7 { fill: #000000; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-12 .st8 { fill: #007884; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-12 .st9 { fill: none; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-12 .st10 { fill: #000000; font-family: Roboto; font-size: 0.874992em }
.svg-12 .st11 { fill: #000000; font-family: SimHei; font-size: 0.874992em }
.svg-12 .st12 { fill: none; fill-rule: evenodd; font-size: 12px; overflow: visible; stroke-linecap: square; stroke-miterlimit: 3 }</style>
<g v:mid="0" v:index="1" v:groupcontext="foregroundPage">	<title>pipeline_textoverlay_video_cams</title>	<v:pageproperties v:drawingscale="1" v:pagescale="1" v:drawingunits="19" v:shadowoffsetx="9" v:shadowoffsety="-9"></v:pageproperties>	<v:layer v:name="Connector" v:index="0"></v:layer>	<g id="shape3-1" v:mid="3" v:groupcontext="shape" transform="translate(0.375,-0.375069)">		<title>Sheet.3</title>		<desc>GST BIN</desc>		<v:textblock v:margins="rect(7.2,0,0,0)" v:verticalalign="0"></v:textblock>		<v:textrect cx="213.375" cy="56.5659" width="426.76" height="111.631"></v:textrect>		<path d="M0 106.76 A5.62513 5.62513 -180 0 0 5.63 112.38 L421.13 112.38 A5.62513 5.62513 -180 0 0 426.75 106.76 L426.75					 6.38 A5.62513 5.62513 -180 0 0 421.13 0.75 L5.63 0.75 A5.62513 5.62513 -180 0 0 0 6.38 L0 106.76 Z" class="st1"></path>		<text x="190.58" y="18.75" class="st2" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>GST BIN</text>		</g>	<g id="shape4-4" v:mid="4" v:groupcontext="shape">		<title>Sheet.4</title>		<path d="M421.5 0.75 C424.39 0.75 426.75 3.11 426.75 6 L426.75 106.38 C426.75 109.28 424.39 111.63 421.5 111.63 L6 111.63					 C3.11 111.63 0.75 109.28 0.75 106.38 L0.75 6 C0.75 3.11 3.11 0.75 6 0.75 L421.5 0.75 ZM421.5 0 L6 0 C2.69					 0 0 2.69 0 6 L0 106.38 C0 109.7 2.69 112.38 6 112.38 L421.5 112.38 C424.81 112.38 427.5 109.7 427.5 106.38					 L427.5 6 C427.5 2.69 424.81 0 421.5 0 Z" class="st3"></path>	</g>	<g id="shape15-6" v:mid="15" v:groupcontext="shape" transform="translate(153.75,-42)">		<title>Sheet.15</title>		<desc>qtioverlay</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="93.6316" width="120" height="37.5"></v:textrect>		<path d="M0 109.38 A3.00007 3.00007 -180 0 0 3 112.38 L117 112.38 A3.00007 3.00007 -180 0 0 120 109.38 L120 77.88 A3.00007					 3.00007 -180 0 0 117 74.88 L3 74.88 A3.00007 3.00007 -180 0 0 0 77.88 L0 109.38 Z" class="st4"></path>		<text x="34.08" y="97.23" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtioverlay</text>		</g>	<g id="shape18-9" v:mid="18" v:groupcontext="shape" transform="translate(273.75,-60.75)">		<title>Sheet.18</title>		<path d="M0 112.38 L14.44 112.38" class="st6"></path>	</g>	<g id="shape19-12" v:mid="19" v:groupcontext="shape" transform="translate(287.319,-57.7582)">		<title>Sheet.19</title>		<path d="M0 112.38 L5.18 109.39 L0 106.4 L0 112.38 Z" class="st7"></path>	</g>	<g id="shape21-14" v:mid="21" v:groupcontext="shape" transform="translate(135,-60.75)">		<title>Sheet.21</title>		<path d="M0 112.38 L14.44 112.38" class="st6"></path>	</g>	<g id="shape22-17" v:mid="22" v:groupcontext="shape" transform="translate(148.569,-57.7582)">		<title>Sheet.22</title>		<path d="M0 112.38 L5.18 109.39 L0 106.4 L0 112.38 Z" class="st7"></path>	</g>	<g id="shape24-19" v:mid="24" v:groupcontext="shape" transform="translate(292.5,-42)">		<title>Sheet.24</title>		<desc>Waylandsink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="93.6316" width="120" height="37.5"></v:textrect>		<path d="M0 109.38 A3.00007 3.00007 -180 0 0 3 112.38 L117 112.38 A3.00007 3.00007 -180 0 0 120 109.38 L120 77.88 A3.00007					 3.00007 -180 0 0 117 74.88 L3 74.88 A3.00007 3.00007 -180 0 0 0 77.88 L0 109.38 Z" class="st8"></path>		<text x="26.26" y="97.23" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Waylandsink</text>		</g>	<g id="shape27-22" v:mid="27" v:groupcontext="shape" transform="translate(15,-42)">		<title>Sheet.27</title>		<desc>camsrc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="93.6316" width="120" height="37.5"></v:textrect>		<path d="M0 109.38 A3.00007 3.00007 -180 0 0 3 112.38 L117 112.38 A3.00007 3.00007 -180 0 0 120 109.38 L120 77.88 A3.00007					 3.00007 -180 0 0 117 74.88 L3 74.88 A3.00007 3.00007 -180 0 0 0 77.88 L0 109.38 Z" class="st8"></path>		<text x="40.07" y="97.23" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>camsrc</text>		</g>	<g id="group32-25" transform="translate(302.375,-14.7814)" v:mid="32" v:groupcontext="group">		<title>Sheet.32</title>		<g id="shape8-26" v:mid="8" v:groupcontext="shape" transform="translate(15.1882,1.42109E-14)">			<title>Sheet.8</title>			<desc>Qualcomm</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="27.5654" cy="106.082" width="55.14" height="12.6"></v:textrect>			<rect x="0" y="99.7816" width="55.1308" height="12.6" class="st9"></rect>			<text x="-0" y="109.23" class="st10" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>Qualcomm  </text>			</g>		<g id="shape9-29" v:mid="9" v:groupcontext="shape" transform="translate(9.99201E-16,-0.218619)">			<title>Sheet.9</title>			<path d="M0 110.88 A1.50003 1.50003 -180 0 0 1.5 112.38 L10.5 112.38 A1.50003 1.50003 -180 0 0 12 110.88 L12 101.88						 A1.50003 1.50003 -180 0 0 10.5 100.38 L1.5 100.38 A1.50003 1.50003 -180 0 0 -0 101.88 L0 110.88 Z" class="st4"></path>		</g>		<g id="shape11-31" v:mid="11" v:groupcontext="shape" transform="translate(89.1246,1.42109E-14)">			<title>Sheet.11</title>			<desc>开源</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="10.5" cy="106.082" width="21" height="12.6"></v:textrect>			<rect x="0" y="99.7816" width="21" height="12.6" class="st9"></rect>			<text x="0" y="109.58" class="st11" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>开源</text>			</g>		<g id="shape12-34" v:mid="12" v:groupcontext="shape" transform="translate(73.9363,-0.218619)">			<title>Sheet.12</title>			<path d="M0 110.88 A1.50003 1.50003 -180 0 0 1.5 112.38 L10.5 112.38 A1.50003 1.50003 -180 0 0 12 110.88 L12 101.88						 A1.50003 1.50003 -180 0 0 10.5 100.38 L1.5 100.38 A1.50003 1.50003 -180 0 0 0 101.88 L0 110.88 Z" class="st8"></path>		</g>	</g></g>
</svg>

## 多边形隐私遮罩

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

多边形隐私遮罩允许您使用多边形形状在图像上创建隐私区域。使用多边形可使遮罩效果更平滑、更精确。

- 多边形隐私遮罩应用于多边形内封闭的区域。
- 逆多边形隐私遮罩应用于除多边形内封闭区域之外的所有区域。

开始之前，在目标设备上运行以下命令来配置显示器：

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

    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, 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
- 摄像头：

        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

### 启用反多边形隐私遮罩

- 文件源：

        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
- 摄像头：

        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

### 在 runtime 更新多边形隐私遮罩属性

1. 设置隐私遮罩：

        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. 在 pipeline 控件中，选择 `Playing mode - 3`。
3. 要更改 pipeline 控件中的属性，请选择 `Plugin mode -
                        p`。
4. 从插件中选择 `overlay - 2`。
5. 在插件属性中，选择 `overlay-mask - 4`。
6. 添加以下值：

        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: Nov 05, 2025

[Previous Topic
视频合成用例](https://docs.qualcomm.com/bundle/publicresource/80-70022-50SC/topics/video-composition.md) [Next Topic
视频分割用例](https://docs.qualcomm.com/bundle/publicresource/80-70022-50SC/topics/video-split-use-cases.md)