# 使用 USB 摄像头源的目标检测

该用例从连接到 Qualcomm EVK 的 USB 网络摄像头传输视频流。该网络摄像头应可作为 `/dev/videoX` 设备访问。此外，您还可以执行目标检测并预览结果。

Note

对于 USB 摄像头输入，在配置文件中设置 `video-format`、`resolution` 和 `framerate` 参数以匹配摄像头的功能。要查看摄像头功能，请参阅[配置 USB 摄像头](https://docs.qualcomm.com/bundle/publicresource/topics/80-70029-8/usb.html#configure-usb-camera)。

对于不同的用例，在目标设备上运行以下命令：

- MJPEG 视频格式：

gst-launch-1.0 -v -e --gst-debug=2 v4l2src device="/dev/video2" ! image/jpeg,width=1920,height=1080,framerate=30/1 ! jpegdec ! \
        videoconvert ! video/x-raw,format=NV12 ! qtivtransform ! queue ! tee name=split ! queue ! qtivcomposer name=mixer ! queue ! \
        fpsdisplaysink sync=true text-overlay=true video-sink="waylandsink sync=true fullscreen=true" split. ! queue ! qtimlvconverter ! queue ! \
        qtimltflite delegate=external external-delegate-path=libQnnTFLiteDelegate.so external-delegate-options="QNNExternalDelegate,backend_type=htp;" \
        model=/etc/models/yolox_quantized.tflite ! queue ! qtimlpostprocess settings="{\"confidence\": 75.0}" results=10 module=yolov8 labels=/etc/labels/yolox.json \
        ! video/x-raw,format=BGRA,width=640,height=360 ! queue ! mixer.
        Copy to clipboard
- YUY2 视频格式：

gst-launch-1.0 -v -e --gst-debug=2 v4l2src io-mode=4 device="/dev/video2" ! \
        video/x-raw,format=YUY2,width=640,height=480,framerate=30/1 ! queue ! tee name=split ! queue ! \
        qtivcomposer name=mixer ! queue ! fpsdisplaysink sync=true text-overlay=true video-sink="waylandsink sync=true fullscreen=true" split. ! \
        queue ! qtimlvconverter ! queue ! qtimltflite delegate=external external-delegate-path=libQnnTFLiteDelegate.so \
        external-delegate-options="QNNExternalDelegate,backend_type=htp;" model=/etc/models/yolox_quantized.tflite ! queue ! \
        qtimlpostprocess settings="{\"confidence\": 75.0}" results=10 module=yolov8 labels=/etc/labels/yolox.json \
        ! video/x-raw,format=BGRA,width=640,height=360 ! queue ! mixer.
        Copy to clipboard
- NV12 视频格式：

gst-launch-1.0 -v -e --gst-debug=2 v4l2src io-mode=4 device="/dev/video2" ! video/x-raw,format=NV12,width=640,height=480,framerate=30/1 ! queue ! tee name=split split. ! \
        queue ! qtivcomposer name=mixer ! queue ! waylandsink fullscreen=true split. ! queue ! qtimlvconverter ! queue ! \
        qtimltflite delegate=external external-delegate-path=libQnnTFLiteDelegate.so external-delegate-options="QNNExternalDelegate,backend_type=htp;" \
        model=/etc/models/yolox_quantized.tflite ! queue ! qtimlpostprocess settings="{\"confidence\": 75.0}" results=10 module=yolov8 labels=/etc/labels/yolox.json \
        ! video/x-raw,format=BGRA,width=640,height=360 ! queue ! mixer.
        Copy to clipboard

下图展示了一个 pipeline，其处理来自 USB 摄像头的输入以生成各种输出。

<?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 gst_usb_single_camera_display-app_flow.svg Layer_3 -->
<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="13.3446in" height="1.53917in" viewbox="0 0 960.81 110.82" xml:space="preserve" color-interpolation-filters="sRGB" class="st16" aria-label="../../_images/gst_usb_single_camera_display-app_flow.svg"><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: none; stroke: #000000; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5 }
.svg-1 .st4 { stroke: #000000; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5 }
.svg-1 .st5 { fill: #007884; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st6 { fill: #ffffff; font-family: Roboto; font-size: 1.00001em }
.svg-1 .st7 { stroke: #000000; 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: #ffffff; font-family: Roboto; font-size: 0.874992em }
.svg-1 .st10 { fill: #000000; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st11 { font-size: 1em }
.svg-1 .st12 { fill: none }
.svg-1 .st13 { fill: none; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st14 { fill: #000000; font-family: Roboto; font-size: 0.874992em }
.svg-1 .st15 { fill: #000000; font-family: SimHei; font-size: 0.874992em }
.svg-1 .st16 { 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>Layer_3</title>	<v:pageproperties v:drawingscale="1" v:pagescale="1" v:drawingunits="19" v:shadowoffsetx="9" v:shadowoffsety="-9"></v:pageproperties>	<g id="shape2-1" v:mid="2" v:groupcontext="shape" transform="translate(0.375,-0.375)">		<title>Sheet.2</title>		<path d="M0 105.2 A5.62513 5.62513 -180 0 0 5.63 110.82 L954.43 110.82 A5.62513 5.62513 -180 0 0 960.06 105.2 L960.06					 6.38 A5.62513 5.62513 -180 0 0 954.43 0.75 L5.62 0.75 A5.62513 5.62513 -180 0 0 -0 6.38 L0 105.2 Z" class="st1"></path>	</g>	<g id="shape3-3" v:mid="3" v:groupcontext="shape">		<title>Sheet.3</title>		<path d="M954.81 0.75 C957.7 0.75 960.06 3.11 960.06 6 L960.06 104.82 C960.06 107.72 957.7 110.07 954.81 110.07 L6 110.07					 C3.1 110.07 0.75 107.72 0.75 104.82 L0.75 6 C0.75 3.11 3.1 0.75 6 0.75 L954.81 0.75 ZM954.81 0 L6 0 C2.68					 0 0 2.69 0 6 L0 104.82 C0 108.13 2.68 110.82 6 110.82 L954.81 110.82 C958.12 110.82 960.81 108.13 960.81					 104.82 L960.81 6 C960.81 2.69 958.12 0 954.81 0 Z" class="st2"></path>	</g>	<g id="shape4-5" v:mid="4" v:groupcontext="shape" transform="translate(915,-59.0025)">		<title>Sheet.4</title>		<path d="M0 107.82 A3.00007 3.00007 -180 0 0 3 110.82 L27 110.82 A3.00007 3.00007 -180 0 0 30 107.82 L30 92.82 A3.00007					 3.00007 -180 0 0 27 89.82 L3 89.82 A3.00007 3.00007 -180 0 0 -0 92.82 L0 107.82 Z" class="st3"></path>	</g>	<g id="shape5-7" v:mid="5" v:groupcontext="shape" transform="translate(924,-53.0025)">		<title>Sheet.5</title>		<path d="M0 110.82 L12 110.82" class="st4"></path>	</g>	<g id="shape6-10" v:mid="6" v:groupcontext="shape" transform="translate(1040.82,51.8175) rotate(90)">		<title>Sheet.6</title>		<path d="M0 110.82 L6 110.82" class="st4"></path>	</g>	<g id="shape7-13" v:mid="7" v:groupcontext="shape" transform="translate(56.85,-39.57)">		<title>Sheet.7</title>		<desc>v4l2src</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="33.75" cy="82.695" width="67.5" height="56.25"></v:textrect>		<path d="M-0 107.82 A3.00007 3.00007 -180 0 0 3 110.82 L64.5 110.82 A3.00007 3.00007 -180 0 0 67.5 107.82 L67.5 57.57					 A3.00007 3.00007 -180 0 0 64.5 54.57 L3 54.57 A3.00007 3.00007 -180 0 0 -0 57.57 L0 107.82 Z" class="st5"></path>		<text x="14.38" y="86.29" class="st6" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>v4l2src</text>		</g>	<g id="shape8-16" v:mid="8" v:groupcontext="shape" transform="translate(45.6,-67.695)">		<title>Sheet.8</title>		<path d="M0 110.82 L11.25 110.82" class="st7"></path>	</g>	<g id="shape9-19" v:mid="9" v:groupcontext="shape" transform="translate(903.75,-67.695)">		<title>Sheet.9</title>		<path d="M0 110.82 L11.25 110.82" class="st7"></path>	</g>	<g id="shape11-22" v:mid="11" v:groupcontext="shape" transform="translate(289.35,-39.57)">		<title>Sheet.11</title>		<desc>qtimlvtransform</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="45" cy="88.32" width="90" height="45"></v:textrect>		<path d="M0 107.82 A3.00007 3.00007 -180 0 0 3 110.82 L87 110.82 A3.00007 3.00007 -180 0 0 90 107.82 L90 68.82 A3.00007					 3.00007 -180 0 0 87 65.82 L3 65.82 A3.00007 3.00007 -180 0 0 -0 68.82 L0 107.82 Z" class="st8"></path>		<text x="7.46" y="91.92" class="st9" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtimlvtransform</text>		</g>	<g id="group12-25" transform="translate(274.35,-59.0775)" v:mid="12" v:groupcontext="group">		<title>Sheet.12</title>		<g id="shape13-26" v:mid="13" v:groupcontext="shape" transform="translate(0,-2.9925)">			<title>Sheet.13</title>			<path d="M0 110.82 L10.69 110.82" class="st7"></path>		</g>		<g id="shape14-29" v:mid="14" v:groupcontext="shape" transform="translate(9.8175,1.42109E-14)">			<title>Sheet.14</title>			<path d="M0 110.82 L5.18 107.83 L0 104.84 L0 110.82 Z" class="st10"></path>		</g>	</g>	<g id="shape16-31" v:mid="16" v:groupcontext="shape" transform="translate(394.35,-39.57)">		<title>Sheet.16</title>		<desc>qtimlvconverter</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="45" cy="88.32" width="90" height="45"></v:textrect>		<path d="M0 107.82 A3.00007 3.00007 -180 0 0 3 110.82 L87 110.82 A3.00007 3.00007 -180 0 0 90 107.82 L90 68.82 A3.00007					 3.00007 -180 0 0 87 65.82 L3 65.82 A3.00007 3.00007 -180 0 0 -0 68.82 L0 107.82 Z" class="st8"></path>		<text x="8.6" y="91.92" class="st9" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtimlvconverter</text>		</g>	<g id="group17-34" transform="translate(379.35,-59.0775)" v:mid="17" v:groupcontext="group">		<title>Sheet.17</title>		<g id="shape18-35" v:mid="18" v:groupcontext="shape" transform="translate(0,-2.9925)">			<title>Sheet.18</title>			<path d="M0 110.82 L10.69 110.82" class="st7"></path>		</g>		<g id="shape19-38" v:mid="19" v:groupcontext="shape" transform="translate(9.8175,1.42109E-14)">			<title>Sheet.19</title>			<path d="M0 110.82 L5.18 107.83 L0 104.84 L0 110.82 Z" class="st10"></path>		</g>	</g>	<g id="shape21-40" v:mid="21" v:groupcontext="shape" transform="translate(499.35,-39.57)">		<title>Sheet.21</title>		<desc>qtimltflite/qtimlsnpe/ qtimlqnn</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="45" cy="88.32" width="90" height="45"></v:textrect>		<path d="M0 107.82 A3.00007 3.00007 -180 0 0 3 110.82 L87 110.82 A3.00007 3.00007 -180 0 0 90 107.82 L90 68.82 A3.00007					 3.00007 -180 0 0 87 65.82 L3 65.82 A3.00007 3.00007 -180 0 0 -0 68.82 L0 107.82 Z" class="st8"></path>		<text x="20.41" y="77.97" class="st9" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtimltflite/<tspan x="19.66" dy="1.2em" class="st11">qtimlsnpe/<v:lf></v:lf></tspan><tspan x="24.37" dy="1.329em" class="st11">qtimlqnn</tspan></text>		</g>	<g id="group22-45" transform="translate(484.35,-59.0775)" v:mid="22" v:groupcontext="group">		<title>Sheet.22</title>		<g id="shape23-46" v:mid="23" v:groupcontext="shape" transform="translate(0,-2.9925)">			<title>Sheet.23</title>			<path d="M0 110.82 L10.69 110.82" class="st7"></path>		</g>		<g id="shape24-49" v:mid="24" v:groupcontext="shape" transform="translate(9.8175,1.42109E-14)">			<title>Sheet.24</title>			<path d="M0 110.82 L5.18 107.83 L0 104.84 L0 110.82 Z" class="st10"></path>		</g>	</g>	<g id="shape26-51" v:mid="26" v:groupcontext="shape" transform="translate(604.35,-39.57)">		<title>Sheet.26</title>		<desc>qtimlpostprocess</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="45" cy="88.32" width="90" height="45"></v:textrect>		<path d="M0 107.82 A3.00007 3.00007 -180 0 0 3 110.82 L87 110.82 A3.00007 3.00007 -180 0 0 90 107.82 L90 68.82 A3.00007					 3.00007 -180 0 0 87 65.82 L3 65.82 A3.00007 3.00007 -180 0 0 -0 68.82 L0 107.82 Z" class="st8"></path>		<text x="4.13" y="91.92" class="st9" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtimlpostprocess</text>		</g>	<g id="group27-54" transform="translate(589.35,-59.0775)" v:mid="27" v:groupcontext="group">		<title>Sheet.27</title>		<g id="shape28-55" v:mid="28" v:groupcontext="shape" transform="translate(0,-2.9925)">			<title>Sheet.28</title>			<path d="M0 110.82 L10.69 110.82" class="st7"></path>		</g>		<g id="shape29-58" v:mid="29" v:groupcontext="shape" transform="translate(9.8175,1.42109E-14)">			<title>Sheet.29</title>			<path d="M0 110.82 L5.18 107.83 L0 104.84 L0 110.82 Z" class="st10"></path>		</g>	</g>	<g id="shape31-60" v:mid="31" v:groupcontext="shape" transform="translate(709.35,-39.57)">		<title>Sheet.31</title>		<desc>qtivcomposer</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="45" cy="82.695" width="90" height="56.25"></v:textrect>		<path d="M-0 107.82 A3.00007 3.00007 -180 0 0 3 110.82 L87 110.82 A3.00007 3.00007 -180 0 0 90 107.82 L90 57.57 A3.00007					 3.00007 -180 0 0 87 54.57 L3 54.57 A3.00007 3.00007 -180 0 0 -0 57.57 L0 107.82 Z" class="st8"></path>		<text x="12.94" y="86.29" class="st9" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtivcomposer</text>		</g>	<g id="group32-63" transform="translate(694.35,-59.0775)" v:mid="32" v:groupcontext="group">		<title>Sheet.32</title>		<g id="shape33-64" v:mid="33" v:groupcontext="shape" transform="translate(0,-2.9925)">			<title>Sheet.33</title>			<path d="M0 110.82 L10.69 110.82" class="st7"></path>		</g>		<g id="shape34-67" v:mid="34" v:groupcontext="shape" transform="translate(9.8175,1.42109E-14)">			<title>Sheet.34</title>			<path d="M0 110.82 L5.18 107.83 L0 104.84 L0 110.82 Z" class="st10"></path>		</g>	</g>	<g id="shape36-69" v:mid="36" v:groupcontext="shape" transform="translate(814.35,-39.57)">		<title>Sheet.36</title>		<desc>Waylandsink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="45" cy="82.695" width="90" height="56.25"></v:textrect>		<path d="M-0 107.82 A3.00007 3.00007 -180 0 0 3 110.82 L87 110.82 A3.00007 3.00007 -180 0 0 90 107.82 L90 57.57 A3.00007					 3.00007 -180 0 0 87 54.57 L3 54.57 A3.00007 3.00007 -180 0 0 -0 57.57 L0 107.82 Z" class="st5"></path>		<text x="15.48" y="86.29" class="st9" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Waylandsink</text>		</g>	<g id="group37-72" transform="translate(799.35,-64.7025)" v:mid="37" v:groupcontext="group">		<title>Sheet.37</title>		<g id="shape38-73" v:mid="38" v:groupcontext="shape" transform="translate(0,-2.9925)">			<title>Sheet.38</title>			<path d="M0 110.82 L10.69 110.82" class="st7"></path>		</g>		<g id="shape39-76" v:mid="39" v:groupcontext="shape" transform="translate(9.8175,1.42109E-14)">			<title>Sheet.39</title>			<path d="M0 110.82 L5.18 107.83 L0 104.84 L0 110.82 Z" class="st10"></path>		</g>	</g>	<g id="shape41-78" v:mid="41" v:groupcontext="shape" transform="translate(139.35,-39.57)">		<title>Sheet.41</title>		<desc>capsfilter</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="33.75" cy="82.695" width="67.5" height="56.25"></v:textrect>		<path d="M-0 107.82 A3.00007 3.00007 -180 0 0 3 110.82 L64.5 110.82 A3.00007 3.00007 -180 0 0 67.5 107.82 L67.5 57.57					 A3.00007 3.00007 -180 0 0 64.5 54.57 L3 54.57 A3.00007 3.00007 -180 0 0 -0 57.57 L0 107.82 Z" class="st5"></path>		<text x="11.85" y="86.29" class="st9" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>capsfilter</text>		</g>	<g id="group42-81" transform="translate(124.35,-64.7025)" v:mid="42" v:groupcontext="group">		<title>Sheet.42</title>		<g id="shape43-82" v:mid="43" v:groupcontext="shape" transform="translate(0,-2.9925)">			<title>Sheet.43</title>			<path d="M0 110.82 L10.69 110.82" class="st7"></path>		</g>		<g id="shape44-85" v:mid="44" v:groupcontext="shape" transform="translate(9.8175,1.42109E-14)">			<title>Sheet.44</title>			<path d="M0 110.82 L5.18 107.83 L0 104.84 L0 110.82 Z" class="st10"></path>		</g>	</g>	<g id="shape46-87" v:mid="46" v:groupcontext="shape" transform="translate(221.85,-39.57)">		<title>Sheet.46</title>		<desc>tee</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="26.25" cy="82.695" width="52.5" height="56.25"></v:textrect>		<path d="M0 107.82 A3.00007 3.00007 -180 0 0 3 110.82 L49.5 110.82 A3.00007 3.00007 -180 0 0 52.5 107.82 L52.5 57.57					 A3.00007 3.00007 -180 0 0 49.5 54.57 L3 54.57 A3.00007 3.00007 -180 0 0 -0 57.57 L0 107.82 Z" class="st5"></path>		<text x="18.97" y="86.29" class="st9" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>tee</text>		</g>	<g id="group47-90" transform="translate(206.85,-64.7025)" v:mid="47" v:groupcontext="group">		<title>Sheet.47</title>		<g id="shape48-91" v:mid="48" v:groupcontext="shape" transform="translate(0,-2.9925)">			<title>Sheet.48</title>			<path d="M0 110.82 L10.69 110.82" class="st7"></path>		</g>		<g id="shape49-94" v:mid="49" v:groupcontext="shape" transform="translate(9.8175,1.42109E-14)">			<title>Sheet.49</title>			<path d="M0 110.82 L5.18 107.83 L0 104.84 L0 110.82 Z" class="st10"></path>		</g>	</g>	<g id="group51-96" transform="translate(274.312,-86.1675)" v:mid="51" v:groupcontext="group">		<title>Sheet.51</title>		<g id="shape52-97" v:mid="52" v:groupcontext="shape" transform="translate(0,-2.9925)">			<title>Sheet.52</title>			<path d="M0 110.82 L430.72 110.82" class="st7"></path>		</g>		<g id="shape53-100" v:mid="53" v:groupcontext="shape" transform="translate(429.855,1.42109E-14)">			<title>Sheet.53</title>			<path d="M0 110.82 L5.18 107.83 L0 104.84 L0 110.82 Z" class="st10"></path>		</g>	</g>	<g id="shape54-102" v:mid="54" v:groupcontext="shape" transform="translate(15,-54.6)">		<title>Sheet.54</title>		<ellipse cx="15" cy="95.82" rx="15" ry="15" class="st3"></ellipse>	</g>	<g id="shape55-104" v:mid="55" v:groupcontext="shape" transform="translate(24.375,-63.975)">		<title>Sheet.55</title>		<ellipse cx="5.625" cy="105.195" rx="5.625" ry="5.625" class="st3"></ellipse>	</g>	<g id="shape56-106" v:mid="56" v:groupcontext="shape" transform="translate(20.625,-47.1)">		<title>Sheet.56</title>		<path d="M0 110.82 L18.75 110.82 L0 110.82 Z" class="st12"></path>		<path d="M0 110.82 L18.75 110.82" class="st4"></path>	</g>	<g id="shape57-109" v:mid="57" v:groupcontext="shape" transform="translate(30,-47.1)">		<title>Sheet.57</title>		<path d="M0 110.82 L0 103.32 L0 110.82 Z" class="st12"></path>		<path d="M0 110.82 L0 103.32" class="st4"></path>	</g>	<g id="shape60-112" v:mid="60" v:groupcontext="shape" transform="translate(850.057,-13.2825)">		<title>Sheet.60</title>		<desc>Qualcomm</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="27.2212" cy="104.52" width="54.45" height="12.6"></v:textrect>		<rect x="0" y="98.22" width="54.4425" height="12.6" class="st13"></rect>		<text x="0" y="107.67" class="st14" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>Qualcomm  </text>		</g>	<g id="shape61-115" v:mid="61" v:groupcontext="shape" transform="translate(834.87,-13.5)">		<title>Sheet.61</title>		<path d="M0 109.32 A1.50003 1.50003 -180 0 0 1.5 110.82 L10.5 110.82 A1.50003 1.50003 -180 0 0 12 109.32 L12 100.32 A1.50003					 1.50003 -180 0 0 10.5 98.82 L1.5 98.82 A1.50003 1.50003 -180 0 0 0 100.32 L0 109.32 Z" class="st8"></path>	</g>	<g id="shape63-117" v:mid="63" v:groupcontext="shape" transform="translate(924,-13.2825)">		<title>Sheet.63</title>		<desc>开源</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="10.5" cy="104.52" width="21.01" height="12.6"></v:textrect>		<rect x="0" y="98.22" width="21" height="12.6" class="st13"></rect>		<text x="0" y="107.67" class="st15" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>开源</text>		</g>	<g id="shape64-120" v:mid="64" v:groupcontext="shape" transform="translate(908.813,-13.5)">		<title>Sheet.64</title>		<path d="M0 109.32 A1.50003 1.50003 -180 0 0 1.5 110.82 L10.5 110.82 A1.50003 1.50003 -180 0 0 12 109.32 L12 100.32 A1.50003					 1.50003 -180 0 0 10.5 98.82 L1.5 98.82 A1.50003 1.50003 -180 0 0 0 100.32 L0 109.32 Z" class="st5"></path>	</g></g>
</svg>

**图：使用 USB 摄像头源的目标检测**

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

| Pipeline | 说明 |
| --- | --- |
| wayland 上的 USB 摄像头和目标检测 | <ol class="arabic simple"><br><li><p>USB 摄像头采集摄像头实时流。</p></li><br><li><p>Capsfilter 用于对原始视频数据实施约束。</p></li><br><li><p>tee 用于拆分流以进行推理。</p></li><br><li><p><a href="https://docs.qualcomm.com/doc/80-70029-50SC/topic/qtivtransform.html"><span class="doc">qtivtransform</span></a> 转换流数据。</p></li><br><li><p><a href="https://docs.qualcomm.com/doc/80-70029-50SC/topic/qtimlvconverter.html"><span class="doc">qtimlvconverter</span></a> 执行预处理并将视频流转换为用于推理的张量流。</p></li><br><li><p><a href="https://docs.qualcomm.com/doc/80-70029-50SC/topic/qtimltflite.html"><span class="doc">qtimltflite</span></a> 在流上运行推理。</p></li><br><li><p>qtimlpostprocess 处理来自任意目标检测模型的推理结果并生成视频帧。</p></li><br><li><p><a href="https://docs.qualcomm.com/doc/80-70029-50SC/topic/qtivcomposer.html"><span class="doc">qtivcomposer</span></a> 将合成视频帧并与 qtirtspsink 共享。</p></li><br><li><p><a href="https://docs.qualcomm.com/doc/80-70029-50SC/topic/waylandsink.html"><span class="doc">Waylandsink</span></a> 将合成后的视频流提交至 Weston，由其在本地显示器上渲染。</p></li><br></ol> |

Last Published: Apr 17, 2026

[Previous Topic
使用 LiteRT 进行四流批处理](https://docs.qualcomm.com/bundle/publicresource/80-70029-50SC/topics/four-stream-batching-with-litert.md) [Next Topic
Qualcomm Neural Processing SDK 用例](https://docs.qualcomm.com/bundle/publicresource/80-70029-50SC/topics/qualcomm-neural-processing-sdk-use-cases.md)