# qtimlvconverter

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

qtimlvconverter 插件将传入的视频缓存转换为神经网络张量，同时在此过程中执行必要的格式转换和调整大小。为了实现这些操作，该插件使用 GPU 硬件和 ION/DMA 分配的缓存。

关于浮点张量，需要使用平均值和西格玛属性来使用公式：变换来自视频源的 8 位无符号整数镜像

(channel - mean) × sigma其中通道是颜色转换输入的红色、绿色、蓝色或 Alpha 通道的值。

例如，下表列出了影响图像通道变换的平均值和西格玛属性：

| 属性 | 带通道变换的 RGB 图像 |
| --- | --- |
| R=255，G=127，B=0 | R=(255 - 128.0) x 0.75, G=(127 - 156.0)<br>                                x 0.34, B=(0 - 124.0) x 0.02 |
| mean=“&lt;128.0, 156.0, 124.0, 58.0&gt;” | R=(255 - 128.0) x 0.75, G=(127 - 156.0)<br>                                x 0.34, B=(0 - 124.0) x 0.02 |
| sigma="&lt;0.75, 0.34, 0.02, 0.07&gt;" | R=(255 - 128.0) x 0.75, G=(127 - 156.0)<br>                                x 0.34, B=(0 - 124.0) x 0.02 |
|  |  |
|  |  |

subpixel-layout 属性指定输出张量中图像像素的排列。

该插件使用 Qualcomm IB2C 库进行所有转换操作。该库与 API 封装在自定义 GstGlesVideoConverter 抽象层中，用于创建、配置和处理传入和传出缓存。

GstMLBufferPool，一个自定义缓存类，可以执行以下操作：

- 分配输出缓存。
- 通过 IOCTL 命令向内核分配 ION 缓存。

Figure : 使用 qtimlvconverter 的 Gstbuffer 工作流
            
            <!--?xml version="1.0" encoding="UTF-8" standalone="no"?-->

<!-- Generated by Microsoft Visio, SVG Export gstbuffer_workflow_qtimlvconverter.svg gstbuffer_workflow_qtimltflite -->
<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="11.5976in" height="6.24237in" viewbox="0 0 835.026 449.45" xml:space="preserve" color-interpolation-filters="sRGB" class="st22"><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: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st4 { fill: #000000; font-family: Roboto; font-size: 1.00001em; font-weight: bold }
.svg-1 .st5 { fill: #000000; font-family: Roboto; font-size: 0.833336em }
.svg-1 .st6 { font-size: 1em }
.svg-1 .st7 { fill: #007884; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st8 { fill: #ffffff; font-family: SimHei; font-size: 1.00001em }
.svg-1 .st9 { stroke: #000000; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st10 { fill: #000000; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st11 { fill: #2a2aea; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st12 { fill: #ffffff; font-family: Roboto; font-size: 1.00001em }
.svg-1 .st13 { font-family: SimHei; font-size: 1em }
.svg-1 .st14 { font-size: 1em; font-weight: normal }
.svg-1 .st15 { font-family: SimHei; font-size: 1em; font-weight: normal }
.svg-1 .st16 { fill: #000000; font-family: SimHei; font-size: 1.00001em }
.svg-1 .st17 { fill: #ffffff; font-family: Roboto; font-size: 1.00001em; font-weight: bold }
.svg-1 .st18 { stroke: #b3b7bf; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st19 { font-family: Symbol; font-size: 1em; font-weight: normal }
.svg-1 .st20 { fill: #000000; font-family: Roboto; font-size: 0.874992em }
.svg-1 .st21 { fill: #000000; font-family: SimHei; font-size: 0.874992em }
.svg-1 .st22 { 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>gstbuffer_workflow_qtimltflite</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.374886,-0.374863)">		<title>Sheet.3</title>		<path d="M0 443.83 A5.62513 5.62513 -180 0 0 5.63 449.45 L828.65 449.45 A5.62513 5.62513 -180 0 0 834.28 443.83 L834.28					 6.37 A5.62513 5.62513 -180 0 0 828.65 0.75 L5.62 0.75 A5.62513 5.62513 -180 0 0 -0 6.37 L0 443.83 Z" class="st1"></path>	</g>	<g id="shape4-3" v:mid="4" v:groupcontext="shape">		<title>Sheet.4</title>		<path d="M829.03 0.75 C831.92 0.75 834.28 3.11 834.28 6 L834.28 443.45 C834.28 446.35 831.92 448.7 829.03 448.7 L6 448.7					 C3.11 448.7 0.75 446.35 0.75 443.45 L0.75 6 C0.75 3.11 3.11 0.75 6 0.75 L829.03 0.75 ZM829.03 0 L6 0 C2.69					 0 0 2.69 0 6 L0 443.45 C0 446.76 2.69 449.45 6 449.45 L829.03 449.45 C832.34 449.45 835.03 446.76 835.03					 443.45 L835.03 6 C835.03 2.69 832.34 0 829.03 0 Z" class="st2"></path>	</g>	<g id="shape5-5" v:mid="5" v:groupcontext="shape" transform="translate(0.131382,-422.198)">		<title>Sheet.5</title>		<desc>GST BIN</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="416.812" cy="442.25" width="833.63" height="14.4"></v:textrect>		<rect x="0" y="435.05" width="833.625" height="14.4" class="st3"></rect>		<text x="394.02" y="445.85" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>GST BIN</text>		</g>	<g id="shape70-8" v:mid="70" v:groupcontext="shape" transform="translate(149.625,-187.2)">		<title>Sheet.70</title>		<desc>video/x-raw width=1920, height=1080, format=NV12</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="100.688" cy="429.65" width="201.38" height="39.6"></v:textrect>		<rect x="0" y="409.85" width="201.375" height="39.6" class="st3"></rect>		<text x="74.64" y="426.15" class="st5" v:langid="1033"><v:paragraph v:spline="-1.4" v:horizalign="1"></v:paragraph><v:tablist></v:tablist>video/x-raw<v:newlinechar></v:newlinechar><tspan x="12.19" dy="1.4em" class="st6">width=1920, height=1080, format=NV12</tspan></text>		</g>	<g id="shape26-12" v:mid="26" v:groupcontext="shape" transform="translate(16.3125,-189)">		<title>Sheet.26</title>		<desc>视频源</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="67.5" cy="430.7" width="135.01" height="37.5"></v:textrect>		<path d="M0 446.45 A3.00007 3.00007 -180 0 0 3 449.45 L132 449.45 A3.00007 3.00007 -180 0 0 135 446.45 L135 414.95 A3.00007					 3.00007 -180 0 0 132 411.95 L3 411.95 A3.00007 3.00007 -180 0 0 0 414.95 L0 446.45 Z" class="st7"></path>		<text x="49.5" y="434.69" class="st8" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>视频源</text>		</g>	<g id="group31-15" transform="translate(484.313,-204.758)" v:mid="31" v:groupcontext="group">		<title>Sheet.31</title>		<g id="shape32-16" v:mid="32" v:groupcontext="shape" transform="translate(0,-2.99181)">			<title>Sheet.32</title>			<path d="M0 449.45 L193.65 449.45" class="st9"></path>		</g>		<g id="shape33-19" v:mid="33" v:groupcontext="shape" transform="translate(192.763,0)">			<title>Sheet.33</title>			<path d="M0 449.45 L5.24 446.46 L0 443.47 L0 449.45 Z" class="st10"></path>		</g>	</g>	<g id="shape35-21" v:mid="35" v:groupcontext="shape" transform="translate(349.444,-189)">		<title>Sheet.35</title>		<desc>qtimlvconverter</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="67.5" cy="430.7" width="135" height="37.5"></v:textrect>		<path d="M0 446.45 A3.00007 3.00007 -180 0 0 3 449.45 L132 449.45 A3.00007 3.00007 -180 0 0 135 446.45 L135 414.95 A3.00007					 3.00007 -180 0 0 132 411.95 L3 411.95 A3.00007 3.00007 -180 0 0 0 414.95 L0 446.45 Z" class="st11"></path>		<text x="25.89" y="434.3" class="st12" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtimlvconverter</text>		</g>	<g id="shape64-24" v:mid="64" v:groupcontext="shape" transform="translate(682.312,-189)">		<title>Sheet.64</title>		<desc>ML 推理插件</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="67.5" cy="430.7" width="135" height="37.5"></v:textrect>		<path d="M-0 446.45 A3.00007 3.00007 -180 0 0 3 449.45 L132 449.45 A3.00007 3.00007 -180 0 0 135 446.45 L135 414.95 A3.00007					 3.00007 -180 0 0 132 411.95 L3 411.95 A3.00007 3.00007 -180 0 0 0 414.95 L0 446.45 Z" class="st7"></path>		<text x="33.55" y="434.69" class="st12" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>ML <tspan class="st13">推理插件</tspan></text>		</g>	<g id="group28-28" transform="translate(151.313,-204.758)" v:mid="28" v:groupcontext="group">		<title>Sheet.28</title>		<g id="shape29-29" v:mid="29" v:groupcontext="shape" transform="translate(0,-2.99181)">			<title>Sheet.29</title>			<path d="M0 449.45 L193.71 449.45" class="st9"></path>		</g>		<g id="shape30-32" v:mid="30" v:groupcontext="shape" transform="translate(192.839,0)">			<title>Sheet.30</title>			<path d="M0 449.45 L5.16 446.46 L0 443.47 L0 449.45 Z" class="st10"></path>		</g>	</g>	<g id="shape38-34" v:mid="38" v:groupcontext="shape" transform="translate(512.84,-187.2)">		<title>Sheet.38</title>		<desc>neural-network/tensors</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="70.4726" cy="429.65" width="140.95" height="39.6"></v:textrect>		<rect x="0" y="409.85" width="140.945" height="39.6" class="st3"></rect>		<text x="18.63" y="440.15" class="st5" v:langid="1033"><v:paragraph v:spline="-1.4" v:horizalign="1"></v:paragraph><v:tablist></v:tablist><v:newlinechar></v:newlinechar>neural-network/tensors</text>		</g>	<g id="shape40-37" v:mid="40" v:groupcontext="shape" transform="translate(121.854,-42.2573)">		<title>Sheet.40</title>		<desc>neural-network/tensors 具有以下共同规则 维度GstArray- 格式为张量维度值以‘,’分隔并用分...</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="295.09" cy="392.755" width="590.19" height="113.39"></v:textrect>		<path d="M0 446.45 A3.39514 3.00007 -180 0 0 3.4 449.45 L586.78 449.45 A3.39514 3.00007 -180 0 0 590.18 446.45 L590.18					 339.06 A3.39514 3.00007 -180 0 0 586.78 336.06 L3.4 336.06 A3.39514 3.00007 -180 0 0 0 339.06 L0 446.45					 Z" class="st2"></path>		<text x="7.2" y="352.66" class="st4" v:langid="1033"><v:paragraph v:indentleft="7.2" v:spline="-1.4"></v:paragraph><v:tablist></v:tablist>neural-network/tensors<tspan class="st14"> </tspan><tspan class="st15">具有以下共同规则</tspan><tspan class="st15">：<v:newlinechar></v:newlinechar></tspan><tspan x="7.2" dy="1.553em" class="st13">维度</tspan><tspan class="st13">：</tspan><tspan class="st15">（</tspan><tspan class="st14">GstArray</tspan><tspan class="st15">）</tspan><tspan class="st14">-</tspan><tspan class="st14"> </tspan><tspan class="st15">格式为张量维度值</tspan><tspan class="st15">，</tspan><tspan class="st15">以</tspan><tspan class="st14">‘,’</tspan><tspan class="st15">分隔</tspan><tspan class="st15">，</tspan><tspan class="st15">并用分隔符标记</tspan><tspan class="st15">，</tspan><tspan class="st15">以</tspan><tspan class="st14">‘&lt;’</tspan><tspan class="st15">开头</tspan><tspan class="st15">，</tspan><tspan class="st15">以</tspan><tspan class="st14">‘&gt;’ </tspan><tspan class="st15">结尾</tspan><tspan class="st15">。<v:newlinechar></v:newlinechar></tspan><tspan x="7.2" dy="1.553em" class="st14">#</tspan><tspan class="st15">示例</tspan><tspan class="st14">-</tspan><tspan class="st14">&gt;  &lt; &lt;5, 300, 300, 1&gt;</tspan><tspan class="st15">、</tspan><tspan class="st14">&lt;1, 1, 1000, 1&gt; &gt;<v:newlinechar></v:newlinechar></tspan><tspan x="7.2" dy="1.438em" class="st14">#<v:newlinechar></v:newlinechar></tspan><tspan x="7.2" dy="1.4em" class="st14">#<v:newlinechar></v:newlinechar></tspan><tspan x="7.2" dy="1.515em" class="st13">类型</tspan><tspan class="st13">：</tspan><tspan class="st15">（</tspan><tspan class="st15">字符串</tspan><tspan class="st15">）</tspan><tspan class="st14">{UINT8, INT8, UINT16, INT16, UINT32, INT32, UINT64, INT64, FLOAT32, FLOAT64} </tspan> </text>		</g>	<g id="group42-80" transform="translate(223.883,-80.4791)" v:mid="42" v:groupcontext="group">		<title>Sheet.42</title>		<g id="shape43-81" v:mid="43" v:groupcontext="shape" transform="translate(452.442,431.83) rotate(90)">			<title>Sheet.43</title>			<path d="M0 449.45 L13.32 449.45" class="st9"></path>		</g>		<g id="shape44-84" v:mid="44" v:groupcontext="shape">			<title>Sheet.44</title>			<path d="M0 444.27 L2.99 449.45 L5.98 444.27 L0 444.27 Z" class="st10"></path>		</g>	</g>	<g id="group45-86" transform="translate(313.508,-80.4791)" v:mid="45" v:groupcontext="group">		<title>Sheet.45</title>		<g id="shape46-87" v:mid="46" v:groupcontext="shape" transform="translate(452.442,431.83) rotate(90)">			<title>Sheet.46</title>			<path d="M0 449.45 L13.32 449.45" class="st9"></path>		</g>		<g id="shape47-90" v:mid="47" v:groupcontext="shape">			<title>Sheet.47</title>			<path d="M0 444.27 L2.99 449.45 L5.98 444.27 L0 444.27 Z" class="st10"></path>		</g>	</g>	<g id="shape48-92" v:mid="48" v:groupcontext="shape" transform="translate(196.875,-63.9)">		<title>Sheet.48</title>		<desc>第一张量</desc>		<v:textblock v:margins="rect(0,0,0,0)" v:verticalalign="0"></v:textblock>		<v:textrect cx="30" cy="442.25" width="60" height="14.4"></v:textrect>		<rect x="0" y="435.05" width="60" height="14.4" class="st3"></rect>		<text x="6" y="447.03" class="st16" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>第一张量</text>		</g>	<g id="shape49-95" v:mid="49" v:groupcontext="shape" transform="translate(279,-64.8)">		<title>Sheet.49</title>		<desc>第二张量</desc>		<v:textblock v:margins="rect(0,0,0,0)" v:verticalalign="0"></v:textblock>		<v:textrect cx="37.5" cy="442.7" width="75" height="13.5"></v:textrect>		<rect x="0" y="435.95" width="75" height="13.5" class="st3"></rect>		<text x="13.5" y="447.93" class="st16" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>第二张量</text>		</g>	<g id="shape78-98" v:mid="78" v:groupcontext="shape" transform="translate(120.977,-256.5)">		<title>Sheet.78</title>		<desc>GstBuffer</desc>		<v:textblock v:margins="rect(7.2,0,0,0)" v:verticalalign="0"></v:textblock>		<v:textrect cx="129.6" cy="371.625" width="259.2" height="155.651"></v:textrect>		<path d="M0 445.88 A3.7705 3.57271 -180 0 0 3.77 449.45 L255.43 449.45 A3.7705 3.57271 -180 0 0 259.2 445.88 L259.2 297.37					 A3.7705 3.57271 -180 0 0 255.43 293.8 L3.77 293.8 A3.7705 3.57271 -180 0 0 0 297.37 L0 445.88 Z" class="st7"></path>		<text x="103.48" y="311.8" class="st17" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>GstBuffer</text>		</g>	<g id="shape79-101" v:mid="79" v:groupcontext="shape" transform="translate(135.345,-365.448)">		<title>Sheet.79</title>		<desc>+ GstMemory: 图像</desc>		<v:textblock v:margins="rect(0,0,0,0)" v:verticalalign="0"></v:textblock>		<v:textrect cx="117" cy="442.25" width="234" height="14.4"></v:textrect>		<rect x="0" y="435.05" width="234" height="14.4" class="st3"></rect>		<text x="0" y="447.03" class="st17" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>+ GstMemory:<v:tabchar></v:tabchar><tspan dx="2.675em" class="st15">图像</tspan></text>		</g>	<g id="shape80-105" v:mid="80" v:groupcontext="shape" transform="translate(120.579,-357.566)">		<title>Sheet.80</title>		<path d="M0 449.45 L259.2 449.45" class="st18"></path>	</g>	<g id="shape81-108" v:mid="81" v:groupcontext="shape" transform="translate(135.345,-272.434)">		<title>Sheet.81</title>		<desc>+ GstVideoMeta: 1920x1080 NV12 width=1920 height=1080 format=...</desc>		<v:textblock v:margins="rect(0,0,0,0)" v:verticalalign="0"></v:textblock>		<v:textrect cx="117" cy="411.855" width="234" height="75.1908"></v:textrect>		<rect x="0" y="374.26" width="234" height="75.1908" class="st3"></rect>		<text x="0" y="385.06" class="st17" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>+ GstVideoMeta:<v:tabchar></v:tabchar><tspan dx="1.511em" class="st14">1920x1080 NV12<v:newlinechar></v:newlinechar><v:paragraph v:indentfirst="-14.4" v:indentleft="122.4" v:bullet="1"></v:paragraph></tspan><tspan x="108" dy="1.211em" class="st19" v:isbullet="true">·</tspan><tspan class="st19"> </tspan><tspan class="st14">width=1920<v:newlinechar></v:newlinechar></tspan><tspan x="108" dy="1.215em" class="st19" v:isbullet="true">·</tspan><tspan class="st19"> </tspan><tspan class="st14">height=1080<v:newlinechar></v:newlinechar></tspan><tspan x="108" dy="1.215em" class="st19" v:isbullet="true">·</tspan><tspan class="st19"> </tspan><tspan class="st14">format=NV12<v:newlinechar></v:newlinechar><v:paragraph></v:paragraph></tspan><tspan x="0" dy="1.204em" class="st14">...</tspan></text>		</g>	<g id="shape82-122" v:mid="82" v:groupcontext="shape" transform="translate(120.579,-383.824)">		<title>Sheet.82</title>		<path d="M0 449.45 L259.2 449.45" class="st18"></path>	</g>	<g id="group99-125" transform="translate(247.386,-222.75)" v:mid="99" v:groupcontext="group">		<title>Sheet.99</title>		<g id="shape94-126" v:mid="94" v:groupcontext="shape" transform="translate(452.442,415.03) rotate(90)">			<title>Sheet.94</title>			<path d="M0 449.45 L30.12 449.45" class="st9"></path>		</g>		<g id="shape95-129" v:mid="95" v:groupcontext="shape">			<title>Sheet.95</title>			<path d="M0 444.27 L2.99 449.45 L5.98 444.27 L0 444.27 Z" class="st10"></path>		</g>	</g>	<g id="group100-131" transform="translate(580.386,-222.75)" v:mid="100" v:groupcontext="group">		<title>Sheet.100</title>		<g id="shape101-132" v:mid="101" v:groupcontext="shape" transform="translate(452.442,415.03) rotate(90)">			<title>Sheet.101</title>			<path d="M0 449.45 L30.12 449.45" class="st9"></path>		</g>		<g id="shape102-135" v:mid="102" v:groupcontext="shape">			<title>Sheet.102</title>			<path d="M0 444.27 L2.99 449.45 L5.98 444.27 L0 444.27 Z" class="st10"></path>		</g>	</g>	<g id="group109-137" transform="translate(453.71,-256.5)" v:mid="109" v:groupcontext="group">		<title>Sheet.109</title>		<g id="shape7-138" v:mid="7" v:groupcontext="shape">			<title>Sheet.7</title>			<desc>GstBuffer</desc>			<v:textblock v:margins="rect(7.2,0,0,0)" v:verticalalign="0"></v:textblock>			<v:textrect cx="129.6" cy="371.625" width="259.21" height="155.651"></v:textrect>			<path d="M-0 446.54 A2.87066 2.90576 -180 0 0 2.87 449.45 L256.33 449.45 A2.87066 2.90576 -180 0 0 259.2 446.54 L259.2						 296.71 A2.87066 2.90576 -180 0 0 256.33 293.8 L2.87 293.8 A2.87066 2.90576 -180 0 0 -0 296.71 L0 446.54						 Z" class="st7"></path>			<text x="103.48" y="311.8" class="st17" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>GstBuffer</text>			</g>		<g id="shape9-141" v:mid="9" v:groupcontext="shape" transform="translate(9.94952,-57.914)">			<title>Sheet.9</title>			<desc>+ GstMemory: 包含单个张量 示例1x513x513x3 + GstMemory: 下一个张量等… + ...</desc>			<v:textblock v:margins="rect(0,0,0,0)" v:verticalalign="0"></v:textblock>			<v:textrect cx="124.557" cy="416.733" width="249.12" height="65.4342"></v:textrect>			<rect x="0" y="384.016" width="249.115" height="65.4342" class="st3"></rect>			<text x="-0" y="396" class="st17" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>+ GstMemory:<v:tabchar></v:tabchar><tspan dx="2.675em" class="st15">包含单个张量<v:newlinechar></v:newlinechar><v:paragraph v:indentleft="79.2"></v:paragraph><v:tabchar></v:tabchar></tspan><tspan x="108" dy="1.331em" class="st15">示例</tspan><tspan class="st15">：</tspan><tspan class="st14">1x513x513x3<v:newlinechar></v:newlinechar><v:paragraph></v:paragraph></tspan><tspan x="-0" dy="1.331em" class="st6">+ GstMemory:<v:tabchar></v:tabchar></tspan><tspan dx="2.675em" class="st15">下一个张量等</tspan><tspan class="st14">…<v:newlinechar></v:newlinechar></tspan><tspan x="-0" dy="1.233em" class="st6">+ ...</tspan></text>			</g>		<g id="shape11-152" v:mid="11" v:groupcontext="shape" transform="translate(9.94952,-7.67638)">			<title>Sheet.11</title>			<desc>+ GstVideoMeta: 描述 raw 数据单个张量的 + GstVideoMeta: 下一个张量条目的 meta</desc>			<v:textblock v:margins="rect(0,0,0,0)" v:verticalalign="0"></v:textblock>			<v:textrect cx="124.557" cy="430.666" width="249.12" height="37.5685"></v:textrect>			<rect x="0" y="411.882" width="249.115" height="37.5685" class="st3"></rect>			<text x="-0" y="423.86" class="st17" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>+ GstVideoMeta:<v:tabchar></v:tabchar><tspan dx="1.511em" class="st15">描述</tspan><tspan class="st14"> </tspan><tspan class="st14">raw </tspan><tspan class="st15">数据单个张量的<v:newlinechar></v:newlinechar></tspan><tspan x="-0" dy="1.331em" class="st6">+ GstVideoMeta:<v:tabchar></v:tabchar></tspan><tspan dx="1.511em" class="st15">下一个张量条目的</tspan><tspan class="st14"> </tspan><tspan class="st14">meta</tspan></text>			</g>		<g id="shape14-163" v:mid="14" v:groupcontext="shape" transform="translate(0.135741,-127.324)">			<title>Sheet.14</title>			<path d="M0 449.45 L259.2 449.45" class="st18"></path>		</g>		<g id="shape15-166" v:mid="15" v:groupcontext="shape" transform="translate(0.135741,-53.5171)">			<title>Sheet.15</title>			<path d="M0 449.45 L259.2 449.45" class="st18"></path>		</g>	</g>	<g id="group110-169" transform="translate(707.188,-14.7814)" v:mid="110" v:groupcontext="group">		<title>Sheet.110</title>		<g id="shape19-170" v:mid="19" v:groupcontext="shape" transform="translate(15.1883,0)">			<title>Sheet.19</title>			<desc>Qualcomm</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="26.8036" cy="443.15" width="53.61" height="12.6"></v:textrect>			<rect x="0" y="436.85" width="53.6071" height="12.6" class="st3"></rect>			<text x="0" y="446.3" class="st20" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>Qualcomm  </text>			</g>		<g id="shape20-173" v:mid="20" v:groupcontext="shape" transform="translate(1.26898E-13,-0.218607)">			<title>Sheet.20</title>			<path d="M0 447.95 A1.50003 1.50003 -180 0 0 1.5 449.45 L10.5 449.45 A1.50003 1.50003 -180 0 0 12 447.95 L12 438.95						 A1.50003 1.50003 -180 0 0 10.5 437.45 L1.5 437.45 A1.50003 1.50003 -180 0 0 0 438.95 L0 447.95 Z" class="st11"></path>		</g>		<g id="shape22-175" v:mid="22" v:groupcontext="shape" transform="translate(89.1246,0)">			<title>Sheet.22</title>			<desc>开源</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="10.5" cy="443.15" width="21.01" height="12.6"></v:textrect>			<rect x="0" y="436.85" width="21" height="12.6" class="st3"></rect>			<text x="0" y="446.65" class="st21" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>开源</text>			</g>		<g id="shape23-178" v:mid="23" v:groupcontext="shape" transform="translate(73.9363,-0.218607)">			<title>Sheet.23</title>			<path d="M0 447.95 A1.50003 1.50003 -180 0 0 1.5 449.45 L10.5 449.45 A1.50003 1.50003 -180 0 0 12 447.95 L12 438.95						 A1.50003 1.50003 -180 0 0 10.5 437.45 L1.5 437.45 A1.50003 1.50003 -180 0 0 0 438.95 L0 447.95 Z" class="st7"></path>		</g>	</g></g>
</svg>

## 继承链

[GObject](https://docs.gtk.org/gobject/) → [GstObject](https://gstreamer.freedesktop.org/documentation/gstreamer/gstobject.html?gi-language=c) → [GstElement](https://gstreamer.freedesktop.org/documentation/gstreamer/gstelement.html?gi-language=c) → [GstBaseTransform](https://gstreamer.freedesktop.org/documentation/base/gstbasetransform.html?gi-language=c) → GstMLVideoConverter

下表提供了有关 qtimlvconverter 的端口模板和元素属性的信息。有关用例信息，请参见 [LiteRT 用例](https://docs.qualcomm.com/doc/80-70022-50SC/topic/tensorflow-lite-use-cases.html)和 [Qualcomm Neural Processing SDK 用例](https://docs.qualcomm.com/doc/80-70022-50SC/topic/qualcomm-neural-processing-sdk-use-cases.html)。

## 端口配置

| 端口名称 | 功能 | 功能 | 功能 |
| --- | --- | --- | --- |
| SINK 模板：'sink'<br><br><br>                                <br>*可用性：* 始终可用<br><br><br>                                <br>*方向：* 接收 | video/x-raw | format： | { (string)RGBA, (string)BGRA, (string)ABGR, (string)ARGB, (string)RGBx, (string)BGRx, (string)xRGB, (string)xBGR, (string)BGR, (string)RGB, (string)GRAY8, (string)NV12, (string)NV21, (string)YUY2, (string)UYVY } |
| SINK 模板：'sink'<br><br><br>                                <br>*可用性：* 始终可用<br><br><br>                                <br>*方向：* 接收 | video/x-raw (memory:GBM) | format： | { (string)RGBA, (string)BGRA, (string)ABGR, (string)ARGB, (string)RGBx, (string)BGRx, (string)xRGB, (string)xBGR, (string)BGR, (string)RGB, (string)GRAY8, (string)NV12, (string)NV21, (string)YUY2, (string)UYVY } |
| SRC 模板：'src'<br><br><br>                                <br>*可用性：* 始终可用<br><br><br>                                <br>*方向：* 发送 | neural-network/tensors | type： | { (string)UINT8, (string)INT32, (string)FLOAT16, (string)FLOAT32 } |
|  |  |  |  |

## 元素配置

Table : qtimlvconverter 的元素属性

| 属性 | 说明 |
| --- | --- |
| name | 对象名称<ul class="ul" id="qtimlvconverter__ul_rqy_kh4_myb"><br>                                    <li class="li">标志：可读、可写</li><br><br>                                    <li class="li">字符串。默认："mlvideoconverter0"</li><br><br>                                </ul> |
| parent | 对象的父级<ul class="ul" id="qtimlvconverter__ul_sqy_kh4_myb"><br>                                    <li class="li">标志：可读、可写</li><br><br>                                    <li class="li">"GstObject" 类型的对象</li><br><br>                                </ul> |
| qos | 处理服务质量事件。<ul class="ul" id="qtimlvconverter__ul_tqy_kh4_myb"><br>                                    <li class="li">标志：可读、可写</li><br><br>                                    <li class="li">Boolean。默认值：false</li><br><br>                                </ul> |
| subpixel-layout | 输出张量中图像像素的排列。<ul class="ul" id="qtimlvconverter__ul_uqy_kh4_myb"><br>                                    <li class="li">标志：可读、可写</li><br><br>                                    <li class="li"><br>                                        <p class="p">枚举 “GstMLVideoPixelLayout” 默认：0，“regular”</p><ul class="ul" id="qtimlvconverter__ul_c1t_lh4_myb"><br>                                            <li class="li"> (0)：regular - 常规子像素布局。例如，RGB、RGBA 或 RGBx。</li><br><br>                                            <li class="li"> (1)：reverse – 反向子像素布局。例如，BGR、BGRA 或 BGRx。</li><br><br>                                        </ul><br><br>                                    </li><br><br>                                </ul> |
| mean | 通道均值 FLOAT 张量的减法值 ('&lt;R, G, B&gt;', '&lt;R, G, B, A&gt;', '&lt;G&gt;')<ul class="ul" id="qtimlvconverter__ul_vqy_kh4_myb"><br>                                    <li class="li">标志：可读、可写</li><br><br>                                    <li class="li">"gdouble" 类型 GValue 的 GstValueArray</li><br><br>                                </ul> |
| sigma | FLOAT 张量的通道除数值（'&lt;R, G, B&gt;', '&lt;R, G, B, A&gt;', '&lt;G&gt;'）<ul class="ul" id="qtimlvconverter__ul_wqy_kh4_myb"><br>                                    <li class="li">标志：可读、可写</li><br><br>                                    <li class="li">"gdouble" 类型 GValue 的 GstValueArray</li><br><br>                                </ul> |
| engine | 选择 Qualcomm® Computer Vision SDK 或 GLES 作为 qtimlvconverter 的后端<ul class="ul" id="qtimlvconverter__ul_edm_ct3_tzb"><br>                                    <li class="li">值可以是 "fcv" 或 "gles"</li><br><br>                                    <li class="li"> 对于非 GPU 设备，默认值为 fcv。对于 GPU 设备，默认值为 gles</li><br><br>                                </ul><br><br>Note: 目前不支持 Qualcomm Computer Vision SDK（fcv）引擎。 |

**Parent Topic:** [配置 ML 插件](https://docs.qualcomm.com/doc/80-70022-50SC/topic/inferencing-plugins.html)

Last Published: Nov 05, 2025

[Previous Topic
配置 ML 插件](https://docs.qualcomm.com/bundle/publicresource/80-70022-50SC/topics/inferencing-plugins.md) [Next Topic
qtimlaconverter](https://docs.qualcomm.com/bundle/publicresource/80-70022-50SC/topics/qtimlaconverter.md)