# 解码 JPEG 图像

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

**gst-jpg-decode-example** 应用程序可以解码 JPEG 图像，并在屏幕上查看解码后的图像。

下图展示了 gst-jpg-decode-example 的 pipeline。有关 pipeline 流中使用的插件的信息，请参见 [Pipeline 流](https://docs.qualcomm.com/doc/80-70022-50SC/topic/gst-jpg-decode-example.html#gst-jpg-decode-example__section_pmp_wyv_42c)。

Figure : gst-jpg-decode-example pipeline
            
            <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by Microsoft Visio, SVG Export gst-jpg-image-decode.svg Layer_1 -->
<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="8.95833in" height="1.25in" viewbox="0 0 645 90" xml:space="preserve" color-interpolation-filters="sRGB" class="st9"><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 { stroke: #000000; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st4 { fill: #000000; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.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 { fill: none; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st8 { fill: #000000; font-family: SimHei; font-size: 0.874992em }
.svg-1 .st9 { 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_1</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.37496,-0.374817)">		<title>Sheet.2</title>		<path d="M0 84.37 A5.62513 5.62513 -180 0 0 5.63 90 L638.63 90 A5.62513 5.62513 -180 0 0 644.25 84.37 L644.25 6.37 A5.62513					 5.62513 -180 0 0 638.63 0.75 L5.62 0.75 A5.62513 5.62513 -180 0 0 -0 6.37 L0 84.37 Z" class="st1"></path>	</g>	<g id="shape3-3" v:mid="3" v:groupcontext="shape" transform="translate(5.72205E-06,0)">		<title>Sheet.3</title>		<path d="M639 0.75 C641.89 0.75 644.25 3.11 644.25 6 L644.25 84 C644.25 86.89 641.89 89.25 639 89.25 L6 89.25 C3.11 89.25					 0.75 86.89 0.75 84 L0.75 6 C0.75 3.11 3.11 0.75 6 0.75 L639 0.75 ZM639 0 L6 0 C2.69 0 0 2.69 0 6 L0 84 C0					 87.31 2.69 90 6 90 L639 90 C642.31 90 645 87.31 645 84 L645 6 C645 2.69 642.31 0 639 0 Z" class="st2"></path>	</g>	<g id="group6-5" transform="translate(207.555,-55.154)" v:mid="6" v:groupcontext="group">		<title>Sheet.6</title>		<g id="shape7-6" v:mid="7" v:groupcontext="shape" transform="translate(0,-2.61784)">			<title>Sheet.7</title>			<path d="M0 90 L12.27 90" class="st3"></path>		</g>		<g id="shape8-9" v:mid="8" v:groupcontext="shape" transform="translate(11.5046,9.9476E-14)">			<title>Sheet.8</title>			<path d="M0 90 L4.53 87.38 L0 84.76 L0 90 Z" class="st4"></path>		</g>	</g>	<g id="group9-11" transform="translate(102.636,-55.154)" v:mid="9" v:groupcontext="group">		<title>Sheet.9</title>		<g id="shape10-12" v:mid="10" v:groupcontext="shape" transform="translate(0,-2.61784)">			<title>Sheet.10</title>			<path d="M0 90 L12.27 90" class="st3"></path>		</g>		<g id="shape11-15" v:mid="11" v:groupcontext="shape" transform="translate(11.5046,9.9476E-14)">			<title>Sheet.11</title>			<path d="M0 90 L4.53 87.38 L0 84.76 L0 90 Z" class="st4"></path>		</g>	</g>	<g id="group12-17" transform="translate(313.698,-55.154)" v:mid="12" v:groupcontext="group">		<title>Sheet.12</title>		<g id="shape13-18" v:mid="13" v:groupcontext="shape" transform="translate(0,-2.61784)">			<title>Sheet.13</title>			<path d="M0 90 L12.27 90" class="st3"></path>		</g>		<g id="shape14-21" v:mid="14" v:groupcontext="shape" transform="translate(11.5046,9.9476E-14)">			<title>Sheet.14</title>			<path d="M0 90 L4.53 87.38 L0 84.76 L0 90 Z" class="st4"></path>		</g>	</g>	<g id="shape15-23" v:mid="15" v:groupcontext="shape" transform="translate(330.486,-38.297)">		<title>Sheet.15</title>		<desc>jpegdec</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="44.6776" cy="70.5251" width="89.36" height="38.9497"></v:textrect>		<path d="M0 87 A3.00007 3.00007 -180 0 0 3 90 L86.36 90 A3.00007 3.00007 -180 0 0 89.36 87 L89.36 54.05 A3.00007 3.00007					 -180 0 0 86.36 51.05 L3 51.05 A3.00007 3.00007 -180 0 0 0 54.05 L0 87 Z" class="st5"></path>		<text x="23.63" y="74.13" class="st6" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>jpegdec</text>		</g>	<g id="shape17-26" v:mid="17" v:groupcontext="shape" transform="translate(224.343,-38.297)">		<title>Sheet.17</title>		<desc>capsfilter</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="44.6776" cy="70.5251" width="89.36" height="38.9497"></v:textrect>		<path d="M0 87 A3.00007 3.00007 -180 0 0 3 90 L86.36 90 A3.00007 3.00007 -180 0 0 89.36 87 L89.36 54.05 A3.00007 3.00007					 -180 0 0 86.36 51.05 L3 51.05 A3.00007 3.00007 -180 0 0 0 54.05 L0 87 Z" class="st5"></path>		<text x="19.65" y="74.13" class="st6" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>capsfilter</text>		</g>	<g id="group19-29" transform="translate(419.842,-55.154)" v:mid="19" v:groupcontext="group">		<title>Sheet.19</title>		<g id="shape20-30" v:mid="20" v:groupcontext="shape" transform="translate(0,-2.61784)">			<title>Sheet.20</title>			<path d="M0 90 L12.27 90" class="st3"></path>		</g>		<g id="shape21-33" v:mid="21" v:groupcontext="shape" transform="translate(11.5047,9.9476E-14)">			<title>Sheet.21</title>			<path d="M0 90 L4.53 87.38 L0 84.76 L0 90 Z" class="st4"></path>		</g>	</g>	<g id="group22-35" transform="translate(525.983,-55.154)" v:mid="22" v:groupcontext="group">		<title>Sheet.22</title>		<g id="shape23-36" v:mid="23" v:groupcontext="shape" transform="translate(0,-2.61784)">			<title>Sheet.23</title>			<path d="M0 90 L12.27 90" class="st3"></path>		</g>		<g id="shape24-39" v:mid="24" v:groupcontext="shape" transform="translate(11.5046,9.9476E-14)">			<title>Sheet.24</title>			<path d="M0 90 L4.53 87.38 L0 84.76 L0 90 Z" class="st4"></path>		</g>	</g>	<g id="shape25-41" v:mid="25" v:groupcontext="shape" transform="translate(542.771,-38.297)">		<title>Sheet.25</title>		<desc>Waylandsink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="44.6776" cy="70.5251" width="89.36" height="38.9497"></v:textrect>		<path d="M0 87 A3.00007 3.00007 -180 0 0 3 90 L86.36 90 A3.00007 3.00007 -180 0 0 89.36 87 L89.36 54.05 A3.00007 3.00007					 -180 0 0 86.36 51.05 L3 51.05 A3.00007 3.00007 -180 0 0 0 54.05 L0 87 Z" class="st5"></path>		<text x="10.94" y="74.13" class="st6" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Waylandsink</text>		</g>	<g id="shape27-44" v:mid="27" v:groupcontext="shape" transform="translate(436.63,-38.297)">		<title>Sheet.27</title>		<desc>videoconvert</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="44.6776" cy="70.5251" width="89.36" height="38.9497"></v:textrect>		<path d="M0 87 A3.00007 3.00007 -180 0 0 3 90 L86.36 90 A3.00007 3.00007 -180 0 0 89.36 87 L89.36 54.05 A3.00007 3.00007					 -180 0 0 86.36 51.05 L3 51.05 A3.00007 3.00007 -180 0 0 0 54.05 L0 87 Z" class="st5"></path>		<text x="10.38" y="74.13" class="st6" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>videoconvert</text>		</g>	<g id="shape29-47" v:mid="29" v:groupcontext="shape" transform="translate(118.437,-38.297)">		<title>Sheet.29</title>		<desc>multifilesrc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="44.6776" cy="70.5251" width="89.36" height="38.9497"></v:textrect>		<path d="M0 87 A3.00007 3.00007 -180 0 0 3 90 L86.36 90 A3.00007 3.00007 -180 0 0 89.36 87 L89.36 54.05 A3.00007 3.00007					 -180 0 0 86.36 51.05 L3 51.05 A3.00007 3.00007 -180 0 0 -0 54.05 L0 87 Z" class="st5"></path>		<text x="14.8" y="74.13" class="st6" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>multifilesrc</text>		</g>	<g id="shape31-50" v:mid="31" v:groupcontext="shape" transform="translate(12.8739,-39.0218)">		<title>Sheet.31</title>		<desc>JPG</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="45" cy="71.25" width="90.01" height="37.5"></v:textrect>		<path d="M0 87 A3.00007 3.00007 -180 0 0 3 90 L87 90 A3.00007 3.00007 -180 0 0 90 87 L90 55.5 A3.00007 3.00007 -180 0					 0 87 52.5 L3 52.5 A3.00007 3.00007 -180 0 0 -0 55.5 L0 87 Z" class="st5"></path>		<text x="33.82" y="74.85" class="st6" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>JPG</text>		</g>	<g id="group36-53" transform="translate(595.938,-12.5347)" v:mid="36" v:groupcontext="group">		<title>Sheet.36</title>		<g id="shape34-54" v:mid="34" v:groupcontext="shape" transform="translate(15.1883,0)">			<title>Sheet.34</title>			<desc>开源</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="10.5" cy="83.7" width="21" height="12.6"></v:textrect>			<rect x="0" y="77.4" width="21" height="12.6" class="st7"></rect>			<text x="0" y="87.19" class="st8" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>开源</text>			</g>		<g id="shape35-57" v:mid="35" v:groupcontext="shape" transform="translate(6.29496E-14,-0.218623)">			<title>Sheet.35</title>			<path d="M0 88.5 A1.50003 1.50003 -180 0 0 1.5 90 L10.5 90 A1.50003 1.50003 -180 0 0 12 88.5 L12 79.5 A1.50003 1.50003						 -180 0 0 10.5 78 L1.5 78 A1.50003 1.50003 -180 0 0 0 79.5 L0 88.5 Z" class="st5"></path>		</g>	</g></g>
</svg>

## 运行应用程序

1. 确保您已完成[前提条件](https://docs.qualcomm.com/doc/80-70022-50SC/topic/mm_sample_apps_prerequisites.html)。
2. 在目标设备上输入至少一个 `filename_%d.jpg`。
3. 在目标设备的终端中，运行用例。为应用程序指定参数，如宽度和高度等。

        gst-jpg-decode-example -w 1920 -h 1080 -i /etc/media/filename_%d.jpgCopy to clipboard
4. 要停止用例，请使用 CTRL +
                    C。
5. 在目标设备的终端中，在 SSH shell 中运行以下命令以显示可用的帮助选项：

        gst-jpg-decode-example --helpCopy to clipboard

## 预期输出

解码后的图像显示在屏幕上以供预览。

## Pipeline 流

下表列出了用于对 JPEG 图像执行解码 pipeline 的插件：| 插件 | 说明 |
| --- | --- |
| multifilesrc | 从按顺序命名的文件中读取视频数据。 |
| capsfilter | 对视频数据强制实施约束。 |
| jpegdec | 解码 JPEG 视频流。 |
| videoconvert | 将视频帧从一种格式转换为另一种格式。 |
| [Waylandsink](https://docs.qualcomm.com/doc/80-70022-50SC/topic/waylandsink.html) | 在 Wayland 显示器上显示视频流。 |

**Parent Topic:** [运行摄像头的示例应用程序](https://docs.qualcomm.com/doc/80-70022-50SC/topic/camera-sample-applications.html)

Last Published: Nov 05, 2025

[Previous Topic
宽动态范围和电子图像稳定](https://docs.qualcomm.com/bundle/publicresource/80-70022-50SC/topics/dynamic-range-and-image-stabilization.md) [Next Topic
运行视频和音频的示例应用程序](https://docs.qualcomm.com/bundle/publicresource/80-70022-50SC/topics/audio-sample-applications.md)