# 使用 LiteRT 进行姿态估计和编码

Source: [https://docs.qualcomm.com/doc/80-70022-50SC/topic/single-camera-stream-with-pose-estimation-and-encode.html](https://docs.qualcomm.com/doc/80-70022-50SC/topic/single-camera-stream-with-pose-estimation-and-encode.html)

这些用例实现了 HRNet LiteRT 模型通过姿态估计来处理单个摄像头流，并将该流编码为 H.264 码流。

Note: 对于 Ubuntu Server，需要 `sudo` 访问权限才能将编码流写入 `/etc/media` 文件夹。

## 使用 qtivoverlay 插件应用姿态估计叠加

在目标设备上运行用例：

    gst-launch-1.0 -e \
    qtiqmmfsrc name=camsrc ! video/x-raw,format=NV12_Q08C,width=1280,height=720,framerate=30/1 ! queue ! tee name=split \
    split. ! queue ! qtimetamux name=metamux ! queue ! qtivoverlay ! queue ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! \
    h264parse ! queue ! mp4mux ! queue ! filesink location=/etc/media/video.mp4 \
    split. ! queue ! qtimlvconverter ! queue ! qtimltflite delegate=external external-delegate-path=libQnnTFLiteDelegate.so \
    external-delegate-options="QNNExternalDelegate,backend_type=htp;" model=/etc/models/hrnet_pose_quantized.tflite ! queue ! \
    qtimlpostprocess results=2 module=hrnet labels=/etc/labels/hrnet_pose.json settings=/etc/labels/hrnet_settings.json ! text/x-raw ! queue ! metamux.Copy to clipboard

要停止用例，请使用 CTRL + C。

下图显示了用例执行的流程：

1. 从来自摄像头源的视频流中识别场景中人物的姿态。
2. 使用 overlaylib 叠加可用的姿势。
3. 将数据流编码为 H.264 码流。
4. 多路复用 MP4 容器中的数据流并将其存储为 MP4 文件。

Figure : 使用 qtioverlay 进行姿态估计和编码的 pipeline
                
                <!--?xml version="1.0" encoding="UTF-8" standalone="no"?-->

<!-- Generated by Microsoft Visio, SVG Export pipeline_pose_estimation_and_encode_with_overlay.svg pipeline_pose_estimation_and_en -->
<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="12.2841in" height="3.72433in" viewbox="0 0 884.454 268.152" 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: #d2d7e1; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st3 { fill: #007884; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st4 { fill: #ffffff; font-family: Roboto; font-size: 1.00001em }
.svg-1 .st5 { fill: #2a2aea; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.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: none }
.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_pose_estimation_and_en</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.374943,-0.375366)">		<title>Sheet.3</title>		<path d="M0 262.53 A5.62513 5.62513 -180 0 0 5.62 268.15 L878.08 268.15 A5.62513 5.62513 -180 0 0 883.7 262.53 L883.7					 6.38 A5.62513 5.62513 -180 0 0 878.08 0.75 L5.62 0.75 A5.62513 5.62513 -180 0 0 0 6.38 L0 262.53 Z" class="st1"></path>	</g>	<g id="shape4-3" v:mid="4" v:groupcontext="shape">		<title>Sheet.4</title>		<path d="M878.45 0.75 C881.35 0.75 883.7 3.11 883.7 6 L883.7 262.15 C883.7 265.05 881.35 267.4 878.45 267.4 L6 267.4					 C3.11 267.4 0.75 265.05 0.75 262.15 L0.75 6 C0.75 3.11 3.11 0.75 6 0.75 L878.45 0.75 ZM878.45 0 L6 0 C2.69					 0 0 2.69 0 6 L0 262.15 C0 265.47 2.69 268.15 6 268.15 L878.45 268.15 C881.77 268.15 884.45 265.47 884.45					 262.15 L884.45 6 C884.45 2.69 881.77 0 878.45 0 Z" class="st2"></path>	</g>	<g id="shape14-5" v:mid="14" v:groupcontext="shape" transform="translate(15,-215.652)">		<title>Sheet.14</title>		<desc>camsrc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="45" cy="249.402" width="90" height="37.5"></v:textrect>		<path d="M0 265.15 A3.00007 3.00007 -180 0 0 3 268.15 L87 268.15 A3.00007 3.00007 -180 0 0 90 265.15 L90 233.65 A3.00007					 3.00007 -180 0 0 87 230.65 L3 230.65 A3.00007 3.00007 -180 0 0 -0 233.65 L0 265.15 Z" class="st3"></path>		<text x="25.07" y="253" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>camsrc</text>		</g>	<g id="shape17-8" v:mid="17" v:groupcontext="shape" transform="translate(124.551,-215.652)">		<title>Sheet.17</title>		<desc>tee</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="45" cy="249.402" width="90" height="37.5"></v:textrect>		<path d="M0 265.15 A3.00007 3.00007 -180 0 0 3 268.15 L87 268.15 A3.00007 3.00007 -180 0 0 90 265.15 L90 233.65 A3.00007					 3.00007 -180 0 0 87 230.65 L3 230.65 A3.00007 3.00007 -180 0 0 -0 233.65 L0 265.15 Z" class="st3"></path>		<text x="36.68" y="253" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>tee</text>		</g>	<g id="shape20-11" v:mid="20" v:groupcontext="shape" transform="translate(109.551,-158.021)">		<title>Sheet.20</title>		<desc>qtimlvconverter</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="249.402" width="120" height="37.5"></v:textrect>		<path d="M-0 265.15 A3.00007 3.00007 -180 0 0 3 268.15 L117 268.15 A3.00007 3.00007 -180 0 0 120 265.15 L120 233.65 A3.00007					 3.00007 -180 0 0 117 230.65 L3 230.65 A3.00007 3.00007 -180 0 0 0 233.65 L0 265.15 Z" class="st5"></path>		<text x="18.39" y="253" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtimlvconverter</text>		</g>	<g id="shape23-14" v:mid="23" v:groupcontext="shape" transform="translate(105.401,-234.402)">		<title>Sheet.23</title>		<path d="M0 268.15 L14.98 268.15" class="st6"></path>	</g>	<g id="shape24-17" v:mid="24" v:groupcontext="shape" transform="translate(119.617,-231.784)">		<title>Sheet.24</title>		<path d="M0 268.15 L4.53 265.53 L0 262.92 L0 268.15 Z" class="st7"></path>	</g>	<g id="shape26-19" v:mid="26" v:groupcontext="shape" transform="translate(233.702,-215.652)">		<title>Sheet.26</title>		<desc>qtimetamux</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="45" cy="249.402" width="90.01" height="37.5"></v:textrect>		<path d="M0 265.15 A3.00007 3.00007 -180 0 0 3 268.15 L87 268.15 A3.00007 3.00007 -180 0 0 90 265.15 L90 233.65 A3.00007					 3.00007 -180 0 0 87 230.65 L3 230.65 A3.00007 3.00007 -180 0 0 -0 233.65 L0 265.15 Z" class="st5"></path>		<text x="12.97" y="253" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtimetamux</text>		</g>	<g id="shape29-22" v:mid="29" v:groupcontext="shape" transform="translate(214.551,-234.402)">		<title>Sheet.29</title>		<path d="M0 268.15 L14.98 268.15" class="st6"></path>	</g>	<g id="shape30-25" v:mid="30" v:groupcontext="shape" transform="translate(228.768,-231.784)">		<title>Sheet.30</title>		<path d="M0 268.15 L4.53 265.53 L0 262.92 L0 268.15 Z" class="st7"></path>	</g>	<g id="shape32-27" v:mid="32" v:groupcontext="shape" transform="translate(342.852,-215.652)">		<title>Sheet.32</title>		<desc>qtioverlay</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="45" cy="249.402" width="90.01" height="37.5"></v:textrect>		<path d="M0 265.15 A3.00007 3.00007 -180 0 0 3 268.15 L87 268.15 A3.00007 3.00007 -180 0 0 90 265.15 L90 233.65 A3.00007					 3.00007 -180 0 0 87 230.65 L3 230.65 A3.00007 3.00007 -180 0 0 -0 233.65 L0 265.15 Z" class="st5"></path>		<text x="19.08" y="253" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtioverlay</text>		</g>	<g id="shape35-30" v:mid="35" v:groupcontext="shape" transform="translate(323.702,-234.402)">		<title>Sheet.35</title>		<path d="M0 268.15 L14.98 268.15" class="st6"></path>	</g>	<g id="shape36-33" v:mid="36" v:groupcontext="shape" transform="translate(337.918,-231.784)">		<title>Sheet.36</title>		<path d="M0 268.15 L4.53 265.53 L0 262.92 L0 268.15 Z" class="st7"></path>	</g>	<g id="shape38-35" v:mid="38" v:groupcontext="shape" transform="translate(452.003,-215.652)">		<title>Sheet.38</title>		<desc>v4l2h264enc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="45" cy="249.402" width="90" height="37.5"></v:textrect>		<path d="M0 265.15 A3.00007 3.00007 -180 0 0 3 268.15 L87 268.15 A3.00007 3.00007 -180 0 0 90 265.15 L90 233.65 A3.00007					 3.00007 -180 0 0 87 230.65 L3 230.65 A3.00007 3.00007 -180 0 0 -0 233.65 L0 265.15 Z" class="st3"></path>		<text x="10.86" y="253" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>v4l2h264enc</text>		</g>	<g id="shape41-38" v:mid="41" v:groupcontext="shape" transform="translate(432.852,-234.402)">		<title>Sheet.41</title>		<path d="M0 268.15 L14.98 268.15" class="st6"></path>	</g>	<g id="shape42-41" v:mid="42" v:groupcontext="shape" transform="translate(447.069,-231.784)">		<title>Sheet.42</title>		<path d="M0 268.15 L4.53 265.53 L0 262.92 L0 268.15 Z" class="st7"></path>	</g>	<g id="shape44-43" v:mid="44" v:groupcontext="shape" transform="translate(561.153,-215.652)">		<title>Sheet.44</title>		<desc>h264parse</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="45" cy="249.402" width="90.01" height="37.5"></v:textrect>		<path d="M0 265.15 A3.00007 3.00007 -180 0 0 3 268.15 L87 268.15 A3.00007 3.00007 -180 0 0 90 265.15 L90 233.65 A3.00007					 3.00007 -180 0 0 87 230.65 L3 230.65 A3.00007 3.00007 -180 0 0 -0 233.65 L0 265.15 Z" class="st3"></path>		<text x="16.65" y="253" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>h264parse</text>		</g>	<g id="shape47-46" v:mid="47" v:groupcontext="shape" transform="translate(542.003,-234.402)">		<title>Sheet.47</title>		<path d="M0 268.15 L14.98 268.15" class="st6"></path>	</g>	<g id="shape48-49" v:mid="48" v:groupcontext="shape" transform="translate(556.219,-231.784)">		<title>Sheet.48</title>		<path d="M0 268.15 L4.53 265.53 L0 262.92 L0 268.15 Z" class="st7"></path>	</g>	<g id="shape50-51" v:mid="50" v:groupcontext="shape" transform="translate(670.304,-215.652)">		<title>Sheet.50</title>		<desc>mp4mux</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="45" cy="249.402" width="90" height="37.5"></v:textrect>		<path d="M0 265.15 A3.00007 3.00007 -180 0 0 3 268.15 L87 268.15 A3.00007 3.00007 -180 0 0 90 265.15 L90 233.65 A3.00007					 3.00007 -180 0 0 87 230.65 L3 230.65 A3.00007 3.00007 -180 0 0 -0 233.65 L0 265.15 Z" class="st3"></path>		<text x="21.47" y="253" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>mp4mux</text>		</g>	<g id="shape53-54" v:mid="53" v:groupcontext="shape" transform="translate(651.153,-234.402)">		<title>Sheet.53</title>		<path d="M0 268.15 L14.98 268.15" class="st6"></path>	</g>	<g id="shape54-57" v:mid="54" v:groupcontext="shape" transform="translate(665.37,-231.784)">		<title>Sheet.54</title>		<path d="M0 268.15 L4.53 265.53 L0 262.92 L0 268.15 Z" class="st7"></path>	</g>	<g id="shape56-59" v:mid="56" v:groupcontext="shape" transform="translate(779.454,-215.652)">		<title>Sheet.56</title>		<desc>filesink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="45" cy="249.402" width="90.01" height="37.5"></v:textrect>		<path d="M0 265.15 A3.00007 3.00007 -180 0 0 3 268.15 L87 268.15 A3.00007 3.00007 -180 0 0 90 265.15 L90 233.65 A3.00007					 3.00007 -180 0 0 87 230.65 L3 230.65 A3.00007 3.00007 -180 0 0 -0 233.65 L0 265.15 Z" class="st3"></path>		<text x="25.92" y="253" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>filesink</text>		</g>	<g id="shape59-62" v:mid="59" v:groupcontext="shape" transform="translate(760.304,-234.402)">		<title>Sheet.59</title>		<path d="M0 268.15 L14.98 268.15" class="st6"></path>	</g>	<g id="shape60-65" v:mid="60" v:groupcontext="shape" transform="translate(774.52,-231.784)">		<title>Sheet.60</title>		<path d="M0 268.15 L4.53 265.53 L0 262.92 L0 268.15 Z" class="st7"></path>	</g>	<g id="shape62-67" v:mid="62" v:groupcontext="shape" transform="translate(437.703,52.8462) rotate(90)">		<title>Sheet.62</title>		<path d="M0 268.15 L14.98 268.15" class="st6"></path>	</g>	<g id="shape63-70" v:mid="63" v:groupcontext="shape" transform="translate(166.933,-196.556)">		<title>Sheet.63</title>		<path d="M0 263.62 L2.62 268.15 L5.24 263.62 L0 263.62 Z" class="st7"></path>	</g>	<g id="shape65-72" v:mid="65" v:groupcontext="shape" transform="translate(109.551,-100.319)">		<title>Sheet.65</title>		<desc>qtimltflite</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="249.402" width="120" height="37.5"></v:textrect>		<path d="M0 265.15 A3.00007 3.00007 -180 0 0 3 268.15 L117 268.15 A3.00007 3.00007 -180 0 0 120 265.15 L120 233.65 A3.00007					 3.00007 -180 0 0 117 230.65 L3 230.65 A3.00007 3.00007 -180 0 0 0 233.65 L0 265.15 Z" class="st5"></path>		<text x="34.36" y="253" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtimltflite</text>		</g>	<g id="shape68-75" v:mid="68" v:groupcontext="shape" transform="translate(437.703,110.548) rotate(90)">		<title>Sheet.68</title>		<path d="M0 268.15 L14.98 268.15" class="st6"></path>	</g>	<g id="shape69-78" v:mid="69" v:groupcontext="shape" transform="translate(166.933,-138.854)">		<title>Sheet.69</title>		<path d="M0 263.62 L2.62 268.15 L5.24 263.62 L0 263.62 Z" class="st7"></path>	</g>	<g id="shape71-80" v:mid="71" v:groupcontext="shape" transform="translate(109.551,-42)">		<title>Sheet.71</title>		<desc>qtimlpostprocess</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="249.402" width="120.01" height="37.5"></v:textrect>		<path d="M0 265.15 A3.00007 3.00007 -180 0 0 3 268.15 L117 268.15 A3.00007 3.00007 -180 0 0 120 265.15 L120 233.65 A3.00007					 3.00007 -180 0 0 117 230.65 L3 230.65 A3.00007 3.00007 -180 0 0 0 233.65 L0 265.15 Z" class="st5"></path>		<text x="13.29" y="253" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtimlpostprocess</text>		</g>	<g id="shape74-83" v:mid="74" v:groupcontext="shape" transform="translate(437.703,168.867) rotate(90)">		<title>Sheet.74</title>		<path d="M0 268.15 L14.98 268.15" class="st6"></path>	</g>	<g id="shape75-86" v:mid="75" v:groupcontext="shape" transform="translate(166.933,-80.5347)">		<title>Sheet.75</title>		<path d="M0 263.62 L2.62 268.15 L5.24 263.62 L0 263.62 Z" class="st7"></path>	</g>	<g id="shape77-88" v:mid="77" v:groupcontext="shape" transform="translate(229.551,-60.75)">		<title>Sheet.77</title>		<path d="M0 268.15 L49.15 268.15 L49.15 117.36 L0 268.15 Z" class="st8"></path>		<path d="M0 268.15 L49.15 268.15 L49.15 117.36" class="st6"></path>	</g>	<g id="shape78-91" v:mid="78" v:groupcontext="shape" transform="translate(276.084,-210.772)">		<title>Sheet.78</title>		<path d="M5.24 268.15 L2.62 263.62 L0 268.15 L5.24 268.15 Z" class="st7"></path>	</g>	<g id="group79-93" transform="translate(759.33,-14.7814)" v:mid="79" v:groupcontext="group">		<title>Sheet.79</title>		<g id="shape7-94" 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.369" cy="261.852" width="54.74" height="12.6"></v:textrect>			<rect x="0" y="255.552" width="54.7379" height="12.6" class="st9"></rect>			<text x="0" y="265" class="st10" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>Qualcomm  </text>			</g>		<g id="shape8-97" v:mid="8" v:groupcontext="shape" transform="translate(-9.99201E-16,-0.218619)">			<title>Sheet.8</title>			<path d="M0 266.65 A1.50003 1.50003 -180 0 0 1.5 268.15 L10.5 268.15 A1.50003 1.50003 -180 0 0 12 266.65 L12 257.65						 A1.50003 1.50003 -180 0 0 10.5 256.15 L1.5 256.15 A1.50003 1.50003 -180 0 0 0 257.65 L0 266.65 Z" class="st5"></path>		</g>		<g id="shape10-99" 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="261.852" width="21" height="12.6"></v:textrect>			<rect x="0" y="255.552" width="21" height="12.6" class="st9"></rect>			<text x="0" y="265.35" class="st11" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>开源</text>			</g>		<g id="shape11-102" v:mid="11" v:groupcontext="shape" transform="translate(73.9363,-0.218619)">			<title>Sheet.11</title>			<path d="M0 266.65 A1.50003 1.50003 -180 0 0 1.5 268.15 L10.5 268.15 A1.50003 1.50003 -180 0 0 12 266.65 L12 257.65						 A1.50003 1.50003 -180 0 0 10.5 256.15 L1.5 256.15 A1.50003 1.50003 -180 0 0 0 257.65 L0 266.65 Z" class="st3"></path>		</g>	</g></g>
</svg>

下表列出了 pipeline 执行的顺序处理阶段：

| 处理过程 | 说明 |
| --- | --- |
| [qtiqmmfsrc](https://docs.qualcomm.com/doc/80-70022-50SC/topic/qtiqmmfsrc.html) | <ol class="ol" id="single-camera-stream-with-pose-estimation-and-encode__ol_l2f_zgm_vbc"><br>                                    <li class="li">采集视频流（源）并创建源的两个副本：<ul class="ul" id="single-camera-stream-with-pose-estimation-and-encode__ol_m2f_zgm_vbc"><br>                                            <li class="li">一个视频流被发送至 qtimetamux 插件，以保留视频流。</li><br><br>                                            <li class="li">另一个视频流被发送到 ML 推理 pipeline。</li><br><br>                                        </ul><br></li><br><br>                                </ol> |
| **预处理** | **预处理** |
| [qtimlvconverter](https://docs.qualcomm.com/doc/80-70022-50SC/topic/qtimlvconverter.html) | <ol class="ol" id="single-camera-stream-with-pose-estimation-and-encode__ol_xsf_q5l_vbc"><br>                                    <li class="li">在其接收端口上接收视频流。</li><br><br>                                    <li class="li">执行预处理：<ul class="ul" id="single-camera-stream-with-pose-estimation-and-encode__ul_ff2_twl_vbc"><br>                                            <li class="li">颜色转换</li><br><br>                                            <li class="li">缩小/放大</li><br><br>                                            <li class="li">在模型需要浮点值作为输入时，对流数据进行归一化</li><br><br>                                        </ul><br></li><br><br>                                    <li class="li">在其发送端口上将视频流转换为张量数据。<p class="p">HRNet 模型使用此张量流进行推理。</p><br></li><br><br>                                </ol> |
| **推理** | **推理** |
| [qtimltflite](https://docs.qualcomm.com/doc/80-70022-50SC/topic/qtimltflite.html) | <ol class="ol" id="single-camera-stream-with-pose-estimation-and-encode__ol_bwn_s5l_vbc"><br>                                    <li class="li">加载 HRNet 模型。</li><br><br>                                    <li class="li">为选择的 delegate 修改图。</li><br><br>                                    <li class="li">在其接收端口上接收张量数据。</li><br><br>                                    <li class="li">运行推理并在其发送端口上生成带有姿态估计结果的张量数据。</li><br><br>                                </ol> |
| **后处理** | **后处理** |
| qtimlpostprocess | <ol class="ol" id="single-camera-stream-with-pose-estimation-and-encode__ol_gr1_w5l_vbc"><br>                                    <li class="li">从其接收端口上的 HRNet 模型接收推理张量。</li><br><br>                                    <li class="li">将张量转换为多媒体插件稍后可以处理的视频或文本等格式。 </li><br><br>                                    <li class="li">将阈值应用于所选的结果数。</li><br><br>                                    <li class="li">加载姿态估计模型的相应模块。 <p class="p">在此用例中，qtimlpostprocess 执行以下操作：</p><ol class="ol" type="a" id="single-camera-stream-with-pose-estimation-and-encode__ol_lyh_txn_vbc"><br>                                            <li class="li">加载 HRNet 子模块。</li><br><br>                                            <li class="li">将结果生成为文本结构。</li><br><br>                                            <li class="li">接着发送到 qtimetamux 的接收端口。</li><br><br>                                        </ol><br></li><br><br>                                </ol> |
| [qtimetamux](https://docs.qualcomm.com/doc/80-70022-50SC/topic/qtimetamux.html) | <ol class="ol" id="single-camera-stream-with-pose-estimation-and-encode__ol_ll3_x5l_vbc"><br>                                    <li class="li">在其接收端口上接收视频流和文本流，以及与视频流相对应的姿态结果。</li><br><br>                                    <li class="li">在其接收端口上生成包含视频流内容的 GST 缓冲存。</li><br><br>                                    <li class="li">将姿态从数据接收端口添加到其发送端口上的 GST 缓存元数据（元复用）。</li><br><br>                                </ol> |
| [qtivoverlay](https://docs.qualcomm.com/doc/80-70022-50SC/topic/qtioverlay.html) | <ol class="ol" id="single-camera-stream-with-pose-estimation-and-encode__ol_wst_y5l_vbc"><br>                                    <li class="li">接收多路复用流。</li><br><br>                                    <li class="li">使用 CL 将姿态叠加在 VideoFrame 上。 </li><br><br>                                    <li class="li">在其发送端口上生成带有叠加层的 GST 缓存。</li><br><br>                                </ol> |
| [v4l2h264enc](https://docs.qualcomm.com/doc/80-70022-50SC/topic/v4l2h264enc.html) | <ol class="ol" id="single-camera-stream-with-pose-estimation-and-encode__ol_b25_j14_vbc"><br>                                    <li class="li">将参数应用于在接收端口上接收到的视频流的每一帧。 </li><br><br>                                    <li class="li">将其编码为码流，并通过其发送端口发送。</li><br><br>                                </ol> |
| h264parse | 向 GStreamer 缓存元数据添加更多码流信息。 |
| mp4mux | 接收缓冲存并创建容器格式规范缓存。 |
| **输出** | **输出** |
| Filesink | 将生成的数据流存储在 /etc/media/video.mp4文件中。 |
| Playback | 从主机拉取 video.mp4并在媒体播放器上播放：<br>`scp root@<IP address of<br>                                        target device>:/etc/media/video.mp4 <destination<br>                                        directory>` |

## 使用 qtivcomposer 混合原始帧与姿态估计遮罩

在目标设备上运行用例：

    gst-launch-1.0 -e --gst-debug=2 \
    qtiqmmfsrc name=camsrc ! video/x-raw,format=NV12_Q08C,width=1280,height=720,framerate=30/1 ! queue ! tee name=split \
    split. ! queue ! qtivcomposer name=mixer sink_1::dimensions="<1920,1080>" ! queue ! video/x-raw,format=NV12,width=1920,height=1080,interlace-mode=progressive,colorimetry=bt601 ! \
    v4l2h264enc capture-io-mode=4 output-io-mode=5 ! h264parse ! queue ! mp4mux ! queue ! filesink location=/etc/media/video.mp4 \
    split. ! queue ! qtimlvconverter ! queue ! qtimltflite delegate=external external-delegate-path=libQnnTFLiteDelegate.so external-delegate-options="QNNExternalDelegate,backend_type=htp;" \
    model=/etc/models/hrnet_pose_quantized.tflite ! queue ! qtimlpostprocess results=2 module=hrnet labels=/etc/labels/hrnet_pose.json settings=/etc/labels/hrnet_settings.json \
     ! video/x-raw,format=BGRA,width=640,height=360 ! queue ! mixer.Copy to clipboard

要停止用例，请使用 CTRL + C。

下图显示了用例执行的流程：

1. 对来自摄像头源的视频流中的场景进行分类。
2. 使用 qtivcomposer 合成姿势和视频流。
3. 将此流编码为 H.264 码流。
4. 在 MP4 容器中进行复用并将其存储为 MP4 文件。

Figure : 使用 qtivcomposer 进行姿态估计和编码的 pipeline
                
                <!--?xml version="1.0" encoding="UTF-8" standalone="no"?-->

<!-- Generated by Microsoft Visio, SVG Export pipeline_pose_estimation_and_encode_with_qtivcomposer.svg pipeline_pose_estimation_and_en -->
<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.9785in" height="3.70349in" viewbox="0 0 790.451 266.652" 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: #d2d7e1; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-2 .st3 { fill: #007884; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-2 .st4 { fill: #ffffff; font-family: Roboto; font-size: 1.00001em }
.svg-2 .st5 { fill: #2a2aea; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.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: none }
.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_pose_estimation_and_en</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.3752,-0.375275)">		<title>Sheet.3</title>		<path d="M0 261.03 A5.62513 5.62513 -180 0 0 5.62 266.65 L784.08 266.65 A5.62513 5.62513 -180 0 0 789.7 261.03 L789.7					 6.38 A5.62513 5.62513 -180 0 0 784.08 0.75 L5.62 0.75 A5.62513 5.62513 -180 0 0 0 6.38 L0 261.03 Z" class="st1"></path>	</g>	<g id="shape4-3" v:mid="4" v:groupcontext="shape">		<title>Sheet.4</title>		<path d="M784.45 0.75 C787.35 0.75 789.7 3.11 789.7 6 L789.7 260.65 C789.7 263.55 787.35 265.9 784.45 265.9 L6 265.9					 C3.11 265.9 0.75 263.55 0.75 260.65 L0.75 6 C0.75 3.11 3.11 0.75 6 0.75 L784.45 0.75 ZM784.45 0 L6 0 C2.69					 0 0 2.69 0 6 L0 260.65 C0 263.97 2.69 266.65 6 266.65 L784.45 266.65 C787.76 266.65 790.45 263.97 790.45					 260.65 L790.45 6 C790.45 2.69 787.76 0 784.45 0 Z" class="st2"></path>	</g>	<g id="shape13-5" v:mid="13" v:groupcontext="shape" transform="translate(15,-214.152)">		<title>Sheet.13</title>		<desc>camsrc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="45" cy="247.902" width="90" height="37.5"></v:textrect>		<path d="M0 263.65 A3.00007 3.00007 -180 0 0 3 266.65 L87 266.65 A3.00007 3.00007 -180 0 0 90 263.65 L90 232.15 A3.00007					 3.00007 -180 0 0 87 229.15 L3 229.15 A3.00007 3.00007 -180 0 0 -0 232.15 L0 263.65 Z" class="st3"></path>		<text x="25.07" y="251.5" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>camsrc</text>		</g>	<g id="shape15-8" v:mid="15" v:groupcontext="shape" transform="translate(124.551,-214.152)">		<title>Sheet.15</title>		<desc>tee</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="45" cy="247.902" width="90" height="37.5"></v:textrect>		<path d="M0 263.65 A3.00007 3.00007 -180 0 0 3 266.65 L87 266.65 A3.00007 3.00007 -180 0 0 90 263.65 L90 232.15 A3.00007					 3.00007 -180 0 0 87 229.15 L3 229.15 A3.00007 3.00007 -180 0 0 -0 232.15 L0 263.65 Z" class="st3"></path>		<text x="36.68" y="251.5" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>tee</text>		</g>	<g id="shape17-11" v:mid="17" v:groupcontext="shape" transform="translate(109.551,-156.521)">		<title>Sheet.17</title>		<desc>qtimlvconverter</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="247.902" width="120" height="37.5"></v:textrect>		<path d="M-0 263.65 A3.00007 3.00007 -180 0 0 3 266.65 L117 266.65 A3.00007 3.00007 -180 0 0 120 263.65 L120 232.15 A3.00007					 3.00007 -180 0 0 117 229.15 L3 229.15 A3.00007 3.00007 -180 0 0 0 232.15 L0 263.65 Z" class="st5"></path>		<text x="18.39" y="251.5" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtimlvconverter</text>		</g>	<g id="shape20-14" v:mid="20" v:groupcontext="shape" transform="translate(105,-232.902)">		<title>Sheet.20</title>		<path d="M0 266.65 L15.38 266.65" class="st6"></path>	</g>	<g id="shape21-17" v:mid="21" v:groupcontext="shape" transform="translate(119.617,-230.284)">		<title>Sheet.21</title>		<path d="M0 266.65 L4.53 264.03 L0 261.42 L0 266.65 Z" class="st7"></path>	</g>	<g id="shape22-19" v:mid="22" v:groupcontext="shape" transform="translate(234.049,-214.152)">		<title>Sheet.22</title>		<desc>qtivcomposer</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="52.5" cy="247.902" width="105.01" height="37.5"></v:textrect>		<path d="M0 263.65 A3.00007 3.00007 -180 0 0 3 266.65 L102 266.65 A3.00007 3.00007 -180 0 0 105 263.65 L105 232.15 A3.00007					 3.00007 -180 0 0 102 229.15 L3 229.15 A3.00007 3.00007 -180 0 0 -0 232.15 L0 263.65 Z" class="st5"></path>		<text x="15.85" y="251.5" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtivcomposer</text>		</g>	<g id="shape25-22" v:mid="25" v:groupcontext="shape" transform="translate(214.551,-232.902)">		<title>Sheet.25</title>		<path d="M0 266.65 L14.98 266.65" class="st6"></path>	</g>	<g id="shape26-25" v:mid="26" v:groupcontext="shape" transform="translate(228.768,-230.284)">		<title>Sheet.26</title>		<path d="M0 266.65 L4.53 264.03 L0 261.42 L0 266.65 Z" class="st7"></path>	</g>	<g id="shape28-27" v:mid="28" v:groupcontext="shape" transform="translate(339.049,-232.902)">		<title>Sheet.28</title>		<path d="M0 266.65 L14.98 266.65" class="st6"></path>	</g>	<g id="shape29-30" v:mid="29" v:groupcontext="shape" transform="translate(353.265,-230.284)">		<title>Sheet.29</title>		<path d="M0 266.65 L4.53 264.03 L0 261.42 L0 266.65 Z" class="st7"></path>	</g>	<g id="shape30-32" v:mid="30" v:groupcontext="shape" transform="translate(357.999,-214.152)">		<title>Sheet.30</title>		<desc>v4l2h264enc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="45" cy="247.902" width="90" height="37.5"></v:textrect>		<path d="M0 263.65 A3.00007 3.00007 -180 0 0 3 266.65 L87 266.65 A3.00007 3.00007 -180 0 0 90 263.65 L90 232.15 A3.00007					 3.00007 -180 0 0 87 229.15 L3 229.15 A3.00007 3.00007 -180 0 0 0 232.15 L0 263.65 Z" class="st3"></path>		<text x="10.86" y="251.5" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>v4l2h264enc</text>		</g>	<g id="shape32-35" v:mid="32" v:groupcontext="shape" transform="translate(467.15,-214.152)">		<title>Sheet.32</title>		<desc>h264parse</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="45" cy="247.902" width="90" height="37.5"></v:textrect>		<path d="M0 263.65 A3.00007 3.00007 -180 0 0 3 266.65 L87 266.65 A3.00007 3.00007 -180 0 0 90 263.65 L90 232.15 A3.00007					 3.00007 -180 0 0 87 229.15 L3 229.15 A3.00007 3.00007 -180 0 0 -0 232.15 L0 263.65 Z" class="st3"></path>		<text x="16.65" y="251.5" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>h264parse</text>		</g>	<g id="shape35-38" v:mid="35" v:groupcontext="shape" transform="translate(447.999,-232.902)">		<title>Sheet.35</title>		<path d="M0 266.65 L14.98 266.65" class="st6"></path>	</g>	<g id="shape36-41" v:mid="36" v:groupcontext="shape" transform="translate(462.215,-230.284)">		<title>Sheet.36</title>		<path d="M0 266.65 L4.53 264.03 L0 261.42 L0 266.65 Z" class="st7"></path>	</g>	<g id="shape37-43" v:mid="37" v:groupcontext="shape" transform="translate(576.3,-214.152)">		<title>Sheet.37</title>		<desc>mp4mux</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="45" cy="247.902" width="90" height="37.5"></v:textrect>		<path d="M0 263.65 A3.00007 3.00007 -180 0 0 3 266.65 L87 266.65 A3.00007 3.00007 -180 0 0 90 263.65 L90 232.15 A3.00007					 3.00007 -180 0 0 87 229.15 L3 229.15 A3.00007 3.00007 -180 0 0 -0 232.15 L0 263.65 Z" class="st3"></path>		<text x="21.47" y="251.5" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>mp4mux</text>		</g>	<g id="shape40-46" v:mid="40" v:groupcontext="shape" transform="translate(557.149,-232.902)">		<title>Sheet.40</title>		<path d="M0 266.65 L14.98 266.65" class="st6"></path>	</g>	<g id="shape41-49" v:mid="41" v:groupcontext="shape" transform="translate(571.366,-230.284)">		<title>Sheet.41</title>		<path d="M0 266.65 L4.53 264.03 L0 261.42 L0 266.65 Z" class="st7"></path>	</g>	<g id="shape42-51" v:mid="42" v:groupcontext="shape" transform="translate(685.451,-214.152)">		<title>Sheet.42</title>		<desc>filesink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="45" cy="247.902" width="90.01" height="37.5"></v:textrect>		<path d="M0 263.65 A3.00007 3.00007 -180 0 0 3 266.65 L87 266.65 A3.00007 3.00007 -180 0 0 90 263.65 L90 232.15 A3.00007					 3.00007 -180 0 0 87 229.15 L3 229.15 A3.00007 3.00007 -180 0 0 -0 232.15 L0 263.65 Z" class="st3"></path>		<text x="25.92" y="251.5" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>filesink</text>		</g>	<g id="shape45-54" v:mid="45" v:groupcontext="shape" transform="translate(666.3,-232.902)">		<title>Sheet.45</title>		<path d="M0 266.65 L14.98 266.65" class="st6"></path>	</g>	<g id="shape46-57" v:mid="46" v:groupcontext="shape" transform="translate(680.517,-230.284)">		<title>Sheet.46</title>		<path d="M0 266.65 L4.53 264.03 L0 261.42 L0 266.65 Z" class="st7"></path>	</g>	<g id="shape48-59" v:mid="48" v:groupcontext="shape" transform="translate(436.203,52.8461) rotate(90)">		<title>Sheet.48</title>		<path d="M0 266.65 L14.98 266.65" class="st6"></path>	</g>	<g id="shape49-62" v:mid="49" v:groupcontext="shape" transform="translate(166.933,-195.055)">		<title>Sheet.49</title>		<path d="M0 262.12 L2.62 266.65 L5.24 262.12 L0 262.12 Z" class="st7"></path>	</g>	<g id="shape50-64" v:mid="50" v:groupcontext="shape" transform="translate(109.551,-98.8192)">		<title>Sheet.50</title>		<desc>qtimltflite</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="247.902" width="120" height="37.5"></v:textrect>		<path d="M0 263.65 A3.00007 3.00007 -180 0 0 3 266.65 L117 266.65 A3.00007 3.00007 -180 0 0 120 263.65 L120 232.15 A3.00007					 3.00007 -180 0 0 117 229.15 L3 229.15 A3.00007 3.00007 -180 0 0 0 232.15 L0 263.65 Z" class="st5"></path>		<text x="34.36" y="251.5" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtimltflite</text>		</g>	<g id="shape53-67" v:mid="53" v:groupcontext="shape" transform="translate(436.203,110.548) rotate(90)">		<title>Sheet.53</title>		<path d="M0 266.65 L14.98 266.65" class="st6"></path>	</g>	<g id="shape54-70" v:mid="54" v:groupcontext="shape" transform="translate(166.933,-137.354)">		<title>Sheet.54</title>		<path d="M0 262.12 L2.62 266.65 L5.24 262.12 L0 262.12 Z" class="st7"></path>	</g>	<g id="shape55-72" v:mid="55" v:groupcontext="shape" transform="translate(109.551,-42)">		<title>Sheet.55</title>		<desc>qtimlpostprocess</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="247.902" width="120" height="37.5"></v:textrect>		<path d="M0 263.65 A3.00007 3.00007 -180 0 0 3 266.65 L117 266.65 A3.00007 3.00007 -180 0 0 120 263.65 L120 232.15 A3.00007					 3.00007 -180 0 0 117 229.15 L3 229.15 A3.00007 3.00007 -180 0 0 0 232.15 L0 263.65 Z" class="st5"></path>		<text x="13.29" y="251.5" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtimlpostprocess</text>		</g>	<g id="shape58-75" v:mid="58" v:groupcontext="shape" transform="translate(436.203,167.832) rotate(90)">		<title>Sheet.58</title>		<path d="M0 266.65 L14.98 266.65" class="st6"></path>	</g>	<g id="shape59-78" v:mid="59" v:groupcontext="shape" transform="translate(166.933,-80.0692)">		<title>Sheet.59</title>		<path d="M0 262.12 L2.62 266.65 L5.24 262.12 L0 262.12 Z" class="st7"></path>	</g>	<g id="shape61-80" v:mid="61" v:groupcontext="shape" transform="translate(229.551,-60.75)">		<title>Sheet.61</title>		<path d="M0 266.65 L57 266.65 L57 117.36 L0 266.65 Z" class="st8"></path>		<path d="M0 266.65 L57 266.65 L57 117.36" class="st6"></path>	</g>	<g id="shape62-83" v:mid="62" v:groupcontext="shape" transform="translate(283.931,-209.272)">		<title>Sheet.62</title>		<path d="M5.24 266.65 L2.62 262.12 L0 266.65 L5.24 266.65 Z" class="st7"></path>	</g>	<g id="group63-85" transform="translate(665.326,-14.7814)" v:mid="63" v:groupcontext="group">		<title>Sheet.63</title>		<g id="shape7-86" 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.2151" cy="260.352" width="54.44" height="12.6"></v:textrect>			<rect x="0" y="254.052" width="54.4302" height="12.6" class="st9"></rect>			<text x="0" y="263.5" class="st10" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>Qualcomm  </text>			</g>		<g id="shape8-89" v:mid="8" v:groupcontext="shape" transform="translate(1.26898E-13,-0.218619)">			<title>Sheet.8</title>			<path d="M0 265.15 A1.50003 1.50003 -180 0 0 1.5 266.65 L10.5 266.65 A1.50003 1.50003 -180 0 0 12 265.15 L12 256.15						 A1.50003 1.50003 -180 0 0 10.5 254.65 L1.5 254.65 A1.50003 1.50003 -180 0 0 -0 256.15 L0 265.15 Z" class="st5"></path>		</g>		<g id="shape10-91" 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="260.352" width="21" height="12.6"></v:textrect>			<rect x="0" y="254.052" width="21" height="12.6" class="st9"></rect>			<text x="0" y="263.85" class="st11" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>开源</text>			</g>		<g id="shape11-94" v:mid="11" v:groupcontext="shape" transform="translate(73.9363,-0.218619)">			<title>Sheet.11</title>			<path d="M0 265.15 A1.50003 1.50003 -180 0 0 1.5 266.65 L10.5 266.65 A1.50003 1.50003 -180 0 0 12 265.15 L12 256.15						 A1.50003 1.50003 -180 0 0 10.5 254.65 L1.5 254.65 A1.50003 1.50003 -180 0 0 -0 256.15 L0 265.15 Z" class="st3"></path>		</g>	</g></g>
</svg>

下表列出了 pipeline 执行的顺序处理阶段：

| 处理过程 | 说明 |
| --- | --- |
| [qtiqmmfsrc](https://docs.qualcomm.com/doc/80-70022-50SC/topic/qtiqmmfsrc.html) | <ol class="ol" id="single-camera-stream-with-pose-estimation-and-encode__ol_gxv_t14_vbc"><br>                                    <li class="li">采集视频流（源）并创建源的两个副本：<ul class="ul" id="single-camera-stream-with-pose-estimation-and-encode__ol_hxv_t14_vbc"><br>                                            <li class="li">一个视频流被发送到 qtivcomposer 插件以保留视频流。</li><br><br>                                            <li class="li">另一个视频流被发送到 ML 推理 pipeline。</li><br><br>                                        </ul><br></li><br><br>                                </ol> |
| **预处理** | **预处理** |
| [qtimlvconverter](https://docs.qualcomm.com/doc/80-70022-50SC/topic/qtimlvconverter.html) | <ol class="ol" id="single-camera-stream-with-pose-estimation-and-encode__ol_ixv_t14_vbc"><br>                                    <li class="li">在其接收端口上接收视频流。</li><br><br>                                    <li class="li">执行预处理：<ul class="ul" id="single-camera-stream-with-pose-estimation-and-encode__ul_jxv_t14_vbc"><br>                                            <li class="li">颜色转换</li><br><br>                                            <li class="li">缩小/放大</li><br><br>                                            <li class="li">在模型需要浮点值作为输入时，对流数据进行归一化</li><br><br>                                        </ul><br></li><br><br>                                    <li class="li">在其发送端口上将视频流转换为张量数据。<p class="p">HRNet 模型使用此张量流进行推理。</p><br></li><br><br>                                </ol> |
| **推理** | **推理** |
| [qtimltflite](https://docs.qualcomm.com/doc/80-70022-50SC/topic/qtimltflite.html) | <ol class="ol" id="single-camera-stream-with-pose-estimation-and-encode__ol_kxv_t14_vbc"><br>                                    <li class="li">加载 HRNet 模型。</li><br><br>                                    <li class="li">为选择的 delegate 修改图。</li><br><br>                                    <li class="li">在其接收端口上接收张量数据。</li><br><br>                                    <li class="li">运行推理并在其发送端口上生成带有姿态估计结果的张量数据。</li><br><br>                                </ol> |
| **后处理** | **后处理** |
| qtimlpostprocess | <ol class="ol" id="single-camera-stream-with-pose-estimation-and-encode__ol_lxv_t14_vbc"><br>                                    <li class="li">从其接收端口上的 HRNet 模型接收推理张量。</li><br><br>                                    <li class="li">将张量转换为多媒体插件稍后可以处理的视频或文本等格式。 </li><br><br>                                    <li class="li">将阈值应用于所选的结果数。</li><br><br>                                    <li class="li">加载姿态估计模型的相应模块。 <p class="p">在此用例中，qtimlpostprocess 执行以下操作：</p><ol class="ol" type="a" id="single-camera-stream-with-pose-estimation-and-encode__ol_mxv_t14_vbc"><br>                                            <li class="li">加载 HRNet 子模块。</li><br><br>                                            <li class="li">将结果生成为所绘制姿态的视频帧。</li><br><br>                                            <li class="li">将它们发送到 qtivcomposer 的接收端口。</li><br><br>                                        </ol><br></li><br><br>                                </ol> |
|  | <ol class="ol" id="single-camera-stream-with-pose-estimation-and-encode__ol_wjj_x14_vbc"><br>                                    <li class="li">在接收端口上接收原始视频流和姿态视频流。</li><br><br>                                    <li class="li">在其发送端口上，生成 GST 缓存，其内容由来自其接收设备的视频流组成。</li><br><br>                                </ol> |
| [qtivoverlay](https://docs.qualcomm.com/doc/80-70022-50SC/topic/qtioverlay.html) | <ol class="ol" id="single-camera-stream-with-pose-estimation-and-encode__ol_oxv_t14_vbc"><br>                                    <li class="li">接收多路复用流。</li><br><br>                                    <li class="li">使用 CL 将姿态叠加在 VideoFrame 上。</li><br><br>                                    <li class="li">在其发送端口上生成带有叠加层的 GST 缓存。</li><br><br>                                </ol> |
| [v4l2h264enc](https://docs.qualcomm.com/doc/80-70022-50SC/topic/v4l2h264enc.html) | <ol class="ol" id="single-camera-stream-with-pose-estimation-and-encode__ol_pxv_t14_vbc"><br>                                    <li class="li">将参数应用于在接收端口上接收到的视频流的每一帧。 </li><br><br>                                    <li class="li">将其编码为码流，并通过其发送端口发送。</li><br><br>                                </ol> |
| h264parse | 向 GStreamer 缓存元数据添加更多比特流信息。 |
| mp4mux | 接收缓冲存并创建容器格式规范缓存。 |
| **输出** | **输出** |
| Filesink | 将生成的数据流存储在 /etc/media/video.mp4文件中。 |
| Playback | 从主机拉取 video.mp4并在媒体播放器上播放：<br>`scp root@<IP address of<br>                                        target device>:/etc/media/video.mp4 <destination<br>                                        directory>` |

**Parent Topic:** [LiteRT 用例](https://docs.qualcomm.com/doc/80-70022-50SC/topic/tensorflow-lite-use-cases.html)

Last Published: Nov 05, 2025

[Previous Topic
使用 LiteRT 进行姿态估计和显示](https://docs.qualcomm.com/bundle/publicresource/80-70022-50SC/topics/single-camera-stream-with-pose-estimation-and-display.md) [Next Topic
使用 LiteRT 进行视频超分辨率和显示](https://docs.qualcomm.com/bundle/publicresource/80-70022-50SC/topics/video-super-resolution-and-display-with-litert.md)