# 摄像头

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

Qualcomm IM SDK 摄像头插件 camsrc 充当 Qualcomm 摄像头服务的客户端。摄像头用例显示了来自实时源的 1080p YUV 流的执行和显示。

有关摄像头插件的更多信息，请参见[摄像头架构](https://docs.qualcomm.com/doc/80-70022-50SC/topic/architecture.html#camera)。

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

### 来自实时源的单个 1080p YUV 流

在目标设备上运行用例：

    gst-launch-1.0 -e qtiqmmfsrc name=camsrc video_1::type=preview ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! waylandsink fullscreen=true sync=falseCopy to clipboard

显示来自摄像头流的内容。

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

以下 pipeline 展示了从摄像头获取并发送到显示器的单个 1080p 流。

<?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 single_yuv_from_source.svg single_yuv_from_source -->
<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="4.01042in" height="1.15322in" viewbox="0 0 288.75 83.0318" 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 { 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 { stroke: #000000; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st6 { fill: #000000; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.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>single_yuv_from_source</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.374886)">		<title>Sheet.2</title>		<path d="M0 77.41 A5.62513 5.62513 -180 0 0 5.63 83.03 L282.38 83.03 A5.62513 5.62513 -180 0 0 288 77.41 L288 6.37 A5.62513					 5.62513 -180 0 0 282.38 0.75 L5.62 0.75 A5.62513 5.62513 -180 0 0 0 6.37 L0 77.41 Z" class="st1"></path>	</g>	<g id="shape3-3" v:mid="3" v:groupcontext="shape">		<title>Sheet.3</title>		<path d="M282.75 0.75 C285.64 0.75 288 3.11 288 6 L288 77.03 C288 79.93 285.64 82.28 282.75 82.28 L6 82.28 C3.11 82.28					 0.75 79.93 0.75 77.03 L0.75 6 C0.75 3.11 3.11 0.75 6 0.75 L282.75 0.75 ZM282.75 0 L6 0 C2.69 0 0 2.69 0					 6 L0 77.03 C0 80.35 2.69 83.03 6 83.03 L282.75 83.03 C286.06 83.03 288.75 80.35 288.75 77.03 L288.75 6 C288.75					 2.69 286.06 0 282.75 0 Z" class="st2"></path>	</g>	<g id="shape7-5" v:mid="7" v:groupcontext="shape" transform="translate(15,-30.5318)">		<title>Sheet.7</title>		<desc>camsrc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="64.2818" width="120.01" height="37.5"></v:textrect>		<path d="M-0 80.03 A3.00007 3.00007 -180 0 0 3 83.03 L117 83.03 A3.00007 3.00007 -180 0 0 120 80.03 L120 48.53 A3.00007					 3.00007 -180 0 0 117 45.53 L3 45.53 A3.00007 3.00007 -180 0 0 0 48.53 L0 80.03 Z" class="st3"></path>		<text x="40.07" y="67.88" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>camsrc</text>		</g>	<g id="group9-8" transform="translate(135,-46.664)" v:mid="9" v:groupcontext="group">		<title>Sheet.9</title>		<g id="shape10-9" v:mid="10" v:groupcontext="shape" transform="translate(0,-2.61782)">			<title>Sheet.10</title>			<path d="M0 83.03 L14.98 83.03" class="st5"></path>		</g>		<g id="shape11-12" v:mid="11" v:groupcontext="shape" transform="translate(14.2165,5.68434E-14)">			<title>Sheet.11</title>			<path d="M0 83.03 L4.53 80.41 L0 77.8 L0 83.03 Z" class="st6"></path>		</g>	</g>	<g id="shape13-14" v:mid="13" v:groupcontext="shape" transform="translate(153.75,-30.5318)">		<title>Sheet.13</title>		<desc>Waylandsink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="64.2818" width="120.01" height="37.5"></v:textrect>		<path d="M-0 80.03 A3.00007 3.00007 -180 0 0 3 83.03 L117 83.03 A3.00007 3.00007 -180 0 0 120 80.03 L120 48.53 A3.00007					 3.00007 -180 0 0 117 45.53 L3 45.53 A3.00007 3.00007 -180 0 0 0 48.53 L0 80.03 Z" class="st3"></path>		<text x="26.26" y="67.88" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Waylandsink</text>		</g>	<g id="group20-17" transform="translate(237.562,-9.31323)" v:mid="20" v:groupcontext="group">		<title>Sheet.20</title>		<g id="shape16-18" v:mid="16" v:groupcontext="shape" transform="translate(15.1883,0)">			<title>Sheet.16</title>			<desc>开源</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="10.5" cy="76.7318" width="21.01" height="12.6"></v:textrect>			<rect x="0" y="70.4318" width="21" height="12.6" class="st7"></rect>			<text x="0" y="80.23" class="st8" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>开源</text>			</g>		<g id="shape17-21" v:mid="17" v:groupcontext="shape" transform="translate(1.4988E-14,-0.218607)">			<title>Sheet.17</title>			<path d="M0 81.53 A1.50003 1.50003 -180 0 0 1.5 83.03 L10.5 83.03 A1.50003 1.50003 -180 0 0 12 81.53 L12 72.53 A1.50003						 1.50003 -180 0 0 10.5 71.03 L1.5 71.03 A1.50003 1.50003 -180 0 0 0 72.53 L0 81.53 Z" class="st3"></path>		</g>	</g></g>
</svg>

### 来自实时源的三路 720p YUV 视频流

在目标设备上运行用例：

    gst-launch-1.0 -e qtivcomposer name=mixer sink_0::position="<0, 0>" sink_0::dimensions="<480, 270>" sink_1::position="<480, 0>" sink_1::dimensions="<480, 270>" sink_2::position="<960, 0>" sink_2::dimensions="<480, 270>" mixer. ! queue ! waylandsink fullscreen=true qtiqmmfsrc name=camsrc camera=0 video_0::type=preview video_1::type=video ! video/x-raw,format=NV12_Q08C,width=1280,height=720,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! queue ! mixer. camsrc. ! video/x-raw,format=NV12,width=1280,height=720,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! queue ! mixer. camsrc. ! video/x-raw,format=NV12,width=1280,height=720,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! queue ! mixer.Copy to clipboard

显示来自摄像头流的内容。

要停止用例，请按 CTRL + C。
Note: 使用 GMSL 摄像头时，已观察到在使用 CTRL
                            + C 时，显示器无法正常工作，且用例不会停止运行。

以下 pipeline 展示了从摄像头中获取三个 720p 流并发送到显示器，每个流显示在屏幕上的不同位置。

<?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 three_yuv_from_source.svg Layer_2 -->
<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="4.01042in" height="2.3685in" viewbox="0 0 288.75 170.532" xml:space="preserve" color-interpolation-filters="sRGB" class="st10"><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: none }
.svg-2 .st4 { stroke: #000000; stroke-linecap: butt; stroke-width: 0.75 }
.svg-2 .st5 { fill: #000000; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-2 .st6 { fill: #007884; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-2 .st7 { fill: #ffffff; font-family: Roboto; font-size: 1.00001em }
.svg-2 .st8 { fill: none; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-2 .st9 { fill: #000000; font-family: SimHei; font-size: 0.874992em }
.svg-2 .st10 { 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_2</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 164.91 A5.62513 5.62513 -180 0 0 5.63 170.53 L282.38 170.53 A5.62513 5.62513 -180 0 0 288 164.91 L288 6.37					 A5.62513 5.62513 -180 0 0 282.38 0.75 L5.62 0.75 A5.62513 5.62513 -180 0 0 -0 6.37 L0 164.91 Z" class="st1"></path>	</g>	<g id="shape3-3" v:mid="3" v:groupcontext="shape">		<title>Sheet.3</title>		<path d="M282.75 0.75 C285.64 0.75 288 3.11 288 6 L288 164.53 C288 167.43 285.64 169.78 282.75 169.78 L6 169.78 C3.11					 169.78 0.75 167.43 0.75 164.53 L0.75 6 C0.75 3.11 3.11 0.75 6 0.75 L282.75 0.75 ZM282.75 0 L6 0 C2.69 0					 0 2.69 0 6 L0 164.53 C0 167.85 2.69 170.53 6 170.53 L282.75 170.53 C286.06 170.53 288.75 167.85 288.75 164.53					 L288.75 6 C288.75 2.69 286.06 0 282.75 0 Z" class="st2"></path>	</g>	<g id="shape5-5" v:mid="5" v:groupcontext="shape" transform="translate(142.903,-44.1519)">		<title>Sheet.5</title>		<path d="M14.04 70.4 L0 70.4 L0 170.53 L14.04 170.53 L14.04 70.4 Z" class="st3"></path>		<path d="M14.04 70.4 L0 70.4 L0 170.53 L14.04 170.53" class="st4"></path>	</g>	<g id="shape6-8" v:mid="6" v:groupcontext="shape" transform="translate(156.069,-141.29)">		<title>Sheet.6</title>		<path d="M0 164.55 L5.18 167.54 L0 170.53 L0 164.55 Z" class="st5"></path>	</g>	<g id="shape7-10" v:mid="7" v:groupcontext="shape" transform="translate(156.069,-41.1601)">		<title>Sheet.7</title>		<path d="M0 170.53 L5.18 167.54 L0 164.55 L0 170.53 Z" class="st5"></path>	</g>	<g id="shape9-12" v:mid="9" v:groupcontext="shape" transform="translate(7.5,-76.7818)">		<title>Sheet.9</title>		<desc>camsrc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="151.782" width="120.01" height="37.5"></v:textrect>		<path d="M0 167.53 A3.00007 3.00007 -180 0 0 3 170.53 L117 170.53 A3.00007 3.00007 -180 0 0 120 167.53 L120 136.03 A3.00007					 3.00007 -180 0 0 117 133.03 L3 133.03 A3.00007 3.00007 -180 0 0 0 136.03 L0 167.53 Z" class="st6"></path>		<text x="40.07" y="155.38" class="st7" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>camsrc</text>		</g>	<g id="shape12-15" v:mid="12" v:groupcontext="shape" transform="translate(127.5,-95.5318)">		<title>Sheet.12</title>		<path d="M0 170.53 L29.98 170.53" class="st4"></path>	</g>	<g id="shape13-18" v:mid="13" v:groupcontext="shape" transform="translate(156.716,-92.914)">		<title>Sheet.13</title>		<path d="M0 170.53 L4.53 167.91 L0 165.3 L0 170.53 Z" class="st5"></path>	</g>	<g id="shape16-20" v:mid="16" v:groupcontext="shape" transform="translate(161.25,-28.0318)">		<title>Sheet.16</title>		<desc>Waylandsink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="151.782" width="120" height="37.5"></v:textrect>		<path d="M0 167.53 A3.00007 3.00007 -180 0 0 3 170.53 L117 170.53 A3.00007 3.00007 -180 0 0 120 167.53 L120 136.03 A3.00007					 3.00007 -180 0 0 117 133.03 L3 133.03 A3.00007 3.00007 -180 0 0 -0 136.03 L0 167.53 Z" class="st6"></path>		<text x="26.26" y="155.38" class="st7" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Waylandsink</text>		</g>	<g id="shape19-23" v:mid="19" v:groupcontext="shape" transform="translate(161.25,-76.7818)">		<title>Sheet.19</title>		<desc>Waylandsink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="151.782" width="120" height="37.5"></v:textrect>		<path d="M0 167.53 A3.00007 3.00007 -180 0 0 3 170.53 L117 170.53 A3.00007 3.00007 -180 0 0 120 167.53 L120 136.03 A3.00007					 3.00007 -180 0 0 117 133.03 L3 133.03 A3.00007 3.00007 -180 0 0 -0 136.03 L0 167.53 Z" class="st6"></path>		<text x="26.26" y="155.38" class="st7" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Waylandsink</text>		</g>	<g id="shape22-26" v:mid="22" v:groupcontext="shape" transform="translate(161.25,-125.532)">		<title>Sheet.22</title>		<desc>Waylandsink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="151.782" width="120" height="37.5"></v:textrect>		<path d="M0 167.53 A3.00007 3.00007 -180 0 0 3 170.53 L117 170.53 A3.00007 3.00007 -180 0 0 120 167.53 L120 136.03 A3.00007					 3.00007 -180 0 0 117 133.03 L3 133.03 A3.00007 3.00007 -180 0 0 -0 136.03 L0 167.53 Z" class="st6"></path>		<text x="26.26" y="155.38" class="st7" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Waylandsink</text>		</g>	<g id="group27-29" transform="translate(245.062,-7.53162)" v:mid="27" v:groupcontext="group">		<title>Sheet.27</title>		<g id="shape25-30" v:mid="25" v:groupcontext="shape" transform="translate(15.1883,0)">			<title>Sheet.25</title>			<desc>开源</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="10.5" cy="164.232" width="21.01" height="12.6"></v:textrect>			<rect x="0" y="157.932" width="21" height="12.6" class="st8"></rect>			<text x="0" y="167.73" class="st9" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>开源</text>			</g>		<g id="shape26-33" v:mid="26" v:groupcontext="shape" transform="translate(-3.09752E-14,-0.218611)">			<title>Sheet.26</title>			<path d="M0 169.03 A1.50003 1.50003 -180 0 0 1.5 170.53 L10.5 170.53 A1.50003 1.50003 -180 0 0 12 169.03 L12 160.03						 A1.50003 1.50003 -180 0 0 10.5 158.53 L1.5 158.53 A1.50003 1.50003 -180 0 0 0 160.03 L0 169.03 Z" class="st6"></path>		</g>	</g></g>
</svg>

### 从摄像头请求具有不同 FPS 的多个流

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

- 采集请求模式为 30 fps/15 fps 的两个流：

        gst-launch-1.0 -e --gst-debug=fpsdisplaysink:6 qtiqmmfsrc name=qmmf frc-mode=capture-request video_0::type=video video_1::type=preview ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! fpsdisplaysink name=disp1 signal-fps-measurements=true text-overlay=false video-sink="fakesink" qmmf. ! video/x-raw,format=NV12,width=1920,height=1080,framerate=15/1 ! fpsdisplaysink name=disp2 signal-fps-measurements=true text-overlay=false video-sink="fakesink"Copy to clipboard
- 采集请求模式为 17 fps/10 fps 的两个流：

        gst-launch-1.0 -e --gst-debug=fpsdisplaysink:6 qtiqmmfsrc name=qmmf frc-mode=capture-request video_0::type=video video_1::type=preview qmmf.video_0 ! video/x-raw,format=NV12,width=1920,height=1080,framerate=17/1 ! fpsdisplaysink name=disp1 signal-fps-measurements=true text-overlay=false video-sink="fakesink" qmmf.video_1 ! video/x-raw,format=NV12,width=1920,height=1080,framerate=10/1 ! fpsdisplaysink name=disp2 signal-fps-measurements=true text-overlay=false video-sink="fakesink"Copy to clipboard

Note: 当前版本不支持此用例。
- 采集请求模式为 5 fps/25 fps 的两个流：
首先处理较小的帧速率，然后摄像头在第二个流上更新帧速率。

        gst-launch-1.0 -e --gst-debug=fpsdisplaysink:6 qtiqmmfsrc name=qmmf frc-mode=capture-request video_0::type=video video_1::type=preview qmmf.video_0 ! video/x-raw,format=NV12,width=1920,height=1080,framerate=5/1 ! fpsdisplaysink name=disp1 signal-fps-measurements=true text-overlay=false video-sink="fakesink" qmmf.video_1 ! video/x-raw,format=NV12,width=1920,height=1080,framerate=25/1 ! fpsdisplaysink name=disp2 signal-fps-measurements=true text-overlay=false video-sink="fakesink"Copy to clipboard

### 设置传感器模式

在camsrc插件中设置传感器模式：

    export GST_PLUGIN_PATH=/usr/lib/gstreamer-1.0 && gst-launch-1.0 qtiqmmfsrc camera=0 name=camsrc sensor-mode=0 ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! multifilesink enable-last-sample=false location="/opt/frame%d.yuv" max-files=5Copy to clipboard

关于 `sensor-mode=<option>`，添加适合传感器模式的数字。

例如，对于 imx766\_preview\_1080p30fps\_streaming\_sensor\_mode\_1用例，运行以下命令将传感器模式设置为 0：

    export GST_PLUGIN_PATH=/usr/lib/gstreamer-1.0 && gst-launch-1.0 qtiqmmfsrc camera=0 name=camsrc sensor-mode=0 ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! multifilesink enable-last-sample=false location="/opt/frame%d.yuv" max-files=5Copy to clipboard

## 使用套接字的单个摄像头流

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

该用例展示了如何将摄像头流存储在套接字中。然后，将套接字中的摄像头流编码为 AVC 格式并存储在文件中。

在目标设备上运行用例：
- 在控制台 1 中：

        gst-launch-1.0 -e qtisocketsrc socket=/tmp/input.sock ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! h264parse ! mp4mux ! queue ! filesink location=/opt/video.mp4
        Copy to clipboard
- 在控制台 2 中：

        gst-launch-1.0 -e qtiqmmfsrc name=camsrc ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! qtisocketsink socket=/tmp/input.sockCopy to clipboard

下图展示了 pipeline 执行的流程：

Figure : 1080p 摄像头流发送到套接字，从套接字读取，编码到 AVC 并存储在文件中
            
            <?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 1080p_stream_read_socket_infile.svg 1080p_stream_read_socket_infile -->
<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="9.79167in" height="2.91333in" viewbox="0 0 705 209.76" xml:space="preserve" color-interpolation-filters="sRGB" class="st13"><v:documentproperties v:langid="1033" v:viewmarkup="false"></v:documentproperties>
<style>.svg-3 .st1 { fill: #fafafa; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-3 .st2 { fill: #d2d7e1; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-3 .st3 { stroke: #d2d7e1; stroke-linecap: butt; stroke-width: 0.75 }
.svg-3 .st4 { fill: #2a2aea; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-3 .st5 { fill: #ffffff; font-family: Roboto; font-size: 1.00001em }
.svg-3 .st6 { stroke: #000000; stroke-linecap: butt; stroke-width: 0.75 }
.svg-3 .st7 { fill: #000000; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-3 .st8 { fill: #007884; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-3 .st9 { fill: none; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-3 .st10 { fill: #000000; font-family: Roboto; font-size: 1.00001em; font-weight: bold }
.svg-3 .st11 { fill: #000000; font-family: Roboto; font-size: 0.874992em }
.svg-3 .st12 { fill: #000000; font-family: SimHei; font-size: 0.874992em }
.svg-3 .st13 { 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>1080p_stream_read_socket_infile</title>	<v:pageproperties v:drawingscale="1" v:pagescale="1" v:drawingunits="19" v:shadowoffsetx="9" v:shadowoffsety="-9"></v:pageproperties>	<g id="group2-1" v:mid="2" v:groupcontext="group">		<title>Sheet.2</title>		<g id="shape3-2" v:mid="3" v:groupcontext="shape" transform="translate(0.375,-0.375092)">			<title>Sheet.3</title>			<path d="M0 204.13 A5.62513 5.62513 -180 0 0 5.62 209.76 L698.63 209.76 A5.62513 5.62513 -180 0 0 704.25 204.13 L704.25						 6.38 A5.62513 5.62513 -180 0 0 698.63 0.75 L5.62 0.75 A5.62513 5.62513 -180 0 0 0 6.38 L0 204.13 Z" class="st1"></path>		</g>		<g id="shape4-4" v:mid="4" v:groupcontext="shape">			<title>Sheet.4</title>			<path d="M699 0.75 C701.89 0.75 704.25 3.11 704.25 6 L704.25 203.76 C704.25 206.65 701.89 209.01 699 209.01 L6 209.01						 C3.11 209.01 0.75 206.65 0.75 203.76 L0.75 6 C0.75 3.11 3.11 0.75 6 0.75 L699 0.75 ZM699 0 L6 0 C2.69						 0 0 2.69 0 6 L0 203.76 C0 207.07 2.69 209.76 6 209.76 L699 209.76 C702.31 209.76 705 207.07 705 203.76						 L705 6 C705 2.69 702.31 0 699 0 Z" class="st2"></path>		</g>	</g>	<g id="shape5-6" v:mid="5" v:groupcontext="shape" transform="translate(0,-118.549)">		<title>Sheet.5</title>		<path d="M0 209.76 L705 209.76" class="st3"></path>	</g>	<g id="shape16-9" v:mid="16" v:groupcontext="shape" transform="translate(223.125,-133.549)">		<title>Sheet.16</title>		<desc>qtiqmmfsrc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="191.01" width="120.01" height="37.5"></v:textrect>		<path d="M0 206.76 A3.00007 3.00007 -180 0 0 3 209.76 L117 209.76 A3.00007 3.00007 -180 0 0 120 206.76 L120 175.26 A3.00007					 3.00007 -180 0 0 117 172.26 L3 172.26 A3.00007 3.00007 -180 0 0 -0 175.26 L0 206.76 Z" class="st4"></path>		<text x="28.9" y="194.61" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtiqmmfsrc</text>		</g>	<g id="group18-12" transform="translate(343.125,-149.681)" v:mid="18" v:groupcontext="group">		<title>Sheet.18</title>		<g id="shape19-13" v:mid="19" v:groupcontext="shape" transform="translate(0,-2.61782)">			<title>Sheet.19</title>			<path d="M0 209.76 L14.98 209.76" class="st6"></path>		</g>		<g id="shape20-16" v:mid="20" v:groupcontext="shape" transform="translate(14.2165,0)">			<title>Sheet.20</title>			<path d="M0 209.76 L4.53 207.14 L0 204.52 L0 209.76 Z" class="st7"></path>		</g>	</g>	<g id="shape22-18" v:mid="22" v:groupcontext="shape" transform="translate(361.875,-133.549)">		<title>Sheet.22</title>		<desc>qtisocketsink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="191.01" width="120.01" height="37.5"></v:textrect>		<path d="M0 206.76 A3.00007 3.00007 -180 0 0 3 209.76 L117 209.76 A3.00007 3.00007 -180 0 0 120 206.76 L120 175.26 A3.00007					 3.00007 -180 0 0 117 172.26 L3 172.26 A3.00007 3.00007 -180 0 0 -0 175.26 L0 206.76 Z" class="st4"></path>		<text x="24.44" y="194.61" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtisocketsink</text>		</g>	<g id="shape26-21" v:mid="26" v:groupcontext="shape" transform="translate(15,-42)">		<title>Sheet.26</title>		<desc>qtisocketsrc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="191.01" width="120" height="37.5"></v:textrect>		<path d="M0 206.76 A3.00007 3.00007 -180 0 0 3 209.76 L117 209.76 A3.00007 3.00007 -180 0 0 120 206.76 L120 175.26 A3.00007					 3.00007 -180 0 0 117 172.26 L3 172.26 A3.00007 3.00007 -180 0 0 -0 175.26 L0 206.76 Z" class="st4"></path>		<text x="27.07" y="194.61" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtisocketsrc</text>		</g>	<g id="group28-24" transform="translate(135,-58.1322)" v:mid="28" v:groupcontext="group">		<title>Sheet.28</title>		<g id="shape29-25" v:mid="29" v:groupcontext="shape" transform="translate(0,-2.61782)">			<title>Sheet.29</title>			<path d="M0 209.76 L14.98 209.76" class="st6"></path>		</g>		<g id="shape30-28" v:mid="30" v:groupcontext="shape" transform="translate(14.2165,0)">			<title>Sheet.30</title>			<path d="M0 209.76 L4.53 207.14 L0 204.52 L0 209.76 Z" class="st7"></path>		</g>	</g>	<g id="shape32-30" v:mid="32" v:groupcontext="shape" transform="translate(153.75,-42)">		<title>Sheet.32</title>		<desc>v4l2h264enc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="191.01" width="120" height="37.5"></v:textrect>		<path d="M0 206.76 A3.00007 3.00007 -180 0 0 3 209.76 L117 209.76 A3.00007 3.00007 -180 0 0 120 206.76 L120 175.26 A3.00007					 3.00007 -180 0 0 117 172.26 L3 172.26 A3.00007 3.00007 -180 0 0 -0 175.26 L0 206.76 Z" class="st8"></path>		<text x="25.86" y="194.61" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>v4l2h264enc</text>		</g>	<g id="group34-33" transform="translate(273.75,-58.1322)" v:mid="34" v:groupcontext="group">		<title>Sheet.34</title>		<g id="shape35-34" v:mid="35" v:groupcontext="shape" transform="translate(0,-2.61782)">			<title>Sheet.35</title>			<path d="M0 209.76 L14.98 209.76" class="st6"></path>		</g>		<g id="shape36-37" v:mid="36" v:groupcontext="shape" transform="translate(14.2165,0)">			<title>Sheet.36</title>			<path d="M0 209.76 L4.53 207.14 L0 204.52 L0 209.76 Z" class="st7"></path>		</g>	</g>	<g id="shape38-39" v:mid="38" v:groupcontext="shape" transform="translate(292.5,-42)">		<title>Sheet.38</title>		<desc>h264parse</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="191.01" width="120.01" height="37.5"></v:textrect>		<path d="M0 206.76 A3.00007 3.00007 -180 0 0 3 209.76 L117 209.76 A3.00007 3.00007 -180 0 0 120 206.76 L120 175.26 A3.00007					 3.00007 -180 0 0 117 172.26 L3 172.26 A3.00007 3.00007 -180 0 0 -0 175.26 L0 206.76 Z" class="st8"></path>		<text x="31.65" y="194.61" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>h264parse</text>		</g>	<g id="group40-42" transform="translate(412.5,-58.1322)" v:mid="40" v:groupcontext="group">		<title>Sheet.40</title>		<g id="shape41-43" v:mid="41" v:groupcontext="shape" transform="translate(0,-2.61782)">			<title>Sheet.41</title>			<path d="M0 209.76 L14.98 209.76" class="st6"></path>		</g>		<g id="shape42-46" v:mid="42" v:groupcontext="shape" transform="translate(14.2165,0)">			<title>Sheet.42</title>			<path d="M0 209.76 L4.53 207.14 L0 204.52 L0 209.76 Z" class="st7"></path>		</g>	</g>	<g id="shape44-48" v:mid="44" v:groupcontext="shape" transform="translate(431.25,-42)">		<title>Sheet.44</title>		<desc>mpegtsmux</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="191.01" width="120.01" height="37.5"></v:textrect>		<path d="M0 206.76 A3.00007 3.00007 -180 0 0 3 209.76 L117 209.76 A3.00007 3.00007 -180 0 0 120 206.76 L120 175.26 A3.00007					 3.00007 -180 0 0 117 172.26 L3 172.26 A3.00007 3.00007 -180 0 0 -0 175.26 L0 206.76 Z" class="st8"></path>		<text x="28.24" y="194.61" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>mpegtsmux</text>		</g>	<g id="group46-51" transform="translate(551.25,-58.1322)" v:mid="46" v:groupcontext="group">		<title>Sheet.46</title>		<g id="shape47-52" v:mid="47" v:groupcontext="shape" transform="translate(0,-2.61782)">			<title>Sheet.47</title>			<path d="M0 209.76 L14.98 209.76" class="st6"></path>		</g>		<g id="shape48-55" v:mid="48" v:groupcontext="shape" transform="translate(14.2165,0)">			<title>Sheet.48</title>			<path d="M0 209.76 L4.53 207.14 L0 204.52 L0 209.76 Z" class="st7"></path>		</g>	</g>	<g id="shape50-57" v:mid="50" v:groupcontext="shape" transform="translate(570,-42)">		<title>Sheet.50</title>		<desc>tcpserversink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="191.01" width="120.01" height="37.5"></v:textrect>		<path d="M0 206.76 A3.00007 3.00007 -180 0 0 3 209.76 L117 209.76 A3.00007 3.00007 -180 0 0 120 206.76 L120 175.26 A3.00007					 3.00007 -180 0 0 117 172.26 L3 172.26 A3.00007 3.00007 -180 0 0 -0 175.26 L0 206.76 Z" class="st8"></path>		<text x="24.21" y="194.61" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>tcpserversink</text>		</g>	<g id="shape52-60" v:mid="52" v:groupcontext="shape" transform="translate(310.5,-182.569)">		<title>Sheet.52</title>		<desc>GST BIN</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="42" cy="202.56" width="84.01" height="14.4"></v:textrect>		<rect x="0" y="195.36" width="84" height="14.4" class="st9"></rect>		<text x="19.2" y="206.16" class="st10" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>GST BIN</text>		</g>	<g id="shape53-63" v:mid="53" v:groupcontext="shape" transform="translate(310.5,-91.0201)">		<title>Sheet.53</title>		<desc>GST BIN</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="42" cy="202.56" width="84.01" height="14.4"></v:textrect>		<rect x="0" y="195.36" width="84" height="14.4" class="st9"></rect>		<text x="19.2" y="206.16" class="st10" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>GST BIN</text>		</g>	<g id="group54-66" transform="translate(579.875,-13.2814)" v:mid="54" v:groupcontext="group">		<title>Sheet.54</title>		<g id="shape8-67" v:mid="8" v:groupcontext="shape" transform="translate(15.1883,0)">			<title>Sheet.8</title>			<desc>Qualcomm</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="27.4021" cy="203.46" width="54.81" height="12.6"></v:textrect>			<rect x="0" y="197.16" width="54.8042" height="12.6" class="st9"></rect>			<text x="0" y="206.61" class="st11" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>Qualcomm  </text>			</g>		<g id="shape9-70" v:mid="9" v:groupcontext="shape" transform="translate(-3.29736E-14,-0.218619)">			<title>Sheet.9</title>			<path d="M0 208.26 A1.50003 1.50003 -180 0 0 1.5 209.76 L10.5 209.76 A1.50003 1.50003 -180 0 0 12 208.26 L12 199.26						 A1.50003 1.50003 -180 0 0 10.5 197.76 L1.5 197.76 A1.50003 1.50003 -180 0 0 -0 199.26 L0 208.26 Z" class="st4"></path>		</g>		<g id="shape11-72" v:mid="11" v:groupcontext="shape" transform="translate(89.1246,0)">			<title>Sheet.11</title>			<desc>开源</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="10.5" cy="203.46" width="21" height="12.6"></v:textrect>			<rect x="0" y="197.16" width="21" height="12.6" class="st9"></rect>			<text x="0" y="206.95" class="st12" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>开源</text>			</g>		<g id="shape12-75" v:mid="12" v:groupcontext="shape" transform="translate(73.9363,-0.218619)">			<title>Sheet.12</title>			<path d="M0 208.26 A1.50003 1.50003 -180 0 0 1.5 209.76 L10.5 209.76 A1.50003 1.50003 -180 0 0 12 208.26 L12 199.26						 A1.50003 1.50003 -180 0 0 10.5 197.76 L1.5 197.76 A1.50003 1.50003 -180 0 0 0 199.26 L0 208.26 Z" class="st8"></path>		</g>	</g></g>
</svg>

## RTMP 流 

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

该用例使用 ISP 或 RTSP 摄像头流生成 RTMP 流。您可以在 Waylandsink 上显示 RTMP 流或将其保存为文件。

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

        export XDG_RUNTIME_DIR=/dev/socket/weston && export WAYLAND_DISPLAY=wayland-1 && gst-launch-1.0 \
        rtspsrc location=rtsp://admin:qualcomm1@192.168.1.252:554/Streaming/Channels/101 ! rtph264depay ! h264parse ! flvmux! rtmp2sink sync=true location=rtmp://192.168.1.171/live/01Copy to clipboard

    在此命令中，将 rtmp://192.168.1.171/live/01 替换为设备的 IP 地址。

    下图展示了 pipeline 执行的流程：

Figure : 使用 RTSP 源的 RTMP 流 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-rtmp-stream-rtspsrc-example.svg gst-rtmp-stream-rtspsrc-example -->
<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="7.5in" height="1.5625in" viewbox="0 0 540 112.5" xml:space="preserve" color-interpolation-filters="sRGB" class="st10"><v:documentproperties v:langid="1033" v:viewmarkup="false"></v:documentproperties>
<style>.svg-4 .st1 { fill: #fafafa; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-4 .st2 { fill: #d2d7e1; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-4 .st3 { stroke: #000000; stroke-linecap: butt; stroke-width: 0.75 }
.svg-4 .st4 { fill: #000000; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-4 .st5 { fill: #007884; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-4 .st6 { fill: #ffffff; font-family: Roboto; font-size: 0.874992em }
.svg-4 .st7 { font-size: 1em }
.svg-4 .st8 { fill: none; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-4 .st9 { fill: #000000; font-family: SimHei; font-size: 0.874992em }
.svg-4 .st10 { 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>gst-rtmp-stream-rtspsrc-example</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.375114)">		<title>Sheet.2</title>		<path d="M0 106.87 A5.62513 5.62513 -180 0 0 5.63 112.5 L533.62 112.5 A5.62513 5.62513 -180 0 0 539.25 106.87 L539.25					 6.38 A5.62513 5.62513 -180 0 0 533.62 0.75 L5.63 0.75 A5.62513 5.62513 -180 0 0 -0 6.38 L0 106.87 Z" class="st1"></path>	</g>	<g id="shape3-3" v:mid="3" v:groupcontext="shape">		<title>Sheet.3</title>		<path d="M534 0.75 C536.89 0.75 539.25 3.11 539.25 6 L539.25 106.5 C539.25 109.39 536.89 111.75 534 111.75 L6 111.75					 C3.11 111.75 0.75 109.39 0.75 106.5 L0.75 6 C0.75 3.11 3.11 0.75 6 0.75 L534 0.75 ZM534 0 L6 0 C2.69 0 0					 2.69 0 6 L0 106.5 C0 109.81 2.69 112.5 6 112.5 L534 112.5 C537.31 112.5 540 109.81 540 106.5 L540 6 C540					 2.69 537.31 0 534 0 Z" class="st2"></path>	</g>	<g id="shape9-5" v:mid="9" v:groupcontext="shape" transform="translate(88.3016,-68.6887)">		<title>Sheet.9</title>		<path d="M0 112.5 L29.44 112.5" class="st3"></path>	</g>	<g id="shape10-8" v:mid="10" v:groupcontext="shape" transform="translate(116.87,-65.697)">		<title>Sheet.10</title>		<path d="M0 112.5 L5.18 109.51 L0 106.52 L0 112.5 Z" class="st4"></path>	</g>	<g id="shape12-10" v:mid="12" v:groupcontext="shape" transform="translate(193.302,-68.6887)">		<title>Sheet.12</title>		<path d="M0 112.5 L29.44 112.5" class="st3"></path>	</g>	<g id="shape13-13" v:mid="13" v:groupcontext="shape" transform="translate(221.87,-65.697)">		<title>Sheet.13</title>		<path d="M0 112.5 L5.18 109.51 L0 106.52 L0 112.5 Z" class="st4"></path>	</g>	<g id="shape15-15" v:mid="15" v:groupcontext="shape" transform="translate(298.302,-68.6887)">		<title>Sheet.15</title>		<path d="M0 112.5 L29.44 112.5" class="st3"></path>	</g>	<g id="shape16-18" v:mid="16" v:groupcontext="shape" transform="translate(326.87,-65.697)">		<title>Sheet.16</title>		<path d="M0 112.5 L5.18 109.51 L0 106.52 L0 112.5 Z" class="st4"></path>	</g>	<g id="shape18-20" v:mid="18" v:groupcontext="shape" transform="translate(410.802,-68.6887)">		<title>Sheet.18</title>		<path d="M0 112.5 L29.44 112.5" class="st3"></path>	</g>	<g id="shape19-23" v:mid="19" v:groupcontext="shape" transform="translate(439.37,-65.697)">		<title>Sheet.19</title>		<path d="M0 112.5 L5.18 109.51 L0 106.52 L0 112.5 Z" class="st4"></path>	</g>	<g id="shape21-25" v:mid="21" v:groupcontext="shape" transform="translate(16.6979,-46.1888)">		<title>Sheet.21</title>		<desc>rtspsrc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="36" cy="90" width="72" height="45"></v:textrect>		<path d="M0 109.5 A3.00007 3.00007 -180 0 0 3 112.5 L69 112.5 A3.00007 3.00007 -180 0 0 72 109.5 L72 70.5 A3.00007 3.00007					 -180 0 0 69 67.5 L3 67.5 A3.00007 3.00007 -180 0 0 0 70.5 L0 109.5 Z" class="st5"></path>		<text x="19.62" y="93.6" class="st6" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>rtspsrc</text>		</g>	<g id="shape24-28" v:mid="24" v:groupcontext="shape" transform="translate(122.052,-46.1888)">		<title>Sheet.24</title>		<desc>rtph264 depay</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="35.625" cy="90" width="71.26" height="45"></v:textrect>		<path d="M0 109.5 A3.00007 3.00007 -180 0 0 3 112.5 L68.25 112.5 A3.00007 3.00007 -180 0 0 71.25 109.5 L71.25 70.5 A3.00007					 3.00007 -180 0 0 68.25 67.5 L3 67.5 A3.00007 3.00007 -180 0 0 -0 70.5 L0 109.5 Z" class="st5"></path>		<text x="17.45" y="85.95" class="st6" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>rtph264<v:newlinechar></v:newlinechar><tspan x="21.6" dy="1.329em" class="st7">depay</tspan></text>		</g>	<g id="shape27-32" v:mid="27" v:groupcontext="shape" transform="translate(227.052,-46.1888)">		<title>Sheet.27</title>		<desc>h264parse</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="35.625" cy="90" width="71.26" height="45"></v:textrect>		<path d="M0 109.5 A3.00007 3.00007 -180 0 0 3 112.5 L68.25 112.5 A3.00007 3.00007 -180 0 0 71.25 109.5 L71.25 70.5 A3.00007					 3.00007 -180 0 0 68.25 67.5 L3 67.5 A3.00007 3.00007 -180 0 0 -0 70.5 L0 109.5 Z" class="st5"></path>		<text x="10.82" y="93.6" class="st6" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>h264parse</text>		</g>	<g id="shape30-35" v:mid="30" v:groupcontext="shape" transform="translate(332.052,-46.1888)">		<title>Sheet.30</title>		<desc>flvmux</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="39.375" cy="90" width="78.75" height="45"></v:textrect>		<path d="M-0 109.5 A3.00007 3.00007 -180 0 0 3 112.5 L75.75 112.5 A3.00007 3.00007 -180 0 0 78.75 109.5 L78.75 70.5 A3.00007					 3.00007 -180 0 0 75.75 67.5 L3 67.5 A3.00007 3.00007 -180 0 0 0 70.5 L0 109.5 Z" class="st5"></path>		<text x="23.64" y="93.6" class="st6" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>flvmux</text>		</g>	<g id="shape33-38" v:mid="33" v:groupcontext="shape" transform="translate(444.552,-46.1888)">		<title>Sheet.33</title>		<desc>rtmp2sink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="39.375" cy="90" width="78.75" height="45"></v:textrect>		<path d="M-0 109.5 A3.00007 3.00007 -180 0 0 3 112.5 L75.75 112.5 A3.00007 3.00007 -180 0 0 78.75 109.5 L78.75 70.5 A3.00007					 3.00007 -180 0 0 75.75 67.5 L3 67.5 A3.00007 3.00007 -180 0 0 0 70.5 L0 109.5 Z" class="st5"></path>		<text x="15.85" y="93.6" class="st6" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>rtmp2sink</text>		</g>	<g id="group34-41" transform="translate(487.113,-15.0926)" v:mid="34" v:groupcontext="group">		<title>Sheet.34</title>		<g id="shape6-42" v:mid="6" v:groupcontext="shape" transform="translate(15.1883,0)">			<title>Sheet.6</title>			<desc>开源</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="10.5" cy="106.2" width="21" height="12.6"></v:textrect>			<rect x="0" y="99.9" width="21" height="12.6" class="st8"></rect>			<text x="0" y="109.69" class="st9" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>开源</text>			</g>		<g id="shape7-45" v:mid="7" v:groupcontext="shape" transform="translate(3.09752E-14,-0.218618)">			<title>Sheet.7</title>			<path d="M0 111 A1.50003 1.50003 -180 0 0 1.5 112.5 L10.5 112.5 A1.50003 1.50003 -180 0 0 12 111 L12 102 A1.50003						 1.50003 -180 0 0 10.5 100.5 L1.5 100.5 A1.50003 1.50003 -180 0 0 0 102 L0 111 Z" class="st5"></path>		</g>	</g></g>
</svg>
- 摄像头源：

        export XDG_RUNTIME_DIR=/dev/socket/weston && export WAYLAND_DISPLAY=wayland-1 && gst-launch-1.0 --gst-debug=2 \
        qtiqmmfsrc camera=0 ! video/x-raw,format=NV12,width=1280,height=720,framerate=30/1 ! queue ! \
        v4l2h264enc capture-io-mode=4 output-io-mode=5 ! queue ! h264parse ! flvmux! rtmp2sink sync=true location=rtmp://192.168.1.171/live/01Copy to clipboard

    下图展示了 pipeline 执行的流程：

Figure : 使用摄像头源的 RTMP 流 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-rtmp-stream-qtiqmmsrc-example.svg gst-rtmp-stream-qtiqmmsrc-examp -->
<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.75in" height="1.5625in" viewbox="0 0 630 112.5" xml:space="preserve" color-interpolation-filters="sRGB" class="st11"><v:documentproperties v:langid="1033" v:viewmarkup="false"></v:documentproperties>
<style>.svg-5 .st1 { fill: #fafafa; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-5 .st2 { fill: #d2d7e1; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-5 .st3 { stroke: #000000; stroke-linecap: butt; stroke-width: 0.75 }
.svg-5 .st4 { fill: #000000; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-5 .st5 { fill: #2a2aea; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-5 .st6 { fill: #ffffff; font-family: Roboto; font-size: 0.874992em }
.svg-5 .st7 { fill: #007884; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-5 .st8 { fill: none; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-5 .st9 { fill: #000000; font-family: Roboto; font-size: 0.874992em }
.svg-5 .st10 { fill: #000000; font-family: SimHei; font-size: 0.874992em }
.svg-5 .st11 { 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>gst-rtmp-stream-qtiqmmsrc-examp</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 106.87 A5.62513 5.62513 -180 0 0 5.63 112.5 L623.62 112.5 A5.62513 5.62513 -180 0 0 629.25 106.87 L629.25					 6.38 A5.62513 5.62513 -180 0 0 623.62 0.75 L5.62 0.75 A5.62513 5.62513 -180 0 0 0 6.38 L0 106.87 Z" class="st1"></path>	</g>	<g id="shape3-3" v:mid="3" v:groupcontext="shape">		<title>Sheet.3</title>		<path d="M624 0.75 C626.89 0.75 629.25 3.1 629.25 6 L629.25 106.5 C629.25 109.4 626.89 111.75 624 111.75 L6 111.75 C3.11					 111.75 0.75 109.4 0.75 106.5 L0.75 6 C0.75 3.1 3.11 0.75 6 0.75 L624 0.75 ZM624 0 L6 0 C2.68 0 0 2.69 0					 6 L0 106.5 C0 109.81 2.68 112.5 6 112.5 L624 112.5 C627.31 112.5 630 109.81 630 106.5 L630 6 C630 2.69 627.31					 0 624 0 Z" class="st2"></path>	</g>	<g id="shape11-5" v:mid="11" v:groupcontext="shape" transform="translate(86.625,-69.915)">		<title>Sheet.11</title>		<path d="M0 112.5 L25.69 112.5" class="st3"></path>	</g>	<g id="shape12-8" v:mid="12" v:groupcontext="shape" transform="translate(111.443,-66.9225)">		<title>Sheet.12</title>		<path d="M0 112.5 L5.18 109.51 L0 106.51 L0 112.5 Z" class="st4"></path>	</g>	<g id="shape14-10" v:mid="14" v:groupcontext="shape" transform="translate(187.875,-69.915)">		<title>Sheet.14</title>		<path d="M0 112.5 L25.69 112.5" class="st3"></path>	</g>	<g id="shape15-13" v:mid="15" v:groupcontext="shape" transform="translate(212.693,-66.9225)">		<title>Sheet.15</title>		<path d="M0 112.5 L5.18 109.51 L0 106.51 L0 112.5 Z" class="st4"></path>	</g>	<g id="shape17-15" v:mid="17" v:groupcontext="shape" transform="translate(289.125,-69.915)">		<title>Sheet.17</title>		<path d="M0 112.5 L25.69 112.5" class="st3"></path>	</g>	<g id="shape18-18" v:mid="18" v:groupcontext="shape" transform="translate(313.943,-66.9225)">		<title>Sheet.18</title>		<path d="M0 112.5 L5.18 109.51 L0 106.51 L0 112.5 Z" class="st4"></path>	</g>	<g id="shape20-20" v:mid="20" v:groupcontext="shape" transform="translate(397.875,-69.915)">		<title>Sheet.20</title>		<path d="M0 112.5 L25.7 112.5" class="st3"></path>	</g>	<g id="shape21-23" v:mid="21" v:groupcontext="shape" transform="translate(422.693,-66.9225)">		<title>Sheet.21</title>		<path d="M0 112.5 L5.18 109.51 L0 106.51 L0 112.5 Z" class="st4"></path>	</g>	<g id="shape23-25" v:mid="23" v:groupcontext="shape" transform="translate(506.625,-69.915)">		<title>Sheet.23</title>		<path d="M0 112.5 L25.69 112.5" class="st3"></path>	</g>	<g id="shape24-28" v:mid="24" v:groupcontext="shape" transform="translate(531.443,-66.9225)">		<title>Sheet.24</title>		<path d="M0 112.5 L5.18 109.51 L0 106.51 L0 112.5 Z" class="st4"></path>	</g>	<g id="shape26-30" v:mid="26" v:groupcontext="shape" transform="translate(14.625,-47.415)">		<title>Sheet.26</title>		<desc>qtiqmmfsrc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="36" cy="90" width="72.01" height="45"></v:textrect>		<path d="M0 109.5 A3.00007 3.00007 -180 0 0 3 112.5 L69 112.5 A3.00007 3.00007 -180 0 0 72 109.5 L72 70.5 A3.00007 3.00007					 -180 0 0 69 67.5 L3 67.5 A3.00007 3.00007 -180 0 0 -0 70.5 L0 109.5 Z" class="st5"></path>		<text x="8.79" y="93.6" class="st6" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtiqmmfsrc</text>		</g>	<g id="shape29-33" v:mid="29" v:groupcontext="shape" transform="translate(116.625,-47.415)">		<title>Sheet.29</title>		<desc>capsfilter</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="35.625" cy="90" width="71.25" height="45"></v:textrect>		<path d="M0 109.5 A3.00007 3.00007 -180 0 0 3 112.5 L68.25 112.5 A3.00007 3.00007 -180 0 0 71.25 109.5 L71.25 70.5 A3.00007					 3.00007 -180 0 0 68.25 67.5 L3 67.5 A3.00007 3.00007 -180 0 0 -0 70.5 L0 109.5 Z" class="st7"></path>		<text x="13.73" y="93.6" class="st6" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>capsfilter</text>		</g>	<g id="shape32-36" v:mid="32" v:groupcontext="shape" transform="translate(217.875,-47.415)">		<title>Sheet.32</title>		<desc>v4l2h264enc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="35.625" cy="90" width="71.25" height="45"></v:textrect>		<path d="M0 109.5 A3.00007 3.00007 -180 0 0 3 112.5 L68.25 112.5 A3.00007 3.00007 -180 0 0 71.25 109.5 L71.25 70.5 A3.00007					 3.00007 -180 0 0 68.25 67.5 L3 67.5 A3.00007 3.00007 -180 0 0 -0 70.5 L0 109.5 Z" class="st7"></path>		<text x="5.75" y="93.6" class="st6" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>v4l2h264enc</text>		</g>	<g id="shape35-39" v:mid="35" v:groupcontext="shape" transform="translate(319.125,-47.415)">		<title>Sheet.35</title>		<desc>h264parse</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="39.375" cy="90" width="78.75" height="45"></v:textrect>		<path d="M-0 109.5 A3.00007 3.00007 -180 0 0 3 112.5 L75.75 112.5 A3.00007 3.00007 -180 0 0 78.75 109.5 L78.75 70.5 A3.00007					 3.00007 -180 0 0 75.75 67.5 L3 67.5 A3.00007 3.00007 -180 0 0 0 70.5 L0 109.5 Z" class="st7"></path>		<text x="14.57" y="93.6" class="st6" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>h264parse</text>		</g>	<g id="shape38-42" v:mid="38" v:groupcontext="shape" transform="translate(427.875,-47.415)">		<title>Sheet.38</title>		<desc>flvmux</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="39.375" cy="90" width="78.76" height="45"></v:textrect>		<path d="M-0 109.5 A3.00007 3.00007 -180 0 0 3 112.5 L75.75 112.5 A3.00007 3.00007 -180 0 0 78.75 109.5 L78.75 70.5 A3.00007					 3.00007 -180 0 0 75.75 67.5 L3 67.5 A3.00007 3.00007 -180 0 0 0 70.5 L0 109.5 Z" class="st7"></path>		<text x="23.64" y="93.6" class="st6" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>flvmux</text>		</g>	<g id="shape41-45" v:mid="41" v:groupcontext="shape" transform="translate(536.625,-47.415)">		<title>Sheet.41</title>		<desc>rtmp2sink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="39.375" cy="90" width="78.76" height="45"></v:textrect>		<path d="M-0 109.5 A3.00007 3.00007 -180 0 0 3 112.5 L75.75 112.5 A3.00007 3.00007 -180 0 0 78.75 109.5 L78.75 70.5 A3.00007					 3.00007 -180 0 0 75.75 67.5 L3 67.5 A3.00007 3.00007 -180 0 0 0 70.5 L0 109.5 Z" class="st7"></path>		<text x="15.85" y="93.6" class="st6" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>rtmp2sink</text>		</g>	<g id="group42-48" transform="translate(505.252,-19.8675)" v:mid="42" v:groupcontext="group">		<title>Sheet.42</title>		<g id="shape6-49" v:mid="6" v:groupcontext="shape" transform="translate(15.1875,0)">			<title>Sheet.6</title>			<desc>Qualcomm</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="26.4638" cy="106.2" width="52.93" height="12.6"></v:textrect>			<rect x="0" y="99.9" width="52.9275" height="12.6" class="st8"></rect>			<text x="0" y="109.35" class="st9" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>Qualcomm  </text>			</g>		<g id="shape7-52" v:mid="7" v:groupcontext="shape" transform="translate(3.09752E-14,-0.2175)">			<title>Sheet.7</title>			<path d="M0 111 A1.50003 1.50003 -180 0 0 1.5 112.5 L10.5 112.5 A1.50003 1.50003 -180 0 0 12 111 L12 102 A1.50003						 1.50003 -180 0 0 10.5 100.5 L1.5 100.5 A1.50003 1.50003 -180 0 0 0 102 L0 111 Z" class="st5"></path>		</g>		<g id="shape8-54" v:mid="8" v:groupcontext="shape" transform="translate(89.1225,0)">			<title>Sheet.8</title>			<desc>开源</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="10.5" cy="106.2" width="21" height="12.6"></v:textrect>			<rect x="0" y="99.9" width="21" height="12.6" class="st8"></rect>			<text x="-0" y="109.35" class="st10" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>开源</text>			</g>		<g id="shape9-57" v:mid="9" v:groupcontext="shape" transform="translate(73.935,-0.2175)">			<title>Sheet.9</title>			<path d="M0 111 A1.50003 1.50003 -180 0 0 1.5 112.5 L10.5 112.5 A1.50003 1.50003 -180 0 0 12 111 L12 102 A1.50003						 1.50003 -180 0 0 10.5 100.5 L1.5 100.5 A1.50003 1.50003 -180 0 0 0 102 L0 111 Z" class="st7"></path>		</g>	</g></g>
</svg>

要查看 Waylandsink 上的输出，请运行以下命令：

    export XDG_RUNTIME_DIR=/dev/socket/weston && export WAYLAND_DISPLAY=wayland-1 && gst-launch-1.0 \
    rtmp2src location=rtmp://192.168.1.171/live/01 ! flvdemux name=demux \
    demux.video ! queue ! video/x-h264,colorimetry=bt709 ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! queue ! waylandsink fullscreen=true sync=trueCopy to clipboard

要将输出保存为媒体文件，请连接到 VLC 并运行以下命令：

    rtmp://192.168.1.171/live/01Copy to clipboard

在此命令中，将 rtmp://192.168.1.171/live/01 替换为设备的 IP 地址。

## 故障排除

对于任何应用程序，如果摄像头服务在运行期间无法正常工作或出现故障，请参见[摄像头故障排除](https://docs.qualcomm.com/bundle/publicresource/topics/80-70022-17/troubleshooting.html)重新启动该服务。

Last Published: Nov 05, 2025

[Previous Topic
运行多媒体用例](https://docs.qualcomm.com/bundle/publicresource/80-70022-50SC/topics/multimedia-use-cases.md) [Next Topic
视频编码与解码](https://docs.qualcomm.com/bundle/publicresource/80-70022-50SC/topics/camera-and-video-encode.md)