# 视频编码与解码

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

摄像头和视频编码用例展示了编码和处理实时 4K 和 1080p 摄像头流的各种场景。

### 前提条件

- 确保已完成 [GStreamer 命令行用例](https://docs.qualcomm.com/doc/80-70022-50SC/topic/gstreamer-application-use-cases.html)中提及的前提条件。
- 在主机上安装 VLC 媒体播放器以播放 RTSP 流。
Note: QCS6490 不支持 24 路端到端并发视频会话。

## 一路流 - 来自实时源的 1080p AVC RTSP 流

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

该用例对来自摄像头的 1080p 流进行编码。编码流使用 RTSP 流通过网络发送。

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

Figure : 1080p RTSP 流编码 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 pipeline_encoding_rtsp_stream.svg pipeline_encoding_rtsp_stream -->
<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="1.44831in" viewbox="0 0 705 104.278" xml:space="preserve" color-interpolation-filters="sRGB" class="st10"><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: #000000; font-family: Roboto; font-size: 1.00001em; font-weight: bold }
.svg-1 .st3 { fill: #d2d7e1; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st4 { fill: #007884; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st5 { fill: #ffffff; font-family: Roboto; font-size: 1.00001em }
.svg-1 .st6 { stroke: #000000; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st7 { fill: #000000; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st8 { fill: none; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st9 { fill: #000000; font-family: SimHei; font-size: 0.874992em }
.svg-1 .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>pipeline_encoding_rtsp_stream</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.374943)">		<title>Sheet.2</title>		<desc>GST BIN</desc>		<v:textblock v:margins="rect(7.2,0,0,0)" v:verticalalign="0"></v:textblock>		<v:textrect cx="352.125" cy="52.5141" width="704.26" height="103.529"></v:textrect>		<path d="M0 98.65 A5.62513 5.62513 -180 0 0 5.62 104.28 L698.63 104.28 A5.62513 5.62513 -180 0 0 704.25 98.65 L704.25					 6.37 A5.62513 5.62513 -180 0 0 698.63 0.75 L5.62 0.75 A5.62513 5.62513 -180 0 0 0 6.37 L0 98.65 Z" class="st1"></path>		<text x="329.33" y="18.75" class="st2" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>GST BIN</text>		</g>	<g id="shape3-4" v:mid="3" v:groupcontext="shape">		<title>Sheet.3</title>		<path d="M699 0.75 C701.89 0.75 704.25 3.11 704.25 6 L704.25 98.28 C704.25 101.17 701.89 103.53 699 103.53 L6 103.53					 C3.11 103.53 0.75 101.17 0.75 98.28 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 98.28 C0 101.59 2.69 104.28 6 104.28 L699 104.28 C702.31 104.28 705 101.59 705 98.28 L705 6					 C705 2.69 702.31 0 699 0 Z" class="st3"></path>	</g>	<g id="shape8-6" v:mid="8" v:groupcontext="shape" transform="translate(15,-28.6205)">		<title>Sheet.8</title>		<desc>camsrc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="85.5284" width="120.01" height="37.5"></v:textrect>		<path d="M0 101.28 A3.00007 3.00007 -180 0 0 3 104.28 L117 104.28 A3.00007 3.00007 -180 0 0 120 101.28 L120 69.78 A3.00007					 3.00007 -180 0 0 117 66.78 L3 66.78 A3.00007 3.00007 -180 0 0 -0 69.78 L0 101.28 Z" class="st4"></path>		<text x="40.07" y="89.13" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>camsrc</text>		</g>	<g id="shape11-9" v:mid="11" v:groupcontext="shape" transform="translate(135,-47.3705)">		<title>Sheet.11</title>		<path d="M0 104.28 L14.98 104.28" class="st6"></path>	</g>	<g id="shape12-12" v:mid="12" v:groupcontext="shape" transform="translate(149.217,-44.7527)">		<title>Sheet.12</title>		<path d="M0 104.28 L4.53 101.66 L0 99.04 L0 104.28 Z" class="st7"></path>	</g>	<g id="shape14-14" v:mid="14" v:groupcontext="shape" transform="translate(153.75,-28.6205)">		<title>Sheet.14</title>		<desc>v4l2h264enc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="85.5284" width="120.01" height="37.5"></v:textrect>		<path d="M0 101.28 A3.00007 3.00007 -180 0 0 3 104.28 L117 104.28 A3.00007 3.00007 -180 0 0 120 101.28 L120 69.78 A3.00007					 3.00007 -180 0 0 117 66.78 L3 66.78 A3.00007 3.00007 -180 0 0 -0 69.78 L0 101.28 Z" class="st4"></path>		<text x="25.86" y="89.13" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>v4l2h264enc</text>		</g>	<g id="shape17-17" v:mid="17" v:groupcontext="shape" transform="translate(273.75,-47.3705)">		<title>Sheet.17</title>		<path d="M0 104.28 L14.98 104.28" class="st6"></path>	</g>	<g id="shape18-20" v:mid="18" v:groupcontext="shape" transform="translate(287.966,-44.7527)">		<title>Sheet.18</title>		<path d="M0 104.28 L4.53 101.66 L0 99.04 L0 104.28 Z" class="st7"></path>	</g>	<g id="shape20-22" v:mid="20" v:groupcontext="shape" transform="translate(292.5,-28.6205)">		<title>Sheet.20</title>		<desc>h264parse</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="85.5284" width="120.01" height="37.5"></v:textrect>		<path d="M0 101.28 A3.00007 3.00007 -180 0 0 3 104.28 L117 104.28 A3.00007 3.00007 -180 0 0 120 101.28 L120 69.78 A3.00007					 3.00007 -180 0 0 117 66.78 L3 66.78 A3.00007 3.00007 -180 0 0 0 69.78 L0 101.28 Z" class="st4"></path>		<text x="31.65" y="89.13" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>h264parse</text>		</g>	<g id="shape23-25" v:mid="23" v:groupcontext="shape" transform="translate(412.5,-47.3705)">		<title>Sheet.23</title>		<path d="M0 104.28 L14.98 104.28" class="st6"></path>	</g>	<g id="shape24-28" v:mid="24" v:groupcontext="shape" transform="translate(426.716,-44.7527)">		<title>Sheet.24</title>		<path d="M0 104.28 L4.53 101.66 L0 99.04 L0 104.28 Z" class="st7"></path>	</g>	<g id="shape26-30" v:mid="26" v:groupcontext="shape" transform="translate(431.25,-28.6205)">		<title>Sheet.26</title>		<desc>rtph264pay</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="85.5284" width="120.01" height="37.5"></v:textrect>		<path d="M0 101.28 A3.00007 3.00007 -180 0 0 3 104.28 L117 104.28 A3.00007 3.00007 -180 0 0 120 101.28 L120 69.78 A3.00007					 3.00007 -180 0 0 117 66.78 L3 66.78 A3.00007 3.00007 -180 0 0 -0 69.78 L0 101.28 Z" class="st4"></path>		<text x="29.76" y="89.13" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>rtph264pay</text>		</g>	<g id="shape29-33" v:mid="29" v:groupcontext="shape" transform="translate(551.25,-47.3705)">		<title>Sheet.29</title>		<path d="M0 104.28 L14.98 104.28" class="st6"></path>	</g>	<g id="shape30-36" v:mid="30" v:groupcontext="shape" transform="translate(565.466,-44.7527)">		<title>Sheet.30</title>		<path d="M0 104.28 L4.53 101.66 L0 99.04 L0 104.28 Z" class="st7"></path>	</g>	<g id="shape32-38" v:mid="32" v:groupcontext="shape" transform="translate(570,-28.6205)">		<title>Sheet.32</title>		<desc>udpsink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="85.5284" width="120" height="37.5"></v:textrect>		<path d="M0 101.28 A3.00007 3.00007 -180 0 0 3 104.28 L117 104.28 A3.00007 3.00007 -180 0 0 120 101.28 L120 69.78 A3.00007					 3.00007 -180 0 0 117 66.78 L3 66.78 A3.00007 3.00007 -180 0 0 0 69.78 L0 101.28 Z" class="st4"></path>		<text x="39.04" y="89.13" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>udpsink</text>		</g>	<g id="group37-41" transform="translate(653.812,-7.40192)" v:mid="37" v:groupcontext="group">		<title>Sheet.37</title>		<g id="shape35-42" v:mid="35" v:groupcontext="shape" transform="translate(15.1883,0)">			<title>Sheet.35</title>			<desc>开源</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="10.5" cy="97.9784" width="21.01" height="12.6"></v:textrect>			<rect x="0" y="91.6784" width="21" height="12.6" class="st8"></rect>			<text x="0" y="101.47" class="st9" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>开源</text>			</g>		<g id="shape36-45" v:mid="36" v:groupcontext="shape" transform="translate(6.29496E-14,-0.218619)">			<title>Sheet.36</title>			<path d="M0 102.78 A1.50003 1.50003 -180 0 0 1.5 104.28 L10.5 104.28 A1.50003 1.50003 -180 0 0 12 102.78 L12 93.78						 A1.50003 1.50003 -180 0 0 10.5 92.28 L1.5 92.28 A1.50003 1.50003 -180 0 0 0 93.78 L0 102.78 Z" class="st4"></path>		</g>	</g></g>
</svg>

- 使用 udpsrc 在目标设备上运行 RTSP 服务器（您可以在后台将其作为服务运行）：

        gst-rtsp-server -a "< IP_address of the device >" -p 8900 -m /live "( udpsrc name=pay0 port=8554 caps=\"application/x-rtp,media=video,clock-rate=90000,encoding-name=H264,payload=96\" )"Copy to clipboard

如果设备的 IP 地址为 127.0.0.1，请执行以下命令：

        adb forward tcp:8900 tcp:8900Copy to clipboard
- 在目标设备上的另一个控制台中运行 pipeline：

        gst-launch-1.0 -e qtiqmmfsrc name=camsrc video_0::type=preview ! video/x-raw,format=NV12_Q08C,width=1920,height=1080,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! queue ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! queue ! h264parse ! mp4mux ! queue ! filesink location="/opt/mux.mp4" camsrc. ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! queue ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! queue ! h264parse config-interval=-1 ! rtph264pay pt=96 ! udpsink host=<IP address of device> port=8554 camsrc. ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! waylandsink fullscreen=trueCopy to clipboard

视频流在主机上显示为 RTSP 流。

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

### 主机上的 RTSP 流

Note: 确保您已在 Linux 主机上安装了 VLC 媒体播放器。

要在主机上查看 RTSP 流，请执行以下操作之一：

- vlc -vvv rtsp://&lt;IP\_address of the device&gt;:8900/live[带有 VLC 版本 3.0.8 的 Ubuntu 18.04]
- ffplay -rtsp\_transport tcp rtsp://&lt;IP\_address of the
                        device&gt;:8900/live

要在 Windows 主机上查看 RTSP 流，请执行以下操作：

1. 打开 VLC 媒体播放器。
2. 转到 Media <abbr title="and then"> &gt; </abbr>Open Network Stream，或按 CTRL +
                    N。
3. 输入 rtsp://&lt;IP\_address of the device&gt;:8900/live。
4. 选择 Play

## 二路流 - 来自实时源的 4K AVC 和 480p AVC 流

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

这些用例实现了来自摄像头的一个 4k 流和一个 1080p 流进行编码。每个编码的数据流都多路复用到不同的文件中。

在目标设备上运行用例：

    gst-launch-1.0 -e qtiqmmfsrc name=camsrc video_0::type=preview ! video/x-raw,format=NV12_Q08C,width=3840,height=2160,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! queue ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! queue ! h264parse ! mp4mux ! queue ! filesink location="/opt/mux1.mp4" camsrc. ! video/x-raw,format=NV12_Q08C,width=640,height=480,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! queue ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! queue ! h264parse ! mp4mux ! queue ! filesink location="/opt/mux2.mp4"Copy to clipboard

要停止用例，请使用 CTRL + C。从目标设备中拉取录制的内容，然后在主机上播放内容。

在主机的终端中，运行以下命令：

scp -r root@[DEVICE IP-ADDR]:/opt/mux1.mp4 user1@[HOST IP-ADDR]:/workspace/Copy to clipboard

    scp -r root@[DEVICE IP-ADDR]:/opt/mux2.mp4 user1@[HOST IP-ADDR]:/workspace/Copy to clipboard

您可以在媒体播放器上播放 MP4 文件。

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

Figure : 用于编码两个（4k 和 1080p）摄像头流的 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 pipeline_encoding_two_streams.svg pipeline_encoding_two_streams -->
<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.9184in" height="1.97567in" viewbox="0 0 714.125 142.248" 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: #007884; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-2 .st4 { fill: #ffffff; font-family: Roboto; font-size: 1.00001em }
.svg-2 .st5 { stroke: #000000; stroke-linecap: butt; stroke-width: 0.75 }
.svg-2 .st6 { fill: #000000; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-2 .st7 { fill: none }
.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>pipeline_encoding_two_streams</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.37508,-0.375)">		<title>Sheet.2</title>		<path d="M0 136.62 A5.62513 5.62513 -180 0 0 5.62 142.25 L707.75 142.25 A5.62513 5.62513 -180 0 0 713.37 136.62 L713.37					 6.37 A5.62513 5.62513 -180 0 0 707.75 0.75 L5.62 0.75 A5.62513 5.62513 -180 0 0 0 6.37 L0 136.62 Z" class="st1"></path>	</g>	<g id="shape3-3" v:mid="3" v:groupcontext="shape">		<title>Sheet.3</title>		<path d="M708.12 0.75 C711.02 0.75 713.37 3.11 713.37 6 L713.37 136.25 C713.37 139.14 711.02 141.5 708.12 141.5 L6 141.5					 C3.11 141.5 0.75 139.14 0.75 136.25 L0.75 6 C0.75 3.11 3.11 0.75 6 0.75 L708.12 0.75 ZM708.12 0 L6 0 C2.69					 0 0 2.69 0 6 L0 136.25 C0 139.56 2.69 142.25 6 142.25 L708.12 142.25 C711.44 142.25 714.12 139.56 714.12					 136.25 L714.12 6 C714.12 2.69 711.44 0 708.12 0 Z" class="st2"></path>	</g>	<g id="shape7-5" v:mid="7" v:groupcontext="shape" transform="translate(15.875,-59.748)">		<title>Sheet.7</title>		<desc>camsrc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="123.498" width="120.01" height="37.5"></v:textrect>		<path d="M0 139.25 A3.00007 3.00007 -180 0 0 3 142.25 L117 142.25 A3.00007 3.00007 -180 0 0 120 139.25 L120 107.75 A3.00007					 3.00007 -180 0 0 117 104.75 L3 104.75 A3.00007 3.00007 -180 0 0 -0 107.75 L0 139.25 Z" class="st3"></path>		<text x="40.07" y="127.1" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>camsrc</text>		</g>	<g id="shape9-8" v:mid="9" v:groupcontext="shape" transform="translate(135.875,-78.498)">		<title>Sheet.9</title>		<path d="M0 142.25 L13.5 142.25" class="st5"></path>	</g>	<g id="shape13-11" v:mid="13" v:groupcontext="shape" transform="translate(162.875,-89.748)">		<title>Sheet.13</title>		<desc>v4l2h264enc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="123.498" width="120" height="37.5"></v:textrect>		<path d="M0 139.25 A3.00007 3.00007 -180 0 0 3 142.25 L117 142.25 A3.00007 3.00007 -180 0 0 120 139.25 L120 107.75 A3.00007					 3.00007 -180 0 0 117 104.75 L3 104.75 A3.00007 3.00007 -180 0 0 -0 107.75 L0 139.25 Z" class="st3"></path>		<text x="25.86" y="127.1" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>v4l2h264enc</text>		</g>	<g id="shape16-14" v:mid="16" v:groupcontext="shape" transform="translate(282.875,-108.498)">		<title>Sheet.16</title>		<path d="M0 142.25 L14.44 142.25" class="st5"></path>	</g>	<g id="shape17-17" v:mid="17" v:groupcontext="shape" transform="translate(296.444,-105.506)">		<title>Sheet.17</title>		<path d="M0 142.25 L5.18 139.26 L0 136.26 L0 142.25 Z" class="st6"></path>	</g>	<g id="shape19-19" v:mid="19" v:groupcontext="shape" transform="translate(301.625,-89.748)">		<title>Sheet.19</title>		<desc>h264parse</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="123.498" width="120.01" height="37.5"></v:textrect>		<path d="M0 139.25 A3.00007 3.00007 -180 0 0 3 142.25 L117 142.25 A3.00007 3.00007 -180 0 0 120 139.25 L120 107.75 A3.00007					 3.00007 -180 0 0 117 104.75 L3 104.75 A3.00007 3.00007 -180 0 0 -0 107.75 L0 139.25 Z" class="st3"></path>		<text x="31.65" y="127.1" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>h264parse</text>		</g>	<g id="shape22-22" v:mid="22" v:groupcontext="shape" transform="translate(421.625,-108.498)">		<title>Sheet.22</title>		<path d="M0 142.25 L14.44 142.25" class="st5"></path>	</g>	<g id="shape23-25" v:mid="23" v:groupcontext="shape" transform="translate(435.194,-105.506)">		<title>Sheet.23</title>		<path d="M0 142.25 L5.18 139.26 L0 136.26 L0 142.25 Z" class="st6"></path>	</g>	<g id="shape25-27" v:mid="25" v:groupcontext="shape" transform="translate(440.375,-89.748)">		<title>Sheet.25</title>		<desc>mp4mux</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="123.498" width="120" height="37.5"></v:textrect>		<path d="M0 139.25 A3.00007 3.00007 -180 0 0 3 142.25 L117 142.25 A3.00007 3.00007 -180 0 0 120 139.25 L120 107.75 A3.00007					 3.00007 -180 0 0 117 104.75 L3 104.75 A3.00007 3.00007 -180 0 0 0 107.75 L0 139.25 Z" class="st3"></path>		<text x="36.47" y="127.1" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>mp4mux</text>		</g>	<g id="shape28-30" v:mid="28" v:groupcontext="shape" transform="translate(560.375,-108.498)">		<title>Sheet.28</title>		<path d="M0 142.25 L14.44 142.25" class="st5"></path>	</g>	<g id="shape29-33" v:mid="29" v:groupcontext="shape" transform="translate(573.944,-105.506)">		<title>Sheet.29</title>		<path d="M0 142.25 L5.18 139.26 L0 136.26 L0 142.25 Z" class="st6"></path>	</g>	<g id="shape31-35" v:mid="31" v:groupcontext="shape" transform="translate(579.125,-89.748)">		<title>Sheet.31</title>		<desc>filesink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="123.498" width="120" height="37.5"></v:textrect>		<path d="M0 139.25 A3.00007 3.00007 -180 0 0 3 142.25 L117 142.25 A3.00007 3.00007 -180 0 0 120 139.25 L120 107.75 A3.00007					 3.00007 -180 0 0 117 104.75 L3 104.75 A3.00007 3.00007 -180 0 0 0 107.75 L0 139.25 Z" class="st3"></path>		<text x="40.92" y="127.1" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>filesink</text>		</g>	<g id="shape35-38" v:mid="35" v:groupcontext="shape" transform="translate(162.875,-29.748)">		<title>Sheet.35</title>		<desc>v4l2h264enc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="123.498" width="120" height="37.5"></v:textrect>		<path d="M0 139.25 A3.00007 3.00007 -180 0 0 3 142.25 L117 142.25 A3.00007 3.00007 -180 0 0 120 139.25 L120 107.75 A3.00007					 3.00007 -180 0 0 117 104.75 L3 104.75 A3.00007 3.00007 -180 0 0 -0 107.75 L0 139.25 Z" class="st3"></path>		<text x="25.86" y="127.1" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>v4l2h264enc</text>		</g>	<g id="shape38-41" v:mid="38" v:groupcontext="shape" transform="translate(282.875,-48.498)">		<title>Sheet.38</title>		<path d="M0 142.25 L14.44 142.25" class="st5"></path>	</g>	<g id="shape39-44" v:mid="39" v:groupcontext="shape" transform="translate(296.444,-45.5062)">		<title>Sheet.39</title>		<path d="M0 142.25 L5.18 139.26 L0 136.26 L0 142.25 Z" class="st6"></path>	</g>	<g id="shape41-46" v:mid="41" v:groupcontext="shape" transform="translate(301.625,-29.748)">		<title>Sheet.41</title>		<desc>h264parse</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="123.498" width="120.01" height="37.5"></v:textrect>		<path d="M0 139.25 A3.00007 3.00007 -180 0 0 3 142.25 L117 142.25 A3.00007 3.00007 -180 0 0 120 139.25 L120 107.75 A3.00007					 3.00007 -180 0 0 117 104.75 L3 104.75 A3.00007 3.00007 -180 0 0 -0 107.75 L0 139.25 Z" class="st3"></path>		<text x="31.65" y="127.1" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>h264parse</text>		</g>	<g id="shape44-49" v:mid="44" v:groupcontext="shape" transform="translate(421.625,-48.498)">		<title>Sheet.44</title>		<path d="M0 142.25 L14.44 142.25" class="st5"></path>	</g>	<g id="shape45-52" v:mid="45" v:groupcontext="shape" transform="translate(435.194,-45.5062)">		<title>Sheet.45</title>		<path d="M0 142.25 L5.18 139.26 L0 136.26 L0 142.25 Z" class="st6"></path>	</g>	<g id="shape47-54" v:mid="47" v:groupcontext="shape" transform="translate(440.375,-29.748)">		<title>Sheet.47</title>		<desc>mp4mux</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="123.498" width="120" height="37.5"></v:textrect>		<path d="M0 139.25 A3.00007 3.00007 -180 0 0 3 142.25 L117 142.25 A3.00007 3.00007 -180 0 0 120 139.25 L120 107.75 A3.00007					 3.00007 -180 0 0 117 104.75 L3 104.75 A3.00007 3.00007 -180 0 0 0 107.75 L0 139.25 Z" class="st3"></path>		<text x="36.47" y="127.1" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>mp4mux</text>		</g>	<g id="shape50-57" v:mid="50" v:groupcontext="shape" transform="translate(560.375,-48.498)">		<title>Sheet.50</title>		<path d="M0 142.25 L14.44 142.25" class="st5"></path>	</g>	<g id="shape51-60" v:mid="51" v:groupcontext="shape" transform="translate(573.944,-45.5062)">		<title>Sheet.51</title>		<path d="M0 142.25 L5.18 139.26 L0 136.26 L0 142.25 Z" class="st6"></path>	</g>	<g id="shape53-62" v:mid="53" v:groupcontext="shape" transform="translate(579.125,-29.748)">		<title>Sheet.53</title>		<desc>filesink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="123.498" width="120" height="37.5"></v:textrect>		<path d="M0 139.25 A3.00007 3.00007 -180 0 0 3 142.25 L117 142.25 A3.00007 3.00007 -180 0 0 120 139.25 L120 107.75 A3.00007					 3.00007 -180 0 0 117 104.75 L3 104.75 A3.00007 3.00007 -180 0 0 0 107.75 L0 139.25 Z" class="st3"></path>		<text x="40.92" y="127.1" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>filesink</text>		</g>	<g id="shape56-65" v:mid="56" v:groupcontext="shape" transform="translate(149.375,-45.7478)">		<title>Sheet.56</title>		<path d="M9.19 79.5 L0 79.5 L0 142.25 L9.19 142.25 L9.19 79.5 Z" class="st7"></path>		<path d="M9.19 79.5 L0 79.5 L0 142.25 L9.19 142.25" class="st5"></path>	</g>	<g id="shape57-68" v:mid="57" v:groupcontext="shape" transform="translate(157.694,-105.506)">		<title>Sheet.57</title>		<path d="M0 136.26 L5.18 139.26 L0 142.25 L0 136.26 Z" class="st6"></path>	</g>	<g id="shape58-70" v:mid="58" v:groupcontext="shape" transform="translate(157.694,-42.756)">		<title>Sheet.58</title>		<path d="M0 142.25 L5.18 139.26 L0 136.26 L0 142.25 Z" class="st6"></path>	</g>	<g id="group62-72" transform="translate(662.937,-6.69132)" v:mid="62" v:groupcontext="group">		<title>Sheet.62</title>		<g id="shape60-73" v:mid="60" v:groupcontext="shape" transform="translate(15.1883,0)">			<title>Sheet.60</title>			<desc>开源</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="10.5" cy="135.948" width="21.01" height="12.6"></v:textrect>			<rect x="0" y="129.648" width="21" height="12.6" class="st8"></rect>			<text x="0" y="139.44" class="st9" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>开源</text>			</g>		<g id="shape61-76" v:mid="61" v:groupcontext="shape" transform="translate(1.26898E-13,-0.218599)">			<title>Sheet.61</title>			<path d="M0 140.75 A1.50003 1.50003 -180 0 0 1.5 142.25 L10.5 142.25 A1.50003 1.50003 -180 0 0 12 140.75 L12 131.75						 A1.50003 1.50003 -180 0 0 10.5 130.25 L1.5 130.25 A1.50003 1.50003 -180 0 0 -0 131.75 L0 140.75 Z" class="st3"></path>		</g>	</g></g>
</svg>

## 来自实时源的三个 1080p AVC 数据流

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

该用例对来自摄像头的三路 1080p 流进行编码。每个编码的数据流都多路复用到不同的文件中。

在目标设备上运行用例：

    gst-launch-1.0 -e qtiqmmfsrc name=camsrc video_0::type=preview ! video/x-raw,format=NV12_Q08C,width=1920,height=1080,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! queue ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! queue ! h264parse ! mp4mux ! queue ! filesink location="/opt/mux1.mp4" camsrc. ! video/x-raw,format=NV12_Q08C,width=1920,height=1080,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! queue ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! queue ! h264parse ! mp4mux ! queue ! filesink location="/opt/mux2.mp4" camsrc. ! video/x-raw,format=NV12_Q08C,width=1920,height=1080,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! queue ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! queue ! h264parse ! mp4mux ! queue ! filesink location="/opt/mux3.mp4"Copy to clipboard

要停止用例，请使用 CTRL + C。从目标设备中拉取录制的内容，然后在主机上播放内容。

您可以在媒体播放器上播放 MP4 文件。

在主机的终端中，运行以下命令之一：

    scp -r root@[DEVICE IP-ADDR]:/opt/mux1.mp4 user1@[HOST IP-ADDR]:/workspaceCopy to clipboard

    scp -r root@[DEVICE IP-ADDR]:/opt/mux2.mp4 user1@[HOST IP-ADDR]:/workspaceCopy to clipboard

    scp -r root@[DEVICE IP-ADDR]:/opt/mux3.mp4 user1@[HOST IP-ADDR]:/workspaceCopy to clipboard

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

Figure : 用于编码三个 1080p 摄像头流的 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 pipeline_encoding_three_streams.svg pipeline_encoding_three_streams -->
<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.90625in" height="2.83897in" viewbox="0 0 713.25 204.406" xml:space="preserve" color-interpolation-filters="sRGB" class="st10"><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 { fill: #007884; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-3 .st4 { fill: #ffffff; font-family: Roboto; font-size: 1.00001em }
.svg-3 .st5 { stroke: #000000; stroke-linecap: butt; stroke-width: 0.75 }
.svg-3 .st6 { fill: #000000; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-3 .st7 { fill: none }
.svg-3 .st8 { fill: none; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-3 .st9 { fill: #000000; font-family: SimHei; font-size: 0.874992em }
.svg-3 .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>pipeline_encoding_three_streams</title>	<v:pageproperties v:drawingscale="1" v:pagescale="1" v:drawingunits="19" v:shadowoffsetx="9" v:shadowoffsety="-9"></v:pageproperties>	<g id="shape3-1" v:mid="3" v:groupcontext="shape" transform="translate(0.375,-0.374828)">		<title>Sheet.3</title>		<path d="M0 198.78 A5.62513 5.62513 -180 0 0 5.63 204.41 L706.88 204.41 A5.62513 5.62513 -180 0 0 712.5 198.78 L712.5					 6.37 A5.62513 5.62513 -180 0 0 706.88 0.75 L5.62 0.75 A5.62513 5.62513 -180 0 0 -0 6.37 L0 198.78 Z" class="st1"></path>	</g>	<g id="shape4-3" v:mid="4" v:groupcontext="shape">		<title>Sheet.4</title>		<path d="M707.25 0.75 C710.14 0.75 712.5 3.11 712.5 6 L712.5 198.41 C712.5 201.3 710.14 203.66 707.25 203.66 L6 203.66					 C3.11 203.66 0.75 201.3 0.75 198.41 L0.75 6 C0.75 3.11 3.11 0.75 6 0.75 L707.25 0.75 ZM707.25 0 L6 0 C2.69					 0 0 2.69 0 6 L0 198.41 C0 201.72 2.69 204.41 6 204.41 L707.25 204.41 C710.56 204.41 713.25 201.72 713.25					 198.41 L713.25 6 C713.25 2.69 710.56 0 707.25 0 Z" class="st2"></path>	</g>	<g id="shape10-5" v:mid="10" v:groupcontext="shape" transform="translate(15,-91.9059)">		<title>Sheet.10</title>		<desc>camsrc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120.01" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="40.07" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>camsrc</text>		</g>	<g id="shape13-8" v:mid="13" v:groupcontext="shape" transform="translate(135,-110.656)">		<title>Sheet.13</title>		<path d="M0 204.41 L23.23 204.41" class="st5"></path>	</g>	<g id="shape14-11" v:mid="14" v:groupcontext="shape" transform="translate(157.467,-108.038)">		<title>Sheet.14</title>		<path d="M0 204.41 L4.53 201.79 L0 199.17 L0 204.41 Z" class="st6"></path>	</g>	<g id="shape18-13" v:mid="18" v:groupcontext="shape" transform="translate(162,-91.9059)">		<title>Sheet.18</title>		<desc>v4l2h264enc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="25.86" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>v4l2h264enc</text>		</g>	<g id="shape21-16" v:mid="21" v:groupcontext="shape" transform="translate(282,-110.656)">		<title>Sheet.21</title>		<path d="M0 204.41 L14.98 204.41" class="st5"></path>	</g>	<g id="shape22-19" v:mid="22" v:groupcontext="shape" transform="translate(296.216,-108.038)">		<title>Sheet.22</title>		<path d="M0 204.41 L4.53 201.79 L0 199.17 L0 204.41 Z" class="st6"></path>	</g>	<g id="shape24-21" v:mid="24" v:groupcontext="shape" transform="translate(300.75,-91.9059)">		<title>Sheet.24</title>		<desc>h264parse</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120.01" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="31.65" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>h264parse</text>		</g>	<g id="shape27-24" v:mid="27" v:groupcontext="shape" transform="translate(420.75,-110.656)">		<title>Sheet.27</title>		<path d="M0 204.41 L14.98 204.41" class="st5"></path>	</g>	<g id="shape28-27" v:mid="28" v:groupcontext="shape" transform="translate(434.966,-108.038)">		<title>Sheet.28</title>		<path d="M0 204.41 L4.53 201.79 L0 199.17 L0 204.41 Z" class="st6"></path>	</g>	<g id="shape30-29" v:mid="30" v:groupcontext="shape" transform="translate(439.5,-91.9059)">		<title>Sheet.30</title>		<desc>mpegtsmux</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="28.24" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>mpegtsmux</text>		</g>	<g id="shape33-32" v:mid="33" v:groupcontext="shape" transform="translate(559.5,-110.656)">		<title>Sheet.33</title>		<path d="M0 204.41 L14.98 204.41" class="st5"></path>	</g>	<g id="shape34-35" v:mid="34" v:groupcontext="shape" transform="translate(573.716,-108.038)">		<title>Sheet.34</title>		<path d="M0 204.41 L4.53 201.79 L0 199.17 L0 204.41 Z" class="st6"></path>	</g>	<g id="shape36-37" v:mid="36" v:groupcontext="shape" transform="translate(578.25,-91.9059)">		<title>Sheet.36</title>		<desc>filesink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="40.92" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>filesink</text>		</g>	<g id="shape40-40" v:mid="40" v:groupcontext="shape" transform="translate(162,-151.906)">		<title>Sheet.40</title>		<desc>v4l2h264enc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120" height="37.5"></v:textrect>		<path d="M-0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="25.86" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>v4l2h264enc</text>		</g>	<g id="shape43-43" v:mid="43" v:groupcontext="shape" transform="translate(282,-170.656)">		<title>Sheet.43</title>		<path d="M0 204.41 L14.98 204.41" class="st5"></path>	</g>	<g id="shape44-46" v:mid="44" v:groupcontext="shape" transform="translate(296.216,-168.038)">		<title>Sheet.44</title>		<path d="M0 204.41 L4.53 201.79 L0 199.17 L0 204.41 Z" class="st6"></path>	</g>	<g id="shape46-48" v:mid="46" v:groupcontext="shape" transform="translate(300.75,-151.906)">		<title>Sheet.46</title>		<desc>h264parse</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120.01" height="37.5"></v:textrect>		<path d="M-0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="31.65" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>h264parse</text>		</g>	<g id="shape49-51" v:mid="49" v:groupcontext="shape" transform="translate(420.75,-170.656)">		<title>Sheet.49</title>		<path d="M0 204.41 L14.98 204.41" class="st5"></path>	</g>	<g id="shape50-54" v:mid="50" v:groupcontext="shape" transform="translate(434.966,-168.038)">		<title>Sheet.50</title>		<path d="M0 204.41 L4.53 201.79 L0 199.17 L0 204.41 Z" class="st6"></path>	</g>	<g id="shape52-56" v:mid="52" v:groupcontext="shape" transform="translate(439.5,-151.906)">		<title>Sheet.52</title>		<desc>mp4mux</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="36.47" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>mp4mux</text>		</g>	<g id="shape55-59" v:mid="55" v:groupcontext="shape" transform="translate(559.5,-170.656)">		<title>Sheet.55</title>		<path d="M0 204.41 L14.98 204.41" class="st5"></path>	</g>	<g id="shape56-62" v:mid="56" v:groupcontext="shape" transform="translate(573.716,-168.038)">		<title>Sheet.56</title>		<path d="M0 204.41 L4.53 201.79 L0 199.17 L0 204.41 Z" class="st6"></path>	</g>	<g id="shape58-64" v:mid="58" v:groupcontext="shape" transform="translate(578.25,-151.906)">		<title>Sheet.58</title>		<desc>filesink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="40.92" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>filesink</text>		</g>	<g id="shape62-67" v:mid="62" v:groupcontext="shape" transform="translate(162,-31.9059)">		<title>Sheet.62</title>		<desc>v4l2h264enc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="25.86" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>v4l2h264enc</text>		</g>	<g id="shape65-70" v:mid="65" v:groupcontext="shape" transform="translate(282,-50.6559)">		<title>Sheet.65</title>		<path d="M0 204.41 L14.98 204.41" class="st5"></path>	</g>	<g id="shape66-73" v:mid="66" v:groupcontext="shape" transform="translate(296.216,-48.0381)">		<title>Sheet.66</title>		<path d="M0 204.41 L4.53 201.79 L0 199.17 L0 204.41 Z" class="st6"></path>	</g>	<g id="shape68-75" v:mid="68" v:groupcontext="shape" transform="translate(300.75,-31.9059)">		<title>Sheet.68</title>		<desc>h264parse</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120.01" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="31.65" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>h264parse</text>		</g>	<g id="shape71-78" v:mid="71" v:groupcontext="shape" transform="translate(420.75,-50.6559)">		<title>Sheet.71</title>		<path d="M0 204.41 L14.98 204.41" class="st5"></path>	</g>	<g id="shape72-81" v:mid="72" v:groupcontext="shape" transform="translate(434.966,-48.0381)">		<title>Sheet.72</title>		<path d="M0 204.41 L4.53 201.79 L0 199.17 L0 204.41 Z" class="st6"></path>	</g>	<g id="shape74-83" v:mid="74" v:groupcontext="shape" transform="translate(439.5,-31.9059)">		<title>Sheet.74</title>		<desc>mp4mux</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="36.47" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>mp4mux</text>		</g>	<g id="shape77-86" v:mid="77" v:groupcontext="shape" transform="translate(559.5,-50.6559)">		<title>Sheet.77</title>		<path d="M0 204.41 L14.98 204.41" class="st5"></path>	</g>	<g id="shape78-89" v:mid="78" v:groupcontext="shape" transform="translate(573.716,-48.0381)">		<title>Sheet.78</title>		<path d="M0 204.41 L4.53 201.79 L0 199.17 L0 204.41 Z" class="st6"></path>	</g>	<g id="shape80-91" v:mid="80" v:groupcontext="shape" transform="translate(578.25,-31.9059)">		<title>Sheet.80</title>		<desc>filesink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="40.92" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>filesink</text>		</g>	<g id="shape83-94" v:mid="83" v:groupcontext="shape" transform="translate(148.5,-47.9057)">		<title>Sheet.83</title>		<path d="M9.19 81.66 L0 81.66 L0 204.41 L9.19 204.41 L9.19 81.66 Z" class="st7"></path>		<path d="M9.19 81.66 L0 81.66 L0 204.41 L9.19 204.41" class="st5"></path>	</g>	<g id="shape84-97" v:mid="84" v:groupcontext="shape" transform="translate(156.819,-167.664)">		<title>Sheet.84</title>		<path d="M0 198.42 L5.18 201.41 L0 204.41 L0 198.42 Z" class="st6"></path>	</g>	<g id="shape85-99" v:mid="85" v:groupcontext="shape" transform="translate(156.819,-44.9139)">		<title>Sheet.85</title>		<path d="M0 204.41 L5.18 201.41 L0 198.42 L0 204.41 Z" class="st6"></path>	</g>	<g id="group86-101" transform="translate(662.062,-9.18727)" v:mid="86" v:groupcontext="group">		<title>Sheet.86</title>		<g id="shape6-102" 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="198.106" width="21" height="12.6"></v:textrect>			<rect x="0" y="191.806" width="21" height="12.6" class="st8"></rect>			<text x="0" y="201.6" class="st9" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>开源</text>			</g>		<g id="shape7-105" v:mid="7" v:groupcontext="shape" transform="translate(6.29496E-14,-0.21863)">			<title>Sheet.7</title>			<path d="M0 202.91 A1.50003 1.50003 -180 0 0 1.5 204.41 L10.5 204.41 A1.50003 1.50003 -180 0 0 12 202.91 L12 193.91						 A1.50003 1.50003 -180 0 0 10.5 192.41 L1.5 192.41 A1.50003 1.50003 -180 0 0 -0 193.91 L0 202.91 Z" class="st3"></path>		</g>	</g></g>
</svg>

## 三路流 - 来自实时源的 720p AVC、720p HEVC 和 720p YUV 流

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

该用例使用来自摄像头的三路 720p 流。对其中两路视频流进行编码 - 一路编码为 H.264，另一路编码为 HEVC。这些数据流被多路复用到不同的文件中。对第三路流进行显示。

Note: 此用例不适用于 Dragonwing IQ-8275 和 Dragonwing IQ-9075。

在目标设备上运行用例：

    gst-launch-1.0 -e qtiqmmfsrc name=camsrc video_0::type=preview video_1::type=video ! video/x-raw,format=NV12_Q08C,width=1280,height=720,framerate=30/1 ! queue ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! queue ! h264parse ! mp4mux ! queue ! filesink location="/opt/mux1.mp4" camsrc. ! video/x-raw,format=NV12_Q08C,width=1280,height=720,framerate=30/1 ! queue ! v4l2h265enc capture-io-mode=4 output-io-mode=5 ! queue ! h265parse ! mp4mux ! queue ! filesink location="/opt/mux_hevc.mp4" camsrc. ! video/x-raw,format=NV12_Q08C,width=1280,height=720,framerate=30/1 ! waylandsink fullscreen=trueCopy to clipboard

要停止用例，请使用 CTRL + C。从目标设备中拉取录制的内容，然后在主机上播放内容。

显示摄像头流。您可以在媒体播放器上播放 MP4 文件。

在主机的终端中，运行以下命令：

    scp -r root@[DEVICE IP-ADDR]:/opt/mux1.mp4 user1@[HOST IP-ADDR]:/workspace/Copy to clipboard

    scp -r root@[DEVICE IP-ADDR]:/opt/mux_hevc.mp4 user1@[HOST IP-ADDR]:/workspace/Copy to clipboard

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

Figure : 用于对 720p AVC、720p HEVC 和 720p YUV 摄像头流进行编码的 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 pipeline_encoding_avc_hevc_p_camera_streams.svg pipeline_encoding_avc_hevc_p_ca -->
<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.90625in" height="2.83897in" viewbox="0 0 713.25 204.406" 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 { fill: #007884; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-4 .st4 { fill: #ffffff; font-family: Roboto; font-size: 1.00001em }
.svg-4 .st5 { stroke: #000000; stroke-linecap: butt; stroke-width: 0.75 }
.svg-4 .st6 { fill: #000000; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-4 .st7 { fill: none }
.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>pipeline_encoding_avc_hevc_p_ca</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.374851)">		<title>Sheet.2</title>		<path d="M0 198.78 A5.62513 5.62513 -180 0 0 5.63 204.41 L706.88 204.41 A5.62513 5.62513 -180 0 0 712.5 198.78 L712.5					 6.37 A5.62513 5.62513 -180 0 0 706.88 0.75 L5.62 0.75 A5.62513 5.62513 -180 0 0 -0 6.37 L0 198.78 Z" class="st1"></path>	</g>	<g id="shape3-3" v:mid="3" v:groupcontext="shape">		<title>Sheet.3</title>		<path d="M707.25 0.75 C710.14 0.75 712.5 3.11 712.5 6 L712.5 198.41 C712.5 201.3 710.14 203.66 707.25 203.66 L6 203.66					 C3.11 203.66 0.75 201.3 0.75 198.41 L0.75 6 C0.75 3.11 3.11 0.75 6 0.75 L707.25 0.75 ZM707.25 0 L6 0 C2.69					 0 0 2.69 0 6 L0 198.41 C0 201.72 2.69 204.41 6 204.41 L707.25 204.41 C710.56 204.41 713.25 201.72 713.25					 198.41 L713.25 6 C713.25 2.69 710.56 0 707.25 0 Z" class="st2"></path>	</g>	<g id="shape7-5" v:mid="7" v:groupcontext="shape" transform="translate(15,-91.9059)">		<title>Sheet.7</title>		<desc>camsrc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120.01" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="40.07" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>camsrc</text>		</g>	<g id="shape10-8" v:mid="10" v:groupcontext="shape" transform="translate(135,-110.656)">		<title>Sheet.10</title>		<path d="M0 204.41 L23.23 204.41" class="st5"></path>	</g>	<g id="shape11-11" v:mid="11" v:groupcontext="shape" transform="translate(157.467,-108.038)">		<title>Sheet.11</title>		<path d="M0 204.41 L4.53 201.79 L0 199.17 L0 204.41 Z" class="st6"></path>	</g>	<g id="shape15-13" v:mid="15" v:groupcontext="shape" transform="translate(162,-91.9059)">		<title>Sheet.15</title>		<desc>v4l2h265enc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="25.86" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>v4l2h265enc</text>		</g>	<g id="shape18-16" v:mid="18" v:groupcontext="shape" transform="translate(282,-110.656)">		<title>Sheet.18</title>		<path d="M0 204.41 L14.98 204.41" class="st5"></path>	</g>	<g id="shape19-19" v:mid="19" v:groupcontext="shape" transform="translate(296.216,-108.038)">		<title>Sheet.19</title>		<path d="M0 204.41 L4.53 201.79 L0 199.17 L0 204.41 Z" class="st6"></path>	</g>	<g id="shape21-21" v:mid="21" v:groupcontext="shape" transform="translate(300.75,-91.9059)">		<title>Sheet.21</title>		<desc>h265parse</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120.01" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="31.65" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>h265parse</text>		</g>	<g id="shape24-24" v:mid="24" v:groupcontext="shape" transform="translate(420.75,-110.656)">		<title>Sheet.24</title>		<path d="M0 204.41 L14.98 204.41" class="st5"></path>	</g>	<g id="shape25-27" v:mid="25" v:groupcontext="shape" transform="translate(434.966,-108.038)">		<title>Sheet.25</title>		<path d="M0 204.41 L4.53 201.79 L0 199.17 L0 204.41 Z" class="st6"></path>	</g>	<g id="shape27-29" v:mid="27" v:groupcontext="shape" transform="translate(439.5,-91.9059)">		<title>Sheet.27</title>		<desc>mp4mux</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="36.47" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>mp4mux</text>		</g>	<g id="shape30-32" v:mid="30" v:groupcontext="shape" transform="translate(559.5,-110.656)">		<title>Sheet.30</title>		<path d="M0 204.41 L14.98 204.41" class="st5"></path>	</g>	<g id="shape31-35" v:mid="31" v:groupcontext="shape" transform="translate(573.716,-108.038)">		<title>Sheet.31</title>		<path d="M0 204.41 L4.53 201.79 L0 199.17 L0 204.41 Z" class="st6"></path>	</g>	<g id="shape33-37" v:mid="33" v:groupcontext="shape" transform="translate(578.25,-91.9059)">		<title>Sheet.33</title>		<desc>filesink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="40.92" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>filesink</text>		</g>	<g id="shape37-40" v:mid="37" v:groupcontext="shape" transform="translate(162,-151.906)">		<title>Sheet.37</title>		<desc>v4l2h264enc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 -0 169.91 L0 201.41 Z" class="st3"></path>		<text x="25.86" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>v4l2h264enc</text>		</g>	<g id="shape40-43" v:mid="40" v:groupcontext="shape" transform="translate(282,-170.656)">		<title>Sheet.40</title>		<path d="M0 204.41 L14.98 204.41" class="st5"></path>	</g>	<g id="shape41-46" v:mid="41" v:groupcontext="shape" transform="translate(296.216,-168.038)">		<title>Sheet.41</title>		<path d="M0 204.41 L4.53 201.79 L0 199.17 L0 204.41 Z" class="st6"></path>	</g>	<g id="shape43-48" v:mid="43" v:groupcontext="shape" transform="translate(300.75,-151.906)">		<title>Sheet.43</title>		<desc>h264parse</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120.01" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 -0 169.91 L0 201.41 Z" class="st3"></path>		<text x="31.65" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>h264parse</text>		</g>	<g id="shape46-51" v:mid="46" v:groupcontext="shape" transform="translate(420.75,-170.656)">		<title>Sheet.46</title>		<path d="M0 204.41 L14.98 204.41" class="st5"></path>	</g>	<g id="shape47-54" v:mid="47" v:groupcontext="shape" transform="translate(434.966,-168.038)">		<title>Sheet.47</title>		<path d="M0 204.41 L4.53 201.79 L0 199.17 L0 204.41 Z" class="st6"></path>	</g>	<g id="shape49-56" v:mid="49" v:groupcontext="shape" transform="translate(439.5,-151.906)">		<title>Sheet.49</title>		<desc>mp4mux</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="36.47" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>mp4mux</text>		</g>	<g id="shape52-59" v:mid="52" v:groupcontext="shape" transform="translate(559.5,-170.656)">		<title>Sheet.52</title>		<path d="M0 204.41 L14.98 204.41" class="st5"></path>	</g>	<g id="shape53-62" v:mid="53" v:groupcontext="shape" transform="translate(573.716,-168.038)">		<title>Sheet.53</title>		<path d="M0 204.41 L4.53 201.79 L0 199.17 L0 204.41 Z" class="st6"></path>	</g>	<g id="shape55-64" v:mid="55" v:groupcontext="shape" transform="translate(578.25,-151.906)">		<title>Sheet.55</title>		<desc>filesink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="40.92" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>filesink</text>		</g>	<g id="shape58-67" v:mid="58" v:groupcontext="shape" transform="translate(162,-31.9059)">		<title>Sheet.58</title>		<desc>Waylandsink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="26.26" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Waylandsink</text>		</g>	<g id="shape61-70" v:mid="61" v:groupcontext="shape" transform="translate(148.5,-47.9057)">		<title>Sheet.61</title>		<path d="M9.19 81.66 L0 81.66 L0 204.41 L9.19 204.41 L9.19 81.66 Z" class="st7"></path>		<path d="M9.19 81.66 L0 81.66 L0 204.41 L9.19 204.41" class="st5"></path>	</g>	<g id="shape62-73" v:mid="62" v:groupcontext="shape" transform="translate(156.819,-167.664)">		<title>Sheet.62</title>		<path d="M0 198.42 L5.18 201.41 L0 204.41 L0 198.42 Z" class="st6"></path>	</g>	<g id="shape63-75" v:mid="63" v:groupcontext="shape" transform="translate(156.819,-44.914)">		<title>Sheet.63</title>		<path d="M0 204.41 L5.18 201.41 L0 198.42 L0 204.41 Z" class="st6"></path>	</g>	<g id="group67-77" transform="translate(662.062,-11.4373)" v:mid="67" v:groupcontext="group">		<title>Sheet.67</title>		<g id="shape65-78" v:mid="65" v:groupcontext="shape" transform="translate(15.1883,0)">			<title>Sheet.65</title>			<desc>开源</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="10.5" cy="198.106" width="21" height="12.6"></v:textrect>			<rect x="0" y="191.806" width="21" height="12.6" class="st8"></rect>			<text x="0" y="201.6" class="st9" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>开源</text>			</g>		<g id="shape66-81" v:mid="66" v:groupcontext="shape" transform="translate(6.29496E-14,-0.21863)">			<title>Sheet.66</title>			<path d="M0 202.91 A1.50003 1.50003 -180 0 0 1.5 204.41 L10.5 204.41 A1.50003 1.50003 -180 0 0 12 202.91 L12 193.91						 A1.50003 1.50003 -180 0 0 10.5 192.41 L1.5 192.41 A1.50003 1.50003 -180 0 0 -0 193.91 L0 202.91 Z" class="st3"></path>		</g>	</g></g>
</svg>

## 三路流 - 来自实时源的 720p AVC MP4、720p AVC MPEGTS 和 720p AVC MP4 流

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

该用例使用来自摄像头的三路 720p 流进行编码。每路视频流都编码为 H.264 并复用到不同的文件中 - 两路为 MP4，一路为 MPEGTS。

在目标设备上运行用例：

    gst-launch-1.0 -e qtiqmmfsrc name=camsrc 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 ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! queue ! h264parse ! mp4mux ! queue ! filesink location="/opt/mux1.mp4" camsrc. ! video/x-raw,format=NV12_Q08C,width=1280,height=720,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! queue ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! queue ! h264parse ! mpegtsmux name=muxer ! queue ! filesink location="/opt/mux_mpegts.mp4" camsrc. ! video/x-raw,format=NV12_Q08C,width=1280,height=720,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! queue ! v4l2h265enc capture-io-mode=4 output-io-mode=5 ! queue ! h265parse ! mp4mux ! queue ! filesink location="/opt/mux3.mp4"Copy to clipboard

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

从目标设备中拉取录制的内容，然后使用媒体播放器在主机上播放内容。

在主机的终端中，运行以下命令：

    scp -r root@[DEVICE IP-ADDR]:/opt/mux1.mp4 user1@[HOST IP-ADDR]:/workspaceCopy to clipboard

    scp -r root@[DEVICE IP-ADDR]:/opt/mux_mpegts.mp4 user1@[HOST IP-ADDR]:/workspaceCopy to clipboard

    scp -r root@[DEVICE IP-ADDR]:/opt/mux3.mp4 user1@[HOST IP-ADDR]:/workspaceCopy to clipboard

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

Figure : 用于对 720p AVC MP4、720p AVC MPEGTS 和 720p AVC MP4 摄像头流进行编码的 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 pipeline_encoding_avc_mpegts_mp4_stream.svg pipeline_encoding_avc_mpegts_mp -->
<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.90625in" height="2.83897in" viewbox="0 0 713.25 204.406" xml:space="preserve" color-interpolation-filters="sRGB" class="st10"><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 { fill: #007884; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-5 .st4 { fill: #ffffff; font-family: Roboto; font-size: 1.00001em }
.svg-5 .st5 { stroke: #000000; stroke-linecap: butt; stroke-width: 0.75 }
.svg-5 .st6 { fill: #000000; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-5 .st7 { fill: none }
.svg-5 .st8 { fill: none; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-5 .st9 { fill: #000000; font-family: SimHei; font-size: 0.874992em }
.svg-5 .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>pipeline_encoding_avc_mpegts_mp</title>	<v:pageproperties v:drawingscale="1" v:pagescale="1" v:drawingunits="19" v:shadowoffsetx="9" v:shadowoffsety="-9"></v:pageproperties>	<g id="shape3-1" v:mid="3" v:groupcontext="shape" transform="translate(0.375,-0.37484)">		<title>Sheet.3</title>		<path d="M0 198.78 A5.62513 5.62513 -180 0 0 5.63 204.41 L706.88 204.41 A5.62513 5.62513 -180 0 0 712.5 198.78 L712.5					 6.37 A5.62513 5.62513 -180 0 0 706.88 0.75 L5.62 0.75 A5.62513 5.62513 -180 0 0 -0 6.37 L0 198.78 Z" class="st1"></path>	</g>	<g id="shape4-3" v:mid="4" v:groupcontext="shape">		<title>Sheet.4</title>		<path d="M707.25 0.75 C710.14 0.75 712.5 3.11 712.5 6 L712.5 198.41 C712.5 201.3 710.14 203.66 707.25 203.66 L6 203.66					 C3.11 203.66 0.75 201.3 0.75 198.41 L0.75 6 C0.75 3.11 3.11 0.75 6 0.75 L707.25 0.75 ZM707.25 0 L6 0 C2.69					 0 0 2.69 0 6 L0 198.41 C0 201.72 2.69 204.41 6 204.41 L707.25 204.41 C710.56 204.41 713.25 201.72 713.25					 198.41 L713.25 6 C713.25 2.69 710.56 0 707.25 0 Z" class="st2"></path>	</g>	<g id="shape10-5" v:mid="10" v:groupcontext="shape" transform="translate(15,-91.9059)">		<title>Sheet.10</title>		<desc>camsrc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120.01" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="40.07" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>camsrc</text>		</g>	<g id="shape13-8" v:mid="13" v:groupcontext="shape" transform="translate(135,-110.656)">		<title>Sheet.13</title>		<path d="M0 204.41 L23.23 204.41" class="st5"></path>	</g>	<g id="shape14-11" v:mid="14" v:groupcontext="shape" transform="translate(157.467,-108.038)">		<title>Sheet.14</title>		<path d="M0 204.41 L4.53 201.79 L0 199.17 L0 204.41 Z" class="st6"></path>	</g>	<g id="shape18-13" v:mid="18" v:groupcontext="shape" transform="translate(162,-91.9059)">		<title>Sheet.18</title>		<desc>v4l2h264enc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="25.86" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>v4l2h264enc</text>		</g>	<g id="shape21-16" v:mid="21" v:groupcontext="shape" transform="translate(282,-110.656)">		<title>Sheet.21</title>		<path d="M0 204.41 L14.98 204.41" class="st5"></path>	</g>	<g id="shape22-19" v:mid="22" v:groupcontext="shape" transform="translate(296.216,-108.038)">		<title>Sheet.22</title>		<path d="M0 204.41 L4.53 201.79 L0 199.17 L0 204.41 Z" class="st6"></path>	</g>	<g id="shape24-21" v:mid="24" v:groupcontext="shape" transform="translate(300.75,-91.9059)">		<title>Sheet.24</title>		<desc>h264parse</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120.01" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="31.65" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>h264parse</text>		</g>	<g id="shape27-24" v:mid="27" v:groupcontext="shape" transform="translate(420.75,-110.656)">		<title>Sheet.27</title>		<path d="M0 204.41 L14.98 204.41" class="st5"></path>	</g>	<g id="shape28-27" v:mid="28" v:groupcontext="shape" transform="translate(434.966,-108.038)">		<title>Sheet.28</title>		<path d="M0 204.41 L4.53 201.79 L0 199.17 L0 204.41 Z" class="st6"></path>	</g>	<g id="shape30-29" v:mid="30" v:groupcontext="shape" transform="translate(439.5,-91.9059)">		<title>Sheet.30</title>		<desc>mpegtsmux</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="28.24" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>mpegtsmux</text>		</g>	<g id="shape33-32" v:mid="33" v:groupcontext="shape" transform="translate(559.5,-110.656)">		<title>Sheet.33</title>		<path d="M0 204.41 L14.98 204.41" class="st5"></path>	</g>	<g id="shape34-35" v:mid="34" v:groupcontext="shape" transform="translate(573.716,-108.038)">		<title>Sheet.34</title>		<path d="M0 204.41 L4.53 201.79 L0 199.17 L0 204.41 Z" class="st6"></path>	</g>	<g id="shape36-37" v:mid="36" v:groupcontext="shape" transform="translate(578.25,-91.9059)">		<title>Sheet.36</title>		<desc>filesink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="40.92" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>filesink</text>		</g>	<g id="shape40-40" v:mid="40" v:groupcontext="shape" transform="translate(162,-151.906)">		<title>Sheet.40</title>		<desc>v4l2h264enc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="25.86" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>v4l2h264enc</text>		</g>	<g id="shape43-43" v:mid="43" v:groupcontext="shape" transform="translate(282,-170.656)">		<title>Sheet.43</title>		<path d="M0 204.41 L14.98 204.41" class="st5"></path>	</g>	<g id="shape44-46" v:mid="44" v:groupcontext="shape" transform="translate(296.216,-168.038)">		<title>Sheet.44</title>		<path d="M0 204.41 L4.53 201.79 L0 199.17 L0 204.41 Z" class="st6"></path>	</g>	<g id="shape46-48" v:mid="46" v:groupcontext="shape" transform="translate(300.75,-151.906)">		<title>Sheet.46</title>		<desc>h264parse</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120.01" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="31.65" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>h264parse</text>		</g>	<g id="shape49-51" v:mid="49" v:groupcontext="shape" transform="translate(420.75,-170.656)">		<title>Sheet.49</title>		<path d="M0 204.41 L14.98 204.41" class="st5"></path>	</g>	<g id="shape50-54" v:mid="50" v:groupcontext="shape" transform="translate(434.966,-168.038)">		<title>Sheet.50</title>		<path d="M0 204.41 L4.53 201.79 L0 199.17 L0 204.41 Z" class="st6"></path>	</g>	<g id="shape52-56" v:mid="52" v:groupcontext="shape" transform="translate(439.5,-151.906)">		<title>Sheet.52</title>		<desc>mp4mux</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="36.47" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>mp4mux</text>		</g>	<g id="shape55-59" v:mid="55" v:groupcontext="shape" transform="translate(559.5,-170.656)">		<title>Sheet.55</title>		<path d="M0 204.41 L14.98 204.41" class="st5"></path>	</g>	<g id="shape56-62" v:mid="56" v:groupcontext="shape" transform="translate(573.716,-168.038)">		<title>Sheet.56</title>		<path d="M0 204.41 L4.53 201.79 L0 199.17 L0 204.41 Z" class="st6"></path>	</g>	<g id="shape58-64" v:mid="58" v:groupcontext="shape" transform="translate(578.25,-151.906)">		<title>Sheet.58</title>		<desc>filesink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="40.92" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>filesink</text>		</g>	<g id="shape62-67" v:mid="62" v:groupcontext="shape" transform="translate(162,-31.9059)">		<title>Sheet.62</title>		<desc>v4l2h264enc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="25.86" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>v4l2h264enc</text>		</g>	<g id="shape65-70" v:mid="65" v:groupcontext="shape" transform="translate(282,-50.6559)">		<title>Sheet.65</title>		<path d="M0 204.41 L14.98 204.41" class="st5"></path>	</g>	<g id="shape66-73" v:mid="66" v:groupcontext="shape" transform="translate(296.216,-48.0381)">		<title>Sheet.66</title>		<path d="M0 204.41 L4.53 201.79 L0 199.17 L0 204.41 Z" class="st6"></path>	</g>	<g id="shape68-75" v:mid="68" v:groupcontext="shape" transform="translate(300.75,-31.9059)">		<title>Sheet.68</title>		<desc>h264parse</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120.01" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="31.65" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>h264parse</text>		</g>	<g id="shape71-78" v:mid="71" v:groupcontext="shape" transform="translate(420.75,-50.6559)">		<title>Sheet.71</title>		<path d="M0 204.41 L14.98 204.41" class="st5"></path>	</g>	<g id="shape72-81" v:mid="72" v:groupcontext="shape" transform="translate(434.966,-48.0381)">		<title>Sheet.72</title>		<path d="M0 204.41 L4.53 201.79 L0 199.17 L0 204.41 Z" class="st6"></path>	</g>	<g id="shape74-83" v:mid="74" v:groupcontext="shape" transform="translate(439.5,-31.9059)">		<title>Sheet.74</title>		<desc>mp4mux</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="36.47" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>mp4mux</text>		</g>	<g id="shape77-86" v:mid="77" v:groupcontext="shape" transform="translate(559.5,-50.6559)">		<title>Sheet.77</title>		<path d="M0 204.41 L14.98 204.41" class="st5"></path>	</g>	<g id="shape78-89" v:mid="78" v:groupcontext="shape" transform="translate(573.716,-48.0381)">		<title>Sheet.78</title>		<path d="M0 204.41 L4.53 201.79 L0 199.17 L0 204.41 Z" class="st6"></path>	</g>	<g id="shape80-91" v:mid="80" v:groupcontext="shape" transform="translate(578.25,-31.9059)">		<title>Sheet.80</title>		<desc>filesink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="40.92" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>filesink</text>		</g>	<g id="shape83-94" v:mid="83" v:groupcontext="shape" transform="translate(148.5,-47.9057)">		<title>Sheet.83</title>		<path d="M9.19 81.66 L0 81.66 L0 204.41 L9.19 204.41 L9.19 81.66 Z" class="st7"></path>		<path d="M9.19 81.66 L0 81.66 L0 204.41 L9.19 204.41" class="st5"></path>	</g>	<g id="shape84-97" v:mid="84" v:groupcontext="shape" transform="translate(156.819,-167.664)">		<title>Sheet.84</title>		<path d="M0 198.42 L5.18 201.41 L0 204.41 L0 198.42 Z" class="st6"></path>	</g>	<g id="shape85-99" v:mid="85" v:groupcontext="shape" transform="translate(156.819,-44.9139)">		<title>Sheet.85</title>		<path d="M0 204.41 L5.18 201.41 L0 198.42 L0 204.41 Z" class="st6"></path>	</g>	<g id="group86-101" transform="translate(662.062,-9.18728)" v:mid="86" v:groupcontext="group">		<title>Sheet.86</title>		<g id="shape6-102" v:mid="6" v:groupcontext="shape" transform="translate(15.1883,2.84217E-14)">			<title>Sheet.6</title>			<desc>开源</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="10.5" cy="198.106" width="21" height="12.6"></v:textrect>			<rect x="0" y="191.806" width="21" height="12.6" class="st8"></rect>			<text x="0" y="201.6" class="st9" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>开源</text>			</g>		<g id="shape7-105" v:mid="7" v:groupcontext="shape" transform="translate(6.29496E-14,-0.218627)">			<title>Sheet.7</title>			<path d="M0 202.91 A1.50003 1.50003 -180 0 0 1.5 204.41 L10.5 204.41 A1.50003 1.50003 -180 0 0 12 202.91 L12 193.91						 A1.50003 1.50003 -180 0 0 10.5 192.41 L1.5 192.41 A1.50003 1.50003 -180 0 0 -0 193.91 L0 202.91 Z" class="st3"></path>		</g>	</g></g>
</svg>

## 三路流 – 来自实时源的 1080p AVC 文件保存、1080p AVC RTSP 和 1080p YUV 流

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

用例使用来自摄像头的三路 1080p 流。两路流编码为 H.264。第一个数据流被多路复用并保存到文件中。第二路流通过 RTSP 流在网络上发送。第三个流被发送到显示器。

在目标设备上运行用例，如下所示：

使用 `udpsrc` 在目标设备上的单独控制台中运行 RTSP 服务器（可作为服务在后台运行）：

    gst-rtsp-server -p 8900 -a <IP address of device>  -m /live "( udpsrc name=pay0 port=8554 caps=\"application/x-rtp,media=video,clock-rate=90000,encoding-name=H264,payload=96\" )"Copy to clipboard

在目标设备的同一控制台或其他控制台中运行 pipeline：

**1080P 用例：**

    gst-launch-1.0 -e qtiqmmfsrc name=camsrc video_0::type=preview ! video/x-raw,format=NV12_Q08C,width=1920,height=1080,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! queue ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! queue ! h264parse ! mp4mux ! queue ! filesink location="/opt/mux.mp4" camsrc. ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! queue ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! queue ! h264parse config-interval=-1 ! rtph264pay pt=96 ! udpsink host=<IP address of device> port=8554 camsrc. ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! waylandsink fullscreen=trueCopy to clipboard

**720P 用例：**

    gst-launch-1.0 -e qtiqmmfsrc name=camsrc video_0::type=preview ! video/x-raw,format=NV12_Q08C,width=1280,height=720,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! queue ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! queue ! h264parse ! mp4mux ! queue ! filesink location="/opt/mux.mp4" camsrc. ! video/x-raw,format=NV12,width=1280,height=720,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! queue ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! queue ! h264parse config-interval=-1 ! rtph264pay pt=96 ! udpsink host=<IP address of device> port=8554 camsrc. ! video/x-raw,format=NV12,width=1280,height=720,framerate=30/1 ! waylandsink fullscreen=trueCopy to clipboard

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

从目标设备中拉取录制的内容，然后在主机上播放内容。

在主机的终端中，运行以下命令：

    scp -r root@[DEVICE IP-ADDR]:/opt/mux.mp4 user1@[HOST IP-ADDR]:/workspace/Copy to clipboard

您可以在任何媒体播放器上播放 MP4 文件。视频流在主机上作为 RTSP 流播放。显示来自摄像头的第三个流。

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

Figure : 用于编码三个 1080p 摄像头流的 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 pipeline_encoding_1080_streams.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="9.90625in" height="2.83897in" viewbox="0 0 713.25 204.406" xml:space="preserve" color-interpolation-filters="sRGB" class="st10"><v:documentproperties v:langid="1033" v:viewmarkup="false"></v:documentproperties>
<style>.svg-6 .st1 { fill: #fafafa; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-6 .st2 { fill: #d2d7e1; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-6 .st3 { fill: #007884; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-6 .st4 { fill: #ffffff; font-family: Roboto; font-size: 1.00001em }
.svg-6 .st5 { stroke: #000000; stroke-linecap: butt; stroke-width: 0.75 }
.svg-6 .st6 { fill: #000000; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-6 .st7 { fill: none }
.svg-6 .st8 { fill: none; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-6 .st9 { fill: #000000; font-family: SimHei; font-size: 0.874992em }
.svg-6 .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.37484)">		<title>Sheet.2</title>		<path d="M0 198.78 A5.62513 5.62513 -180 0 0 5.63 204.41 L706.88 204.41 A5.62513 5.62513 -180 0 0 712.5 198.78 L712.5					 6.37 A5.62513 5.62513 -180 0 0 706.88 0.75 L5.62 0.75 A5.62513 5.62513 -180 0 0 -0 6.37 L0 198.78 Z" class="st1"></path>	</g>	<g id="shape3-3" v:mid="3" v:groupcontext="shape">		<title>Sheet.3</title>		<path d="M707.25 0.75 C710.14 0.75 712.5 3.11 712.5 6 L712.5 198.41 C712.5 201.3 710.14 203.66 707.25 203.66 L6 203.66					 C3.11 203.66 0.75 201.3 0.75 198.41 L0.75 6 C0.75 3.11 3.11 0.75 6 0.75 L707.25 0.75 ZM707.25 0 L6 0 C2.69					 0 0 2.69 0 6 L0 198.41 C0 201.72 2.69 204.41 6 204.41 L707.25 204.41 C710.56 204.41 713.25 201.72 713.25					 198.41 L713.25 6 C713.25 2.69 710.56 0 707.25 0 Z" class="st2"></path>	</g>	<g id="shape9-5" v:mid="9" v:groupcontext="shape" transform="translate(15,-91.9059)">		<title>Sheet.9</title>		<desc>camsrc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120.01" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="40.07" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>camsrc</text>		</g>	<g id="shape12-8" v:mid="12" v:groupcontext="shape" transform="translate(135,-110.656)">		<title>Sheet.12</title>		<path d="M0 204.41 L23.23 204.41" class="st5"></path>	</g>	<g id="shape13-11" v:mid="13" v:groupcontext="shape" transform="translate(157.467,-108.038)">		<title>Sheet.13</title>		<path d="M0 204.41 L4.53 201.79 L0 199.17 L0 204.41 Z" class="st6"></path>	</g>	<g id="shape17-13" v:mid="17" v:groupcontext="shape" transform="translate(162,-91.9059)">		<title>Sheet.17</title>		<desc>v4l2h264enc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="25.86" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>v4l2h264enc</text>		</g>	<g id="shape20-16" v:mid="20" v:groupcontext="shape" transform="translate(282,-110.656)">		<title>Sheet.20</title>		<path d="M0 204.41 L14.98 204.41" class="st5"></path>	</g>	<g id="shape21-19" v:mid="21" v:groupcontext="shape" transform="translate(296.216,-108.038)">		<title>Sheet.21</title>		<path d="M0 204.41 L4.53 201.79 L0 199.17 L0 204.41 Z" class="st6"></path>	</g>	<g id="shape23-21" v:mid="23" v:groupcontext="shape" transform="translate(300.75,-91.9059)">		<title>Sheet.23</title>		<desc>h264parse</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="31.65" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>h264parse</text>		</g>	<g id="shape26-24" v:mid="26" v:groupcontext="shape" transform="translate(420.75,-110.656)">		<title>Sheet.26</title>		<path d="M0 204.41 L14.98 204.41" class="st5"></path>	</g>	<g id="shape27-27" v:mid="27" v:groupcontext="shape" transform="translate(434.966,-108.038)">		<title>Sheet.27</title>		<path d="M0 204.41 L4.53 201.79 L0 199.17 L0 204.41 Z" class="st6"></path>	</g>	<g id="shape29-29" v:mid="29" v:groupcontext="shape" transform="translate(439.5,-91.9059)">		<title>Sheet.29</title>		<desc>rtph264pay</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="29.76" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>rtph264pay</text>		</g>	<g id="shape32-32" v:mid="32" v:groupcontext="shape" transform="translate(559.5,-110.656)">		<title>Sheet.32</title>		<path d="M0 204.41 L14.98 204.41" class="st5"></path>	</g>	<g id="shape33-35" v:mid="33" v:groupcontext="shape" transform="translate(573.716,-108.038)">		<title>Sheet.33</title>		<path d="M0 204.41 L4.53 201.79 L0 199.17 L0 204.41 Z" class="st6"></path>	</g>	<g id="shape35-37" v:mid="35" v:groupcontext="shape" transform="translate(578.25,-91.9059)">		<title>Sheet.35</title>		<desc>udpsink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="39.04" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>udpsink</text>		</g>	<g id="shape39-40" v:mid="39" v:groupcontext="shape" transform="translate(162,-151.906)">		<title>Sheet.39</title>		<desc>v4l2h264enc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="25.86" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>v4l2h264enc</text>		</g>	<g id="shape42-43" v:mid="42" v:groupcontext="shape" transform="translate(282,-170.656)">		<title>Sheet.42</title>		<path d="M0 204.41 L14.98 204.41" class="st5"></path>	</g>	<g id="shape43-46" v:mid="43" v:groupcontext="shape" transform="translate(296.216,-168.038)">		<title>Sheet.43</title>		<path d="M0 204.41 L4.53 201.79 L0 199.17 L0 204.41 Z" class="st6"></path>	</g>	<g id="shape45-48" v:mid="45" v:groupcontext="shape" transform="translate(300.75,-151.906)">		<title>Sheet.45</title>		<desc>h264parse</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120.01" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="31.65" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>h264parse</text>		</g>	<g id="shape48-51" v:mid="48" v:groupcontext="shape" transform="translate(420.75,-170.656)">		<title>Sheet.48</title>		<path d="M0 204.41 L14.98 204.41" class="st5"></path>	</g>	<g id="shape49-54" v:mid="49" v:groupcontext="shape" transform="translate(434.966,-168.038)">		<title>Sheet.49</title>		<path d="M0 204.41 L4.53 201.79 L0 199.17 L0 204.41 Z" class="st6"></path>	</g>	<g id="shape51-56" v:mid="51" v:groupcontext="shape" transform="translate(439.5,-151.906)">		<title>Sheet.51</title>		<desc>mp4mux</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="36.47" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>mp4mux</text>		</g>	<g id="shape54-59" v:mid="54" v:groupcontext="shape" transform="translate(559.5,-170.656)">		<title>Sheet.54</title>		<path d="M0 204.41 L14.98 204.41" class="st5"></path>	</g>	<g id="shape55-62" v:mid="55" v:groupcontext="shape" transform="translate(573.716,-168.038)">		<title>Sheet.55</title>		<path d="M0 204.41 L4.53 201.79 L0 199.17 L0 204.41 Z" class="st6"></path>	</g>	<g id="shape57-64" v:mid="57" v:groupcontext="shape" transform="translate(578.25,-151.906)">		<title>Sheet.57</title>		<desc>filesink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="40.92" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>filesink</text>		</g>	<g id="shape60-67" v:mid="60" v:groupcontext="shape" transform="translate(162,-31.9059)">		<title>Sheet.60</title>		<desc>Waylandsink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="185.656" width="120" height="37.5"></v:textrect>		<path d="M0 201.41 A3.00007 3.00007 -180 0 0 3 204.41 L117 204.41 A3.00007 3.00007 -180 0 0 120 201.41 L120 169.91 A3.00007					 3.00007 -180 0 0 117 166.91 L3 166.91 A3.00007 3.00007 -180 0 0 0 169.91 L0 201.41 Z" class="st3"></path>		<text x="26.26" y="189.26" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Waylandsink</text>		</g>	<g id="shape63-70" v:mid="63" v:groupcontext="shape" transform="translate(148.5,-47.9057)">		<title>Sheet.63</title>		<path d="M9.19 81.66 L0 81.66 L0 204.41 L9.19 204.41 L9.19 81.66 Z" class="st7"></path>		<path d="M9.19 81.66 L0 81.66 L0 204.41 L9.19 204.41" class="st5"></path>	</g>	<g id="shape64-73" v:mid="64" v:groupcontext="shape" transform="translate(156.819,-167.664)">		<title>Sheet.64</title>		<path d="M0 198.42 L5.18 201.41 L0 204.41 L0 198.42 Z" class="st6"></path>	</g>	<g id="shape65-75" v:mid="65" v:groupcontext="shape" transform="translate(156.819,-44.9139)">		<title>Sheet.65</title>		<path d="M0 204.41 L5.18 201.41 L0 198.42 L0 204.41 Z" class="st6"></path>	</g>	<g id="group66-77" transform="translate(662.062,-9.18728)" v:mid="66" v:groupcontext="group">		<title>Sheet.66</title>		<g id="shape5-78" v:mid="5" v:groupcontext="shape" transform="translate(15.1883,2.84217E-14)">			<title>Sheet.5</title>			<desc>开源</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="10.5" cy="198.106" width="21" height="12.6"></v:textrect>			<rect x="0" y="191.806" width="21" height="12.6" class="st8"></rect>			<text x="0" y="201.6" class="st9" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>开源</text>			</g>		<g id="shape6-81" v:mid="6" v:groupcontext="shape" transform="translate(6.29496E-14,-0.218627)">			<title>Sheet.6</title>			<path d="M0 202.91 A1.50003 1.50003 -180 0 0 1.5 204.41 L10.5 204.41 A1.50003 1.50003 -180 0 0 12 202.91 L12 193.91						 A1.50003 1.50003 -180 0 0 10.5 192.41 L1.5 192.41 A1.50003 1.50003 -180 0 0 0 193.91 L0 202.91 Z" class="st3"></path>		</g>	</g></g>
</svg>

### 相关信息

[主机上的 RTSP 流](https://docs.qualcomm.com/doc/80-70022-50SC/topic/camera-and-video-encode.html#one_stream_1080p_avc_rtsp_from_live_source__section_ayq_2nh_pyb)

## 三路流 - 来自实时源的 4k JPEG 拍照、1080p AVC MP4 和 1080p YUV 流

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

用例使用来自摄像头的三路流。第一路流是 JPEG 拍照的 4k 数据流。第二路流为 1080p 流，将其编码为 H.264 后进行复用。第三路 1080p 流进行显示。

Note: 对于 Dragonwing IQ-9075 和 Dragonwing IQ-8275，目前不支持 JPEG 视频编码。

在目标设备上运行用例：

    gst-pipeline-app -e qtiqmmfsrc name=camsrc video_0::type=preview ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! queue ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! queue ! h264parse ! mp4mux ! queue ! filesink location="/opt/mux.mp4" camsrc.image_1 ! "image/jpeg,width=3840,height=2160,framerate=30/1" ! multifilesink location=/opt/frame%d.jpg sync=true async=false camsrc. ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! waylandsink fullscreen=trueCopy to clipboard

在 `cmd`命令行终端上显示菜单。
1. 选择 Playing 模式。该 pipeline 启动视频流传输。
2. 按 Enter。
3. 选择 Plugin 模式并选择 `camsrc`。
4. 选择 Capture image 选项。
5. 选择 video 或 still
                        capture。
6. 输入您要拍照的数量。

请按 Back，然后从菜单中选择 Quit 选项，以停止用例。

您可以在媒体播放器上播放 MP4 文件和照片。显示来自摄像头的数据流。

从目标设备中拉取录制的内容，然后在主机上播放内容。

    scp -r root@[DEVICE IP-ADDR]:/opt/mux.mp4 user1@[HOST IP-ADDR]:/workspaceCopy to clipboard

    scp -r root@[DEVICE IP-ADDR]:/opt/frame*.jpg user1@[HOST IP-ADDR]:/workspaceCopy to clipboard

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

Figure : 用于处理三路摄像头流的 pipeline - 将 4K 流转换为 JPEG 快照、对 1080p 流进行编码、对 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 pipeline_three_streams_4kjpeg_encode_display.svg pipeline_three_streams_4kjpeg_e -->
<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.90625in" height="3.18272in" viewbox="0 0 713.25 229.156" xml:space="preserve" color-interpolation-filters="sRGB" class="st11"><v:documentproperties v:langid="1033" v:viewmarkup="false"></v:documentproperties>
<style>.svg-7 .st1 { fill: #fafafa; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-7 .st2 { fill: #000000; font-family: Roboto; font-size: 1.00001em; font-weight: bold }
.svg-7 .st3 { fill: #d2d7e1; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-7 .st4 { fill: #007884; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-7 .st5 { fill: #ffffff; font-family: Roboto; font-size: 1.00001em }
.svg-7 .st6 { stroke: #000000; stroke-linecap: butt; stroke-width: 0.75 }
.svg-7 .st7 { fill: #000000; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-7 .st8 { fill: none }
.svg-7 .st9 { fill: none; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-7 .st10 { fill: #000000; font-family: SimHei; font-size: 0.874992em }
.svg-7 .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>pipeline_three_streams_4kjpeg_e</title>	<v:pageproperties v:drawingscale="1" v:pagescale="1" v:drawingunits="19" v:shadowoffsetx="9" v:shadowoffsety="-9"></v:pageproperties>	<g id="shape3-1" v:mid="3" v:groupcontext="shape" transform="translate(0.375,-0.375057)">		<title>Sheet.3</title>		<desc>GST BIN</desc>		<v:textblock v:margins="rect(7.2,0,0,0)" v:verticalalign="0"></v:textblock>		<v:textrect cx="356.25" cy="114.953" width="712.51" height="228.406"></v:textrect>		<path d="M0 223.53 A5.62513 5.62513 -180 0 0 5.63 229.16 L706.88 229.16 A5.62513 5.62513 -180 0 0 712.5 223.53 L712.5					 6.38 A5.62513 5.62513 -180 0 0 706.88 0.75 L5.62 0.75 A5.62513 5.62513 -180 0 0 -0 6.38 L0 223.53 Z" class="st1"></path>		<text x="333.45" y="18.75" class="st2" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>GST BIN</text>		</g>	<g id="shape4-4" v:mid="4" v:groupcontext="shape">		<title>Sheet.4</title>		<path d="M707.25 0.75 C710.14 0.75 712.5 3.11 712.5 6 L712.5 223.16 C712.5 226.05 710.14 228.41 707.25 228.41 L6 228.41					 C3.11 228.41 0.75 226.05 0.75 223.16 L0.75 6 C0.75 3.11 3.11 0.75 6 0.75 L707.25 0.75 ZM707.25 0 L6 0 C2.69					 0 0 2.69 0 6 L0 223.16 C0 226.47 2.69 229.16 6 229.16 L707.25 229.16 C710.56 229.16 713.25 226.47 713.25					 223.16 L713.25 6 C713.25 2.69 710.56 0 707.25 0 Z" class="st3"></path>	</g>	<g id="shape10-6" v:mid="10" v:groupcontext="shape" transform="translate(15,-95.6349)">		<title>Sheet.10</title>		<desc>camsrc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="210.406" width="120.01" height="37.5"></v:textrect>		<path d="M0 226.16 A3.00007 3.00007 -180 0 0 3 229.16 L117 229.16 A3.00007 3.00007 -180 0 0 120 226.16 L120 194.66 A3.00007					 3.00007 -180 0 0 117 191.66 L3 191.66 A3.00007 3.00007 -180 0 0 0 194.66 L0 226.16 Z" class="st4"></path>		<text x="40.07" y="214.01" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>camsrc</text>		</g>	<g id="shape13-9" v:mid="13" v:groupcontext="shape" transform="translate(135,-114.385)">		<title>Sheet.13</title>		<path d="M0 229.16 L23.23 229.16" class="st6"></path>	</g>	<g id="shape14-12" v:mid="14" v:groupcontext="shape" transform="translate(157.467,-111.767)">		<title>Sheet.14</title>		<path d="M0 229.16 L4.53 226.54 L0 223.92 L0 229.16 Z" class="st7"></path>	</g>	<g id="shape17-14" v:mid="17" v:groupcontext="shape" transform="translate(162,-95.6349)">		<title>Sheet.17</title>		<desc>multifilesink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="210.406" width="120.01" height="37.5"></v:textrect>		<path d="M0 226.16 A3.00007 3.00007 -180 0 0 3 229.16 L117 229.16 A3.00007 3.00007 -180 0 0 120 226.16 L120 194.66 A3.00007					 3.00007 -180 0 0 117 191.66 L3 191.66 A3.00007 3.00007 -180 0 0 0 194.66 L0 226.16 Z" class="st4"></path>		<text x="27.49" y="214.01" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>multifilesink</text>		</g>	<g id="shape21-17" v:mid="21" v:groupcontext="shape" transform="translate(162,-155.635)">		<title>Sheet.21</title>		<desc>v4l2h264enc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="210.406" width="120" height="37.5"></v:textrect>		<path d="M0 226.16 A3.00007 3.00007 -180 0 0 3 229.16 L117 229.16 A3.00007 3.00007 -180 0 0 120 226.16 L120 194.66 A3.00007					 3.00007 -180 0 0 117 191.66 L3 191.66 A3.00007 3.00007 -180 0 0 -0 194.66 L0 226.16 Z" class="st4"></path>		<text x="25.86" y="214.01" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>v4l2h264enc</text>		</g>	<g id="shape24-20" v:mid="24" v:groupcontext="shape" transform="translate(282,-174.385)">		<title>Sheet.24</title>		<path d="M0 229.16 L14.98 229.16" class="st6"></path>	</g>	<g id="shape25-23" v:mid="25" v:groupcontext="shape" transform="translate(296.216,-171.767)">		<title>Sheet.25</title>		<path d="M0 229.16 L4.53 226.54 L0 223.92 L0 229.16 Z" class="st7"></path>	</g>	<g id="shape27-25" v:mid="27" v:groupcontext="shape" transform="translate(300.75,-155.635)">		<title>Sheet.27</title>		<desc>h264parse</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="210.406" width="120.01" height="37.5"></v:textrect>		<path d="M0 226.16 A3.00007 3.00007 -180 0 0 3 229.16 L117 229.16 A3.00007 3.00007 -180 0 0 120 226.16 L120 194.66 A3.00007					 3.00007 -180 0 0 117 191.66 L3 191.66 A3.00007 3.00007 -180 0 0 -0 194.66 L0 226.16 Z" class="st4"></path>		<text x="31.65" y="214.01" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>h264parse</text>		</g>	<g id="shape31-28" v:mid="31" v:groupcontext="shape" transform="translate(420.75,-174.385)">		<title>Sheet.31</title>		<path d="M0 229.16 L14.98 229.16" class="st6"></path>	</g>	<g id="shape32-31" v:mid="32" v:groupcontext="shape" transform="translate(434.966,-171.767)">		<title>Sheet.32</title>		<path d="M0 229.16 L4.53 226.54 L0 223.92 L0 229.16 Z" class="st7"></path>	</g>	<g id="shape34-33" v:mid="34" v:groupcontext="shape" transform="translate(439.5,-155.635)">		<title>Sheet.34</title>		<desc>mp4mux</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="210.406" width="120" height="37.5"></v:textrect>		<path d="M0 226.16 A3.00007 3.00007 -180 0 0 3 229.16 L117 229.16 A3.00007 3.00007 -180 0 0 120 226.16 L120 194.66 A3.00007					 3.00007 -180 0 0 117 191.66 L3 191.66 A3.00007 3.00007 -180 0 0 0 194.66 L0 226.16 Z" class="st4"></path>		<text x="36.47" y="214.01" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>mp4mux</text>		</g>	<g id="shape37-36" v:mid="37" v:groupcontext="shape" transform="translate(559.5,-174.385)">		<title>Sheet.37</title>		<path d="M0 229.16 L14.98 229.16" class="st6"></path>	</g>	<g id="shape38-39" v:mid="38" v:groupcontext="shape" transform="translate(573.716,-171.767)">		<title>Sheet.38</title>		<path d="M0 229.16 L4.53 226.54 L0 223.92 L0 229.16 Z" class="st7"></path>	</g>	<g id="shape40-41" v:mid="40" v:groupcontext="shape" transform="translate(578.25,-155.635)">		<title>Sheet.40</title>		<desc>filesink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="210.406" width="120" height="37.5"></v:textrect>		<path d="M0 226.16 A3.00007 3.00007 -180 0 0 3 229.16 L117 229.16 A3.00007 3.00007 -180 0 0 120 226.16 L120 194.66 A3.00007					 3.00007 -180 0 0 117 191.66 L3 191.66 A3.00007 3.00007 -180 0 0 0 194.66 L0 226.16 Z" class="st4"></path>		<text x="40.92" y="214.01" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>filesink</text>		</g>	<g id="shape43-44" v:mid="43" v:groupcontext="shape" transform="translate(162,-35.6349)">		<title>Sheet.43</title>		<desc>Waylandsink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="210.406" width="120" height="37.5"></v:textrect>		<path d="M0 226.16 A3.00007 3.00007 -180 0 0 3 229.16 L117 229.16 A3.00007 3.00007 -180 0 0 120 226.16 L120 194.66 A3.00007					 3.00007 -180 0 0 117 191.66 L3 191.66 A3.00007 3.00007 -180 0 0 0 194.66 L0 226.16 Z" class="st4"></path>		<text x="26.26" y="214.01" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Waylandsink</text>		</g>	<g id="shape46-47" v:mid="46" v:groupcontext="shape" transform="translate(148.5,-51.6347)">		<title>Sheet.46</title>		<path d="M9.19 106.41 L0 106.41 L0 229.16 L9.19 229.16 L9.19 106.41 Z" class="st8"></path>		<path d="M9.19 106.41 L0 106.41 L0 229.16 L9.19 229.16" class="st6"></path>	</g>	<g id="shape47-50" v:mid="47" v:groupcontext="shape" transform="translate(156.819,-171.393)">		<title>Sheet.47</title>		<path d="M0 223.17 L5.18 226.16 L0 229.16 L0 223.17 Z" class="st7"></path>	</g>	<g id="shape48-52" v:mid="48" v:groupcontext="shape" transform="translate(156.819,-48.6429)">		<title>Sheet.48</title>		<path d="M0 229.16 L5.18 226.16 L0 223.17 L0 229.16 Z" class="st7"></path>	</g>	<g id="group49-54" transform="translate(662.062,-9.18727)" v:mid="49" v:groupcontext="group">		<title>Sheet.49</title>		<g id="shape6-55" v:mid="6" v:groupcontext="shape" transform="translate(15.1883,2.84217E-14)">			<title>Sheet.6</title>			<desc>开源</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="10.5" cy="222.856" width="21" height="12.6"></v:textrect>			<rect x="0" y="216.556" width="21" height="12.6" class="st9"></rect>			<text x="0" y="226.35" class="st10" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>开源</text>			</g>		<g id="shape7-58" v:mid="7" v:groupcontext="shape" transform="translate(6.29496E-14,-0.21863)">			<title>Sheet.7</title>			<path d="M0 227.66 A1.50003 1.50003 -180 0 0 1.5 229.16 L10.5 229.16 A1.50003 1.50003 -180 0 0 12 227.66 L12 218.66						 A1.50003 1.50003 -180 0 0 10.5 217.16 L1.5 217.16 A1.50003 1.50003 -180 0 0 -0 218.66 L0 227.66 Z" class="st4"></path>		</g>	</g></g>
</svg>

## 二路流 - 1080p MJPEG 编码器

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

MJPEG 编码器以MJPEG 格式对采集的视频流进行编码和写入。运行编码、保存到文件和在显示器上预览的用例。

Note: Dragonwing IQ-9075 和 Dragonwing IQ-8275 目前不支持 MJPEG 视频编码。

在目标设备上运行此编码器的以下用例。在运行这些用例之前，请在终端中输入 <var class="keyword varname">3</var> 以进入播放状态。

- H.264 编码和 MJPEG dump 到文件：

        gst-pipeline-app -e qtiqmmfsrc name=camsrc video_0::type=preview ! video/x-raw,format=NV12_Q08C,width=1920,height=1080,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! queue ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! queue ! h264parse ! mp4mux ! queue ! filesink location="/opt/mux.mp4" camsrc. ! "image/jpeg,width=3840,height=2160,framerate=30/1" ! queue ! avimux ! filesink location=/opt/4k_mjpeg.avi sync=true async=falseCopy to clipboard

    mux.mp4和 4k\_mjpeg.avi 文件存储在 /opt/ 中。
- H.265 编码和 MJPEG dump 到文件：

        gst-pipeline-app -e qtiqmmfsrc name=camsrc video_0::type=preview ! video/x-raw,format=NV12_Q08C,width=1920,height=1080,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! queue ! v4l2h265enc capture-io-mode=4 output-io-mode=5 ! queue ! h265parse ! mp4mux ! queue ! filesink location="/opt/mux.mp4" camsrc. ! "image/jpeg,width=3840,height=2160,framerate=30/1" ! queue ! avimux ! filesink location=/opt/4k_mjpeg.avi sync=true async=falseCopy to clipboard

    mux.mp4和 4k\_mjpeg.avi 文件存储在 /opt/ 中。
- 预览显示使用 MJPEG 编码的文件：

        gst-pipeline-app -e qtiqmmfsrc name=camsrc video_0::type=preview ! video/x-raw,format=NV12_Q08C,width=1280,height=720,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! queue ! waylandsink fullscreen=true camsrc.video_1 ! "image/jpeg,width=1280,height=720,framerate=30/1" ! queue ! avimux ! filesink location=/opt/mjpeg.avi sync=true async=falseCopy to clipboard

    视频在屏幕上预览，mjpeg.avi文件存储在 /opt/ 中。
- 预览显示使用 MJPEG 和 H.264 编码的文件：

        gst-pipeline-app -e qtiqmmfsrc name=camsrc video_0::type=preview ! video/x-raw,format=NV12_Q08C,width=1280,height=720,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! queue ! waylandsink fullscreen=true camsrc.video_1 ! "image/jpeg,width=1280,height=720,framerate=30/1" ! queue ! avimux ! filesink location=/opt/mjpeg_2.avi sync=true async=false camsrc.video_2 ! video/x-raw,format=NV12,width=1280,height=720,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! queue ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! queue ! h264parse ! mp4mux ! queue ! filesink location="/opt/mux.mp4"Copy to clipboard

    视频在屏幕上预览，mux.mp4和 mjpeg.avi 文件存储在 /opt/。

## 基于切片的编码

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

通过视频编码的切片，视频流被分割或切片为多个部分，以进行并行编码。

用户可以将基于切片的编码用于视频播放、电话会议和安全摄像头用例。

这些用例使您能够在摄像头流上实现基于切片的编码。输出视频文件存储在 /opt/。

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

### H.264

- 1280 × 720，每帧最大切片数 = 10：

        gst-launch-1.0 -e qtiqmmfsrc ! video/x-raw,format=NV12,width=1280,height=720,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! queue ! v4l2h264enc capture-io-mode=4 output-io-mode=4 extra-controls="controls,h264_profile=4,h264_level=14,video_bitrate=4800000,video_bitrate_mode=1,frame_level_rate_control_enable=1,video_gop_size=299,h264_entropy_mode=1,slice_partitioning_method=1,numbe_of_mbs_in_a_slice=1200,video_peak_bitrate=32000000;" ! filesink location="/opt/spincalender1280X760_1200_MB_720p_live1800.h264"Copy to clipboard
- 1280 × 720，每帧切片数 = 8：

        gst-launch-1.0 -ev videotestsrc is-live=true pattern=ball ! video/x-raw,format="NV12",width=1280,height=720,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! queue ! v4l2h264enc capture-io-mode=4 output-io-mode=4 extra-controls="controls,h264_profile=4,h264_level=14,video_bitrate=4800000,video_bitrate_mode=1,frame_level_rate_control_enable=1,video_gop_size=299,h264_entropy_mode=1,slice_partitioning_method=1,number_of_mbs_in_a_slice=450,video_peak_bitrate=32000000;" ! filesink location="/opt/slice_8_MB_720p_live.h264"Copy to clipboard
- 1920 × 1080，每帧切片数 = 3：

        gst-launch-1.0 -ev videotestsrc is-live=true pattern=ball ! video/x-raw,format="NV12",width=1920,height=1080,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! queue ! v4l2h264enc capture-io-mode=4 output-io-mode=4 extra-controls="controls,h264_profile=4,h264_level=14,video_bitrate=4800000,video_bitrate_mode=1,frame_level_rate_control_enable=1,video_gop_size=299,h264_entropy_mode=1,slice_partitioning_method=1,number_of_mbs_in_a_slice=2700,video_peak_bitrate=32000000;" ! filesink location="/opt/slice_3_MB_1080p.h264"Copy to clipboard
- 1280 × 720，最大字节模式：

        gst-launch-1.0 -e qtiqmmfsrc ! video/x-raw,format=NV12,width=1280,height=720,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! queue ! v4l2h264enc capture-io-mode=4 output-io-mode=5 extra-controls="controls,slice_partitioning_method=2;" ! filesink location="/opt/encoded.h264"Copy to clipboard

### H.265

- 1280 × 720，每帧最大切片数 = 10：

        gst-launch-1.0 -e qtiqmmfsrc ! video/x-raw,format=NV12,width=1280,height=720,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! queue ! v4l2h265enc capture-io-mode=4 output-io-mode=5 extra-controls="controls,slice_partitioning_method=1;" ! filesink location="/opt/encoded.h265"Copy to clipboard
- 1280 × 720，每帧切片数 = 8：

        gst-launch-1.0 -ev videotestsrc is-live=true pattern=ball ! video/x-raw,format="NV12",width=1280,height=720,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! queue ! v4l2h265enc capture-io-mode=4 output-io-mode=4 extra-controls="controls,h265_profile=4,h265_level=14,video_bitrate=4800000,video_bitrate_mode=1,frame_level_rate_control_enable=1,video_gop_size=299,h265_entropy_mode=1,slice_partitioning_method=1,number_of_mbs_in_a_slice=450,video_peak_bitrate=32000000;" ! filesink location="/opt/slice_8_MB_720p_live.h265"Copy to clipboard
- 1920 × 1080，每帧切片数 = 3：

        gst-launch-1.0 -ev videotestsrc is-live=true pattern=ball ! video/x-raw,format="NV12",width=1920,height=1080,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! queue ! v4l2h265enc capture-io-mode=4 output-io-mode=4 extra-controls="controls,h265_profile=4,h265_level=14,video_bitrate=4800000,video_bitrate_mode=1,frame_level_rate_control_enable=1,video_gop_size=299,h265_entropy_mode=1,slice_partitioning_method=1,number_of_mbs_in_a_slice=2700,video_peak_bitrate=32000000;" ! filesink location="/opt/slice_3_MB_1080p.h265"Copy to clipboard
- 1280 × 720，最大字节模式：

        gst-launch-1.0 -ev videotestsrc is-live=true pattern=ball ! video/x-raw,format="NV12",width=1280,height=720,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! queue ! v4l2h264enc capture-io-mode=4 output-io-mode=4 extra-controls="controls,h264_profile=4,h265_level=14,video_bitrate=4800000,video_bitrate_mode=1,frame_level_rate_control_enable=1,video_gop_size=299,h264_entropy_mode=1,slice_partitioning_method=1,numbe_of_mbs_in_a_slice=360,video_peak_bitrate=32000000;" ! filesink location="/opt/spincalender1280X760_1200_MB_720p_live.h265"Copy to clipboard

## 帧内智能编解码器（H.264 和 H.265）

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

帧内（I 帧）是一种数据压缩技术，可实现更小的文件大小和更低的码率。使用智能 codec 和降噪功能运行 720p@30 HEVC 流的用例。

对于这些用例，输出的 video.mp4 文件存储在 /opt/。

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

### 具有智能码率、智能帧率和智能 GOP 的 720p@30 HEVC 流 – 启用降噪

Note: 以下用例在 Ubuntu Server 上不受支持。

- H.264

        gst-launch-1.0 -ev qtiqmmfsrc noise-reduction=2 video_0::extra-buffers=20 video_0::type=preview name=camsrc ! video/x-raw,format=NV12_Q08C,width=1280,height=720,framerate=30/1 ! queue ! scb.sink qtismartvencbin default-gop=30 max-gop=600 smart-framerate=false smart-gop=false encoder="v4l2h264enc" max-bitrate=4200000 name=scb ! queue ! h264parse ! queue ! mp4mux ! queue ! filesink location=/opt/video.mp4 camsrc. ! video/x-raw,format=NV12_Q08C,width=640,height=480,framerate=15/1 ! queue ! scb.sink_ctrlCopy to clipboard
- H.265

        gst-launch-1.0 -ev qtiqmmfsrc noise-reduction=2 video_0::extra-buffers=20 video_0::type=preview name=camsrc ! video/x-raw,format=NV12_Q08C,width=1280,height=720,framerate=30/1 ! queue ! scb.sink qtismartvencbin default-gop=30 max-gop=600 smart-framerate=false smart-gop=false encoder="v4l2h265enc" max-bitrate=4200000 name=scb ! queue ! h265parse ! queue ! mp4mux ! queue ! filesink location=/opt/video.mp4 camsrc. ! video/x-raw,format=NV12_Q08C,width=640,height=480,framerate=15/1 ! queue ! scb.sink_ctrlCopy to clipboard

### 仅具有智能码率的 720p@30 HEVC 流 - 启用降噪

- H.264

        gst-launch-1.0 -ev qtiqmmfsrc noise-reduction=2 video_0::extra-buffers=20 video_0::type=preview name=camsrc ! video/x-raw,format=NV12_Q08C,width=1280,height=720,framerate=30/1 ! queue ! scb.sink qtismartvencbin default-gop=30 max-gop=600 smart-framerate=false smart-gop=false encoder="v4l2h264enc" max-bitrate=4200000 name=scb ! queue ! h264parse ! queue ! mp4mux ! queue ! filesink location=/opt/video.mp4 camsrc. ! video/x-raw,format=NV12_Q08C,width=640,height=480,framerate=15/1 ! queue ! scb.sink_ctrlCopy to clipboard
- H.265

        gst-launch-1.0 -ev qtiqmmfsrc noise-reduction=2 video_0::extra-buffers=20 video_0::type=preview name=camsrc ! video/x-raw,format=NV12_Q08C,width=1280,height=720,framerate=30/1 ! queue ! scb.sink qtismartvencbin default-gop=30 max-gop=600 smart-framerate=false smart-gop=false encoder="v4l2h265enc" max-bitrate=4200000 name=scb ! queue ! h265parse ! queue ! mp4mux ! queue ! filesink location=/opt/video.mp4 camsrc. ! video/x-raw,format=NV12_Q08C,width=640,height=480,framerate=15/1 ! queue ! scb.sink_ctrlCopy to clipboard

### 具有智能码率、智能帧率和智能 GOP 的 720p@30 HEVC 流 – 禁用降噪

- H.264

        gst-launch-1.0 -ev qtiqmmfsrc video_0::extra-buffers=20 video_0::type=preview name=camsrc ! video/x-raw,format=NV12_Q08C,width=1280,height=720,framerate=30/1 ! queue ! scb.sink qtismartvencbin default-gop=30 max-gop=600 encoder="v4l2h264enc" max-bitrate=4200000 name=scb ! queue ! h264parse ! queue ! mp4mux ! queue ! filesink location=/opt/video.mp4 camsrc. ! video/x-raw,format=NV12_Q08C,width=640,height=480,framerate=15/1 ! queue ! scb.sink_ctrlCopy to clipboard
- H.265

        gst-launch-1.0 -ev qtiqmmfsrc video_0::extra-buffers=20 video_0::type=preview name=camsrc ! video/x-raw,format=NV12_Q08C,width=1280,height=720,framerate=30/1 ! queue ! scb.sink qtismartvencbin default-gop=30 max-gop=600 encoder="v4l2h265enc" max-bitrate=4200000 name=scb ! queue ! h265parse ! queue ! mp4mux ! queue ! filesink location=/opt/video.mp4 camsrc. ! video/x-raw,format=NV12_Q08C,width=640,height=480,framerate=15/1 ! queue ! scb.sink_ctrlCopy to clipboard

### 具有智能码率、智能帧率和智能 GOP 的 720p@30 HEVC 流 – 启用降噪

- H.264

        gst-launch-1.0 -ev qtiqmmfsrc noise-reduction=2 video_0::extra-buffers=20 video_0::type=preview name=camsrc ! video/x-raw,format=NV12_Q08C,width=1280,height=720,framerate=30/1 ! queue ! scb.sink qtismartvencbin default-gop=30 max-gop=600 encoder="v4l2h264enc" max-bitrate=4200000 name=scb ! queue ! h264parse config-interval=1 ! mpegtsmux name=muxer ! queue ! tcpserversink port=8900 host=<ip_address> camsrc. ! video/x-raw,format=NV12_Q08C,width=640,height=480,framerate=15/1 ! queue ! scb.sink_ctrlCopy to clipboard
- H.265

        gst-launch-1.0 -ev qtiqmmfsrc noise-reduction=2 video_0::extra-buffers=20 video_0::type=preview name=camsrc ! video/x-raw,format=NV12_Q08C,width=1280,height=720,framerate=30/1 ! queue ! scb.sink qtismartvencbin default-gop=30 max-gop=600 encoder="v4l2h265enc" max-bitrate=4200000 name=scb ! queue ! h265parse config-interval=1 ! mpegtsmux name=muxer ! queue ! tcpserversink port=8900 host=<ip_address> camsrc. ! video/x-raw,format=NV12_Q08C,width=640,height=480,framerate=15/1 ! queue ! scb.sink_ctrlCopy to clipboard

要通过 TCP 播放流，请在 Windows 主机上执行以下操作：

1. 打开 VLC 媒体播放器。
2. 选择 Media &gt; Open Network Stream 或按 CTRL + N）。
3. 输入 tcp://&lt;ip\_address&gt;:8900/live。
4. 按 Play

### 具有智能码率、智能帧率和智能 GOP 的 720p@30 HEVC 流 – 启用降噪

- H.264

        gst-launch-1.0 -ev qtiqmmfsrc noise-reduction=2 video_0::extra-buffers=20 video_0::type=preview name=camsrc ! video/x-raw,format=NV12_Q08C,width=1280,height=720,framerate=30/1 ! queue ! scb.sink qtismartvencbin default-gop=30 max-gop=600 encoder="v4l2h264enc" max-bitrate=1000000 name=scb ! queue ! h264parse ! queue ! mp4mux ! queue ! filesink location=/opt/video.mp4 camsrc. ! video/x-raw,format=NV12_Q08C,width=640,height=480,framerate=15/1 ! queue ! tee name=split ! queue ! scb.sink_ctrl split. ! queue ! qtimlvconverter ! queue ! qtimltflite delegate=external external-delegate-path=libQnnTFLiteDelegate.so external-delegate-options="QNNExternalDelegate,backend_type=htp;" model=<model-path> ! queue ! qtimlvdetection threshold=50.0 results=5 module=yolov8 labels=<labels-path> constants="YOLOv8,q-offsets=<-107.0, -128.0, 0.0>,q-scales=<3.093529462814331, 0.00390625, 1.0>;" ! text/x-raw ! queue ! scb.sink_mlCopy to clipboard
- H.265

        gst-launch-1.0 -ev qtiqmmfsrc noise-reduction=2 video_0::extra-buffers=20 video_0::type=preview name=camsrc ! video/x-raw,format=NV12_Q08C,width=1280,height=720,framerate=30/1 ! queue ! scb.sink qtismartvencbin default-gop=30 max-gop=600 encoder="v4l2h265enc" max-bitrate=1000000 name=scb ! queue ! h265parse ! queue ! mp4mux ! queue ! filesink location=/opt/video.mp4 camsrc. ! video/x-raw,format=NV12_Q08C,width=640,height=480,framerate=15/1 ! queue ! tee name=split ! queue ! scb.sink_ctrl split. ! queue ! qtimlvconverter ! queue ! qtimltflite delegate=external external-delegate-path=libQnnTFLiteDelegate.so external-delegate-options="QNNExternalDelegate,backend_type=htp;" model=<model-path> ! queue ! qtimlvdetection threshold=50.0 results=5 module=yolov8 labels=<labels-path> constants="YOLOv8,q-offsets=<-107.0, -128.0, 0.0>,q-scales=<3.093529462814331, 0.00390625, 1.0>;" ! text/x-raw ! queue ! scb.sink_mlCopy to clipboard

### 并发两个 720p@30 HEVC 流，并启用智能码率、智能帧率和智能 GOP 降噪功能

- H.264

        gst-launch-1.0 -ev qtiqmmfsrc noise-reduction=2 video_0::extra-buffers=20 video_0::type=preview video_1::extra-buffers=20 name=camsrc ! video/x-raw,format=NV12_Q08C,width=1280,height=720,framerate=30/1 ! queue ! scb1.sink qtismartvencbin default-gop=30 max-gop=600 encoder="v4l2h264enc" max-bitrate=4200000 name=scb1 ! queue ! h264parse ! queue ! mp4mux ! queue ! filesink location=/opt/video_scb1.mp4 camsrc. ! video/x-raw,format=NV12_Q08C,width=1280,height=720,framerate=30/1 ! queue ! scb2.sink qtismartvencbin default-gop=30 max-gop=600 encoder="v4l2h264enc" max-bitrate=4200000 name=scb2 ! queue ! h264parse ! queue ! mp4mux ! queue ! filesink location=/opt/video_scb2.mp4 camsrc. ! video/x-raw,format=NV12_Q08C,width=640,height=480,framerate=15/1 ! queue ! tee name=ctrl_t ! queue ! scb1.sink_ctrl ctrl_t. ! queue ! scb2.sink_ctrlCopy to clipboard
- H.265

        gst-launch-1.0 -ev qtiqmmfsrc noise-reduction=2 video_0::extra-buffers=20 video_0::type=preview video_1::extra-buffers=20 name=camsrc ! video/x-raw,format=NV12_Q08C,width=1280,height=720,framerate=30/1 ! queue ! scb1.sink qtismartvencbin default-gop=30 max-gop=600 encoder="v4l2h265enc" max-bitrate=4200000 name=scb1 ! queue ! h265parse ! queue ! mp4mux ! queue ! filesink location=/opt/video_scb1.mp4 camsrc. ! video/x-raw,format=NV12_Q08C,width=1280,height=720,framerate=30/1 ! queue ! scb2.sink qtismartvencbin default-gop=30 max-gop=600 encoder="v4l2h265enc" max-bitrate=4200000 name=scb2 ! queue ! h265parse ! queue ! mp4mux ! queue ! filesink location=/opt/video_scb2.mp4 camsrc. ! video/x-raw,format=NV12_Q08C,width=640,height=480,framerate=15/1 ! queue ! tee name=ctrl_t ! queue ! scb1.sink_ctrl ctrl_t. ! queue ! scb2.sink_ctrlCopy to clipboard

## CPU 和 GPU 中的 MJPEG 视频编码

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

对于 MJPEG 编码，如果硬件不可用，则需要 CPU 和 GPU 的支持。该用例包含对 16 通道 1080p 2fps 视频进行编码的能力。

Note: Dragonwing IQ-9075 和 Dragonwing IQ-8275 目前不支持 MJPEG 视频编码。

### 前提条件
关于 MJPEG 编码，需要 CPU/GPU 支持 1080p@2fps。
在 Linux 主机的终端中，运行用例之前设置以下环境变量：

    export XDG_RUNTIME_DIR=/dev/socket/westonCopy to clipboard

    export WAYLAND_DISPLAY=wayland-1Copy to clipboard

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

### YUV 文件 1920 × 1080@30 → 16 × JPEG-ENC → AVI 文件

    	
    gst-launch-1.0 -e filesrc location=/opt/1920_1080.yuv ! videoparse width=1920 height=1080 format=nv12 framerate=2/1 ! jpegenc ! avimux ! filesink location=/opt/mjpeg1.avi &
    gst-launch-1.0 -e filesrc location=/opt/1920_1080.yuv ! videoparse width=1920 height=1080 format=nv12 framerate=2/1 ! jpegenc ! avimux ! filesink location=/opt/mjpeg2.avi &
    gst-launch-1.0 -e filesrc location=/opt/1920_1080.yuv ! videoparse width=1920 height=1080 format=nv12 framerate=2/1 ! jpegenc ! avimux ! filesink location=/opt/mjpeg3.avi &
    gst-launch-1.0 -e filesrc location=/opt/1920_1080.yuv ! videoparse width=1920 height=1080 format=nv12 framerate=2/1 ! jpegenc ! avimux ! filesink location=/opt/mjpeg4.avi &
    gst-launch-1.0 -e filesrc location=/opt/1920_1080.yuv ! videoparse width=1920 height=1080 format=nv12 framerate=2/1 ! jpegenc ! avimux ! filesink location=/opt/mjpeg5.avi &
    gst-launch-1.0 -e filesrc location=/opt/1920_1080.yuv ! videoparse width=1920 height=1080 format=nv12 framerate=2/1 ! jpegenc ! avimux ! filesink location=/opt/mjpeg6.avi &
    gst-launch-1.0 -e filesrc location=/opt/1920_1080.yuv ! videoparse width=1920 height=1080 format=nv12 framerate=2/1 ! jpegenc ! avimux ! filesink location=/opt/mjpeg7.avi &
    gst-launch-1.0 -e filesrc location=/opt/1920_1080.yuv ! videoparse width=1920 height=1080 format=nv12 framerate=2/1 ! jpegenc ! avimux ! filesink location=/opt/mjpeg8.avi &
    gst-launch-1.0 -e filesrc location=/opt/1920_1080.yuv ! videoparse width=1920 height=1080 format=nv12 framerate=2/1 ! jpegenc ! avimux ! filesink location=/opt/mjpeg9.avi &
    gst-launch-1.0 -e filesrc location=/opt/1920_1080.yuv ! videoparse width=1920 height=1080 format=nv12 framerate=2/1 ! jpegenc ! avimux ! filesink location=/opt/mjpeg10.avi &
    gst-launch-1.0 -e filesrc location=/opt/1920_1080.yuv ! videoparse width=1920 height=1080 format=nv12 framerate=2/1 ! jpegenc ! avimux ! filesink location=/opt/mjpeg11.avi &
    gst-launch-1.0 -e filesrc location=/opt/1920_1080.yuv ! videoparse width=1920 height=1080 format=nv12 framerate=2/1 ! jpegenc ! avimux ! filesink location=/opt/mjpeg12.avi &
    gst-launch-1.0 -e filesrc location=/opt/1920_1080.yuv ! videoparse width=1920 height=1080 format=nv12 framerate=2/1 ! jpegenc ! avimux ! filesink location=/opt/mjpeg13.avi &
    gst-launch-1.0 -e filesrc location=/opt/1920_1080.yuv ! videoparse width=1920 height=1080 format=nv12 framerate=2/1 ! jpegenc ! avimux ! filesink location=/opt/mjpeg14.avi &
    gst-launch-1.0 -e filesrc location=/opt/1920_1080.yuv ! videoparse width=1920 height=1080 format=nv12 framerate=2/1 ! jpegenc ! avimux ! filesink location=/opt/mjpeg15.avi &
    gst-launch-1.0 -e filesrc location=/opt/1920_1080.yuv ! videoparse width=1920 height=1080 format=nv12 framerate=2/1 ! jpegenc ! avimux ! filesink location=/opt/mjpeg16.aviCopy to clipboard

### YUV 文件 1920 × 1080@30 → 12 × JPEG-ENC → AVI 文件和 1920 × 1080@30 AVI → 12 × JPEG-DEC &gt; JPEG

    gst-launch-1.0 -e filesrc location=/opt/mjpeg.avi ! avidemux !  queue ! jpegdec ! multifilesink location=/opt/mjpeg1_%d.jpeg max-files=1 &
    gst-launch-1.0 -e filesrc location=/opt/mjpeg.avi ! avidemux !  queue ! jpegdec ! multifilesink location=/opt/mjpeg2_%d.jpeg max-files=1 &
    gst-launch-1.0 -e filesrc location=/opt/mjpeg.avi ! avidemux !  queue ! jpegdec ! multifilesink location=/opt/mjpeg3_%d.jpeg max-files=1 &
    gst-launch-1.0 -e filesrc location=/opt/mjpeg.avi ! avidemux !  queue ! jpegdec ! multifilesink location=/opt/mjpeg4_%d.jpeg max-files=1 &
    gst-launch-1.0 -e filesrc location=/opt/mjpeg.avi ! avidemux !  queue ! jpegdec ! multifilesink location=/opt/mjpeg5_%d.jpeg max-files=1 &
    gst-launch-1.0 -e filesrc location=/opt/mjpeg.avi ! avidemux !  queue ! jpegdec ! multifilesink location=/opt/mjpeg6_%d.jpeg max-files=1 &
    gst-launch-1.0 -e filesrc location=/opt/mjpeg.avi ! avidemux !  queue ! jpegdec ! multifilesink location=/opt/mjpeg7_%d.jpeg max-files=1 &
    gst-launch-1.0 -e filesrc location=/opt/mjpeg.avi ! avidemux !  queue ! jpegdec ! multifilesink location=/opt/mjpeg8_%d.jpeg max-files=1 &
    gst-launch-1.0 -e filesrc location=/opt/mjpeg.avi ! avidemux !  queue ! jpegdec ! multifilesink location=/opt/mjpeg9_%d.jpeg max-files=1 &
    gst-launch-1.0 -e filesrc location=/opt/mjpeg.avi ! avidemux !  queue ! jpegdec ! multifilesink location=/opt/mjpeg10_%d.jpeg max-files=1 &
    gst-launch-1.0 -e filesrc location=/opt/mjpeg.avi ! avidemux !  queue ! jpegdec ! multifilesink location=/opt/mjpeg11_%d.jpeg max-files=1 &
    gst-launch-1.0 -e filesrc location=/opt/mjpeg.avi ! avidemux !  queue ! jpegdec ! multifilesink location=/opt/mjpeg12_%d.jpeg max-files=1 &
    gst-launch-1.0 -e filesrc location=/opt/1920_1080.yuv ! videoparse width=1920 height=1080 format=nv12 framerate=2/1 ! jpegenc ! avimux ! filesink location=/opt/mjpeg1.avi &
    gst-launch-1.0 -e filesrc location=/opt/1920_1080.yuv ! videoparse width=1920 height=1080 format=nv12 framerate=2/1 ! jpegenc ! avimux ! filesink location=/opt/mjpeg2.avi &
    gst-launch-1.0 -e filesrc location=/opt/1920_1080.yuv ! videoparse width=1920 height=1080 format=nv12 framerate=2/1 ! jpegenc ! avimux ! filesink location=/opt/mjpeg3.avi &
    gst-launch-1.0 -e filesrc location=/opt/1920_1080.yuv ! videoparse width=1920 height=1080 format=nv12 framerate=2/1 ! jpegenc ! avimux ! filesink location=/opt/mjpeg4.avi &
    gst-launch-1.0 -e filesrc location=/opt/1920_1080.yuv ! videoparse width=1920 height=1080 format=nv12 framerate=2/1 ! jpegenc ! avimux ! filesink location=/opt/mjpeg5.avi &
    gst-launch-1.0 -e filesrc location=/opt/1920_1080.yuv ! videoparse width=1920 height=1080 format=nv12 framerate=2/1 ! jpegenc ! avimux ! filesink location=/opt/mjpeg6.avi &
    gst-launch-1.0 -e filesrc location=/opt/1920_1080.yuv ! videoparse width=1920 height=1080 format=nv12 framerate=2/1 ! jpegenc ! avimux ! filesink location=/opt/mjpeg7.avi &
    gst-launch-1.0 -e filesrc location=/opt/1920_1080.yuv ! videoparse width=1920 height=1080 format=nv12 framerate=2/1 ! jpegenc ! avimux ! filesink location=/opt/mjpeg8.avi &
    gst-launch-1.0 -e filesrc location=/opt/1920_1080.yuv ! videoparse width=1920 height=1080 format=nv12 framerate=2/1 ! jpegenc ! avimux ! filesink location=/opt/mjpeg9.avi &
    gst-launch-1.0 -e filesrc location=/opt/1920_1080.yuv ! videoparse width=1920 height=1080 format=nv12 framerate=2/1 ! jpegenc ! avimux ! filesink location=/opt/mjpeg10.avi &
    gst-launch-1.0 -e filesrc location=/opt/1920_1080.yuv ! videoparse width=1920 height=1080 format=nv12 framerate=2/1 ! jpegenc ! avimux ! filesink location=/opt/mjpeg11.avi &
    gst-launch-1.0 -e filesrc location=/opt/1920_1080.yuv ! videoparse width=1920 height=1080 format=nv12 framerate=2/1 ! jpegenc ! avimux ! filesink location=/opt/mjpeg12.aviCopy to clipboard

## 启用 24 个端到端并发视频会话

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

运行从文件中获取并发送到显示器的 24 个并行且分辨率为 1080p 流的用例。每个流显示在屏幕上的不同位置。

Note: 这些用例在 QCS6490 和 IQ-8275 上不支持。

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

### H.264–24 会话解码

    ulimit -n 4096 && gst-launch-1.0 -e qtivcomposer name=mix sink_0::position="<0, 0>" sink_0::dimensions="<240, 270>" \
    sink_1::position="<240, 0>" sink_1::dimensions="<240, 270>" \
    sink_2::position="<480, 0>" sink_2::dimensions="<240, 270>" \
    sink_3::position="<720, 0>" sink_3::dimensions="<240, 270>" \
    sink_4::position="<960, 0>" sink_4::dimensions="<240, 270>" \
    sink_5::position="<1200, 0>" sink_5::dimensions="<240, 270>" \
    sink_6::position="<1440, 0>" sink_6::dimensions="<240, 270>" \
    sink_7::position="<1680, 0>" sink_7::dimensions="<240, 270>" \
    sink_8::position="<0, 270>" sink_8::dimensions="<240, 270>" \
    sink_9::position="<240, 270>" sink_9::dimensions="<240, 270>" \
    sink_10::position="<480, 270>" sink_10::dimensions="<240, 270>" \
    sink_11::position="<720, 270>" sink_11::dimensions="<240, 270>" \
    sink_12::position="<960, 270>" sink_12::dimensions="<240, 270>" \
    sink_13::position="<1200, 270>" sink_13::dimensions="<240, 270>" \
    sink_14::position="<1440, 270>" sink_14::dimensions="<240, 270>" \
    sink_15::position="<1680, 270>" sink_15::dimensions="<240, 270>" \
    sink_16::position="<0, 540>" sink_16::dimensions="<240, 270>" \
    sink_17::position="<240, 540>" sink_17::dimensions="<240, 270>" \
    sink_18::position="<480, 540>" sink_18::dimensions="<240, 270>" \
    sink_19::position="<720, 540>" sink_19::dimensions="<240, 270>" \
    sink_20::position="<960, 540>" sink_20::dimensions="<240, 270>" \
    sink_21::position="<1200, 540>" sink_21::dimensions="<240, 270>" \
    sink_22::position="<1440, 540>" sink_22::dimensions="<240, 270>" \
    sink_23::position="<1680, 540>" sink_23::dimensions="<240, 270>" \
    mix. ! fpsdisplaysink text-overlay=true video-sink="waylandsink fullscreen=true" -v \
    filesrc location=/opt/1920_1080_h264_30fps_1min.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/1920_1080_h264_30fps_1min.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/1920_1080_h264_30fps_1min.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/1920_1080_h264_30fps_1min.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/1920_1080_h264_30fps_1min.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/1920_1080_h264_30fps_1min.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/1920_1080_h264_30fps_1min.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/1920_1080_h264_30fps_1min.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/1920_1080_h264_30fps_1min.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/1920_1080_h264_30fps_1min.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/1920_1080_h264_30fps_1min.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/1920_1080_h264_30fps_1min.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/1920_1080_h264_30fps_1min.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/1920_1080_h264_30fps_1min.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/1920_1080_h264_30fps_1min.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/1920_1080_h264_30fps_1min.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/1920_1080_h264_30fps_1min.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/1920_1080_h264_30fps_1min.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/1920_1080_h264_30fps_1min.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/1920_1080_h264_30fps_1min.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/1920_1080_h264_30fps_1min.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/1920_1080_h264_30fps_1min.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/1920_1080_h264_30fps_1min.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/1920_1080_h264_30fps_1min.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix.Copy to clipboard

### H.265–24 会话解码

    ulimit -n 4096 && gst-launch-1.0 -e qtivcomposer name=mix sink_0::position="<0, 0>" sink_0::dimensions="<240, 270>" \
    sink_1::position="<240, 0>" sink_1::dimensions="<240, 270>" \
    sink_2::position="<480, 0>" sink_2::dimensions="<240, 270>" \
    sink_3::position="<720, 0>" sink_3::dimensions="<240, 270>" \
    sink_4::position="<960, 0>" sink_4::dimensions="<240, 270>" \
    sink_5::position="<1200, 0>" sink_5::dimensions="<240, 270>" \
    sink_6::position="<1440, 0>" sink_6::dimensions="<240, 270>" \
    sink_7::position="<1680, 0>" sink_7::dimensions="<240, 270>" \
    sink_8::position="<0, 270>" sink_8::dimensions="<240, 270>" \
    sink_9::position="<240, 270>" sink_9::dimensions="<240, 270>" \
    sink_10::position="<480, 270>" sink_10::dimensions="<240, 270>" \
    sink_11::position="<720, 270>" sink_11::dimensions="<240, 270>" \
    sink_12::position="<960, 270>" sink_12::dimensions="<240, 270>" \
    sink_13::position="<1200, 270>" sink_13::dimensions="<240, 270>" \
    sink_14::position="<1440, 270>" sink_14::dimensions="<240, 270>" \
    sink_15::position="<1680, 270>" sink_15::dimensions="<240, 270>" \
    sink_16::position="<0, 540>" sink_16::dimensions="<240, 270>" \
    sink_17::position="<240, 540>" sink_17::dimensions="<240, 270>" \
    sink_18::position="<480, 540>" sink_18::dimensions="<240, 270>" \
    sink_19::position="<720, 540>" sink_19::dimensions="<240, 270>" \
    sink_20::position="<960, 540>" sink_20::dimensions="<240, 270>" \
    sink_21::position="<1200, 540>" sink_21::dimensions="<240, 270>" \
    sink_22::position="<1440, 540>" sink_22::dimensions="<240, 270>" \
    sink_23::position="<1680, 540>" sink_23::dimensions="<240, 270>" \
    mix. ! fpsdisplaysink text-overlay=false video-sink="waylandsink fullscreen=true" -v \
    filesrc location=/opt/FlyingBirdFlock_1920x1080_30fps_HEVC_7862Kbps_withAudio.mp4 ! qtdemux ! h265parse ! v4l2h265dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/FlyingBirdFlock_1920x1080_30fps_HEVC_7862Kbps_withAudio.mp4 ! qtdemux ! h265parse ! v4l2h265dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/FlyingBirdFlock_1920x1080_30fps_HEVC_7862Kbps_withAudio.mp4 ! qtdemux ! h265parse ! v4l2h265dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/FlyingBirdFlock_1920x1080_30fps_HEVC_7862Kbps_withAudio.mp4 ! qtdemux ! h265parse ! v4l2h265dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/FlyingBirdFlock_1920x1080_30fps_HEVC_7862Kbps_withAudio.mp4 ! qtdemux ! h265parse ! v4l2h265dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/FlyingBirdFlock_1920x1080_30fps_HEVC_7862Kbps_withAudio.mp4 ! qtdemux ! h265parse ! v4l2h265dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/FlyingBirdFlock_1920x1080_30fps_HEVC_7862Kbps_withAudio.mp4 ! qtdemux ! h265parse ! v4l2h265dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/FlyingBirdFlock_1920x1080_30fps_HEVC_7862Kbps_withAudio.mp4 ! qtdemux ! h265parse ! v4l2h265dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/FlyingBirdFlock_1920x1080_30fps_HEVC_7862Kbps_withAudio.mp4 ! qtdemux ! h265parse ! v4l2h265dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/FlyingBirdFlock_1920x1080_30fps_HEVC_7862Kbps_withAudio.mp4 ! qtdemux ! h265parse ! v4l2h265dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/FlyingBirdFlock_1920x1080_30fps_HEVC_7862Kbps_withAudio.mp4 ! qtdemux ! h265parse ! v4l2h265dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/FlyingBirdFlock_1920x1080_30fps_HEVC_7862Kbps_withAudio.mp4 ! qtdemux ! h265parse ! v4l2h265dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/FlyingBirdFlock_1920x1080_30fps_HEVC_7862Kbps_withAudio.mp4 ! qtdemux ! h265parse ! v4l2h265dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/FlyingBirdFlock_1920x1080_30fps_HEVC_7862Kbps_withAudio.mp4 ! qtdemux ! h265parse ! v4l2h265dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/FlyingBirdFlock_1920x1080_30fps_HEVC_7862Kbps_withAudio.mp4 ! qtdemux ! h265parse ! v4l2h265dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/FlyingBirdFlock_1920x1080_30fps_HEVC_7862Kbps_withAudio.mp4 ! qtdemux ! h265parse ! v4l2h265dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/FlyingBirdFlock_1920x1080_30fps_HEVC_7862Kbps_withAudio.mp4 ! qtdemux ! h265parse ! v4l2h265dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/FlyingBirdFlock_1920x1080_30fps_HEVC_7862Kbps_withAudio.mp4 ! qtdemux ! h265parse ! v4l2h265dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/FlyingBirdFlock_1920x1080_30fps_HEVC_7862Kbps_withAudio.mp4 ! qtdemux ! h265parse ! v4l2h265dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/FlyingBirdFlock_1920x1080_30fps_HEVC_7862Kbps_withAudio.mp4 ! qtdemux ! h265parse ! v4l2h265dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/FlyingBirdFlock_1920x1080_30fps_HEVC_7862Kbps_withAudio.mp4 ! qtdemux ! h265parse ! v4l2h265dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/FlyingBirdFlock_1920x1080_30fps_HEVC_7862Kbps_withAudio.mp4 ! qtdemux ! h265parse ! v4l2h265dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/FlyingBirdFlock_1920x1080_30fps_HEVC_7862Kbps_withAudio.mp4 ! qtdemux ! h265parse ! v4l2h265dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix. \
    filesrc location=/opt/FlyingBirdFlock_1920x1080_30fps_HEVC_7862Kbps_withAudio.mp4 ! qtdemux ! h265parse ! v4l2h265dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mix.Copy to clipboard

### AV1–24 会话解码

Note: 此用例在 Ubuntu Server 上不受支持。

    ulimit -n 4096 && gst-launch-1.0 -e qtivcomposer name=mix sink_0::position="<0, 0>" sink_0::dimensions="<240, 270>" \
    sink_1::position="<240, 0>" sink_1::dimensions="<240, 270>" \
    sink_2::position="<480, 0>" sink_2::dimensions="<240, 270>" \
    sink_3::position="<720, 0>" sink_3::dimensions="<240, 270>" \
    sink_4::position="<960, 0>" sink_4::dimensions="<240, 270>" \
    sink_5::position="<1200, 0>" sink_5::dimensions="<240, 270>" \
    sink_6::position="<1440, 0>" sink_6::dimensions="<240, 270>" \
    sink_7::position="<1680, 0>" sink_7::dimensions="<240, 270>" \
    sink_8::position="<0, 270>" sink_8::dimensions="<240, 270>" \
    sink_9::position="<240, 270>" sink_9::dimensions="<240, 270>" \
    sink_10::position="<480, 270>" sink_10::dimensions="<240, 270>" \
    sink_11::position="<720, 270>" sink_11::dimensions="<240, 270>" \
    sink_12::position="<960, 270>" sink_12::dimensions="<240, 270>" \
    sink_13::position="<1200, 270>" sink_13::dimensions="<240, 270>" \
    sink_14::position="<1440, 270>" sink_14::dimensions="<240, 270>" \
    sink_15::position="<1680, 270>" sink_15::dimensions="<240, 270>" \
    sink_16::position="<0, 540>" sink_16::dimensions="<240, 270>" \
    sink_17::position="<240, 540>" sink_17::dimensions="<240, 270>" \
    sink_18::position="<480, 540>" sink_18::dimensions="<240, 270>" \
    sink_19::position="<720, 540>" sink_19::dimensions="<240, 270>" \
    sink_20::position="<960, 540>" sink_20::dimensions="<240, 270>" \
    sink_21::position="<1200, 540>" sink_21::dimensions="<240, 270>" \
    sink_22::position="<1440, 540>" sink_22::dimensions="<240, 270>" \
    sink_23::position="<1680, 540>" sink_23::dimensions="<240, 270>" \
    mix. ! fpsdisplaysink text-overlay=false video-sink="waylandsink fullscreen=true" -v \
    filesrc location=/opt/sjxbqm_1080p30fps_25_4882Kbps.mp4 ! qtdemux ! av1parse ! v4l2av1dec capture-io-mode=4 output-io-mode=4 ! mix. \
    filesrc location=/opt/sjxbqm_1080p30fps_25_4882Kbps.mp4 ! qtdemux ! av1parse ! v4l2av1dec capture-io-mode=4 output-io-mode=4 ! mix. \
    filesrc location=/opt/sjxbqm_1080p30fps_25_4882Kbps.mp4 ! qtdemux ! av1parse ! v4l2av1dec capture-io-mode=4 output-io-mode=4 ! mix. \
    filesrc location=/opt/sjxbqm_1080p30fps_25_4882Kbps.mp4 ! qtdemux ! av1parse ! v4l2av1dec capture-io-mode=4 output-io-mode=4 ! mix. \
    filesrc location=/opt/sjxbqm_1080p30fps_25_4882Kbps.mp4 ! qtdemux ! av1parse ! v4l2av1dec capture-io-mode=4 output-io-mode=4 ! mix. \
    filesrc location=/opt/sjxbqm_1080p30fps_25_4882Kbps.mp4 ! qtdemux ! av1parse ! v4l2av1dec capture-io-mode=4 output-io-mode=4 ! mix. \
    filesrc location=/opt/sjxbqm_1080p30fps_25_4882Kbps.mp4 ! qtdemux ! av1parse ! v4l2av1dec capture-io-mode=4 output-io-mode=4 ! mix. \
    filesrc location=/opt/sjxbqm_1080p30fps_25_4882Kbps.mp4 ! qtdemux ! av1parse ! v4l2av1dec capture-io-mode=4 output-io-mode=4 ! mix. \
    filesrc location=/opt/sjxbqm_1080p30fps_25_4882Kbps.mp4 ! qtdemux ! av1parse ! v4l2av1dec capture-io-mode=4 output-io-mode=4 ! mix. \
    filesrc location=/opt/sjxbqm_1080p30fps_25_4882Kbps.mp4 ! qtdemux ! av1parse ! v4l2av1dec capture-io-mode=4 output-io-mode=4 ! mix. \
    filesrc location=/opt/sjxbqm_1080p30fps_25_4882Kbps.mp4 ! qtdemux ! av1parse ! v4l2av1dec capture-io-mode=4 output-io-mode=4 ! mix. \
    filesrc location=/opt/sjxbqm_1080p30fps_25_4882Kbps.mp4 ! qtdemux ! av1parse ! v4l2av1dec capture-io-mode=4 output-io-mode=4 ! mix. \
    filesrc location=/opt/sjxbqm_1080p30fps_25_4882Kbps.mp4 ! qtdemux ! av1parse ! v4l2av1dec capture-io-mode=4 output-io-mode=4 ! mix. \
    filesrc location=/opt/sjxbqm_1080p30fps_25_4882Kbps.mp4 ! qtdemux ! av1parse ! v4l2av1dec capture-io-mode=4 output-io-mode=4 ! mix. \
    filesrc location=/opt/sjxbqm_1080p30fps_25_4882Kbps.mp4 ! qtdemux ! av1parse ! v4l2av1dec capture-io-mode=4 output-io-mode=4 ! mix. \
    filesrc location=/opt/sjxbqm_1080p30fps_25_4882Kbps.mp4 ! qtdemux ! av1parse ! v4l2av1dec capture-io-mode=4 output-io-mode=4 ! mix. \
    filesrc location=/opt/sjxbqm_1080p30fps_25_4882Kbps.mp4 ! qtdemux ! av1parse ! v4l2av1dec capture-io-mode=4 output-io-mode=4 ! mix. \
    filesrc location=/opt/sjxbqm_1080p30fps_25_4882Kbps.mp4 ! qtdemux ! av1parse ! v4l2av1dec capture-io-mode=4 output-io-mode=4 ! mix. \
    filesrc location=/opt/sjxbqm_1080p30fps_25_4882Kbps.mp4 ! qtdemux ! av1parse ! v4l2av1dec capture-io-mode=4 output-io-mode=4 ! mix. \
    filesrc location=/opt/sjxbqm_1080p30fps_25_4882Kbps.mp4 ! qtdemux ! av1parse ! v4l2av1dec capture-io-mode=4 output-io-mode=4 ! mix. \
    filesrc location=/opt/sjxbqm_1080p30fps_25_4882Kbps.mp4 ! qtdemux ! av1parse ! v4l2av1dec capture-io-mode=4 output-io-mode=4 ! mix. \
    filesrc location=/opt/sjxbqm_1080p30fps_25_4882Kbps.mp4 ! qtdemux ! av1parse ! v4l2av1dec capture-io-mode=4 output-io-mode=4 ! mix. \
    filesrc location=/opt/sjxbqm_1080p30fps_25_4882Kbps.mp4 ! qtdemux ! av1parse ! v4l2av1dec capture-io-mode=4 output-io-mode=4 ! mix. \
    filesrc location=/opt/sjxbqm_1080p30fps_25_4882Kbps.mp4 ! qtdemux ! av1parse ! v4l2av1dec capture-io-mode=4 output-io-mode=4 ! mix.Copy to clipboard

### H.264–12 会话解码和编码

    ulimit -n 4096 && gst-launch-1.0 -e filesrc location=/opt/1920_1080_h264_30fps_1min.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! h264parse ! mp4mux ! filesink location=/opt/enc_1.mp4 \
    filesrc location=/opt/1920_1080_h264_30fps_1min.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! h264parse ! mp4mux ! filesink location=/opt/enc_2.mp4 \
    filesrc location=/opt/1920_1080_h264_30fps_1min.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! h264parse ! mp4mux ! filesink location=/opt/enc_3.mp4 \
    filesrc location=/opt/1920_1080_h264_30fps_1min.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! h264parse ! mp4mux ! filesink location=/opt/enc_4.mp4 \
    filesrc location=/opt/1920_1080_h264_30fps_1min.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! h264parse ! mp4mux ! filesink location=/opt/enc_5.mp4 \
    filesrc location=/opt/1920_1080_h264_30fps_1min.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! h264parse ! mp4mux ! filesink location=/opt/enc_6.mp4 \
    filesrc location=/opt/1920_1080_h264_30fps_1min.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! h264parse ! mp4mux ! filesink location=/opt/enc_7.mp4 \
    filesrc location=/opt/1920_1080_h264_30fps_1min.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! h264parse ! mp4mux ! filesink location=/opt/enc_8.mp4 \
    filesrc location=/opt/1920_1080_h264_30fps_1min.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! h264parse ! mp4mux ! filesink location=/opt/enc_9.mp4 \
    filesrc location=/opt/1920_1080_h264_30fps_1min.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! h264parse ! mp4mux ! filesink location=/opt/enc_10.mp4 \
    filesrc location=/opt/1920_1080_h264_30fps_1min.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! h264parse ! mp4mux ! filesink location=/opt/enc_11.mp4 \
    filesrc location=/opt/1920_1080_h264_30fps_1min.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! h264parse ! mp4mux ! filesink location=/opt/enc_12.mp4Copy to clipboard

### H264–24 会话编码

Note: Qualcomm Dragonwing^™^ RB3 Gen 2 支持最多 16 个会话编码。

    gst-launch-1.0 -e filesrc blocksize=3133440 location=/tmp/dump_1080.yuv ! 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=4 ! filesink location=/opt/enc_0.h264 \
    filesrc blocksize=3133440 location=/opt/dump_1080.yuv ! 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=4 ! filesink location=/opt/enc_1.h264 \
    filesrc blocksize=3133440 location=/opt/dump_1080.yuv ! 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=4 ! filesink location=/opt/enc_2.h264 \
    filesrc blocksize=3133440 location=/opt/dump_1080.yuv ! 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=4 ! filesink location=/opt/enc_3.h264 \
    filesrc blocksize=3133440 location=/opt/dump_1080.yuv ! 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=4 ! filesink location=/opt/enc_4.h264 \
    filesrc blocksize=3133440 location=/opt/dump_1080.yuv ! 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=4 ! filesink location=/opt/enc_5.h264 \
    filesrc blocksize=3133440 location=/opt/dump_1080.yuv ! 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=4 ! filesink location=/opt/enc_6.h264 \
    filesrc blocksize=3133440 location=/opt/dump_1080.yuv ! 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=4 ! filesink location=/opt/enc_7.h264 \
    filesrc blocksize=3133440 location=/opt/dump_1080.yuv ! 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=4 ! filesink location=/opt/enc_8.h264 \
    filesrc blocksize=3133440 location=/opt/dump_1080.yuv ! 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=4 ! filesink location=/opt/enc_9.h264 \
    filesrc blocksize=3133440 location=/opt/dump_1080.yuv ! 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=4 ! filesink location=/opt/enc_10.h264 \
    filesrc blocksize=3133440 location=/opt/dump_1080.yuv ! 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=4 ! filesink location=/opt/enc_11.h264 \
    filesrc blocksize=3133440 location=/opt/dump_1080.yuv ! 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=4 ! filesink location=/opt/enc_12.h264 \
    filesrc blocksize=3133440 location=/opt/dump_1080.yuv ! 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=4 ! filesink location=/opt/enc_13.h264 \
    filesrc blocksize=3133440 location=/opt/dump_1080.yuv ! 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=4 ! filesink location=/opt/enc_14.h264 \
    filesrc blocksize=3133440 location=/opt/dump_1080.yuv ! 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=4 ! filesink location=/opt/enc_15.h264 \
    filesrc blocksize=3133440 location=/opt/dump_1080.yuv ! 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=4 ! filesink location=/opt/enc_16.h264 \
    filesrc blocksize=3133440 location=/opt/dump_1080.yuv ! 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=4 ! filesink location=/opt/enc_17.h264 \
    filesrc blocksize=3133440 location=/opt/dump_1080.yuv ! 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=4 ! filesink location=/opt/enc_18.h264 \
    filesrc blocksize=3133440 location=/opt/dump_1080.yuv ! 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=4 ! filesink location=/opt/enc_19.h264 \
    filesrc blocksize=3133440 location=/opt/dump_1080.yuv ! 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=4 ! filesink location=/opt/enc_20.h264 \
    filesrc blocksize=3133440 location=/opt/dump_1080.yuv ! 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=4 ! filesink location=/opt/enc_21.h264 \
    filesrc blocksize=3133440 location=/opt/dump_1080.yuv ! 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=4 ! filesink location=/opt/enc_22.h264 \
    filesrc blocksize=3133440 location=/opt/dump_1080.yuv ! 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=4 ! filesink location=/opt/enc_23.h264Copy to clipboard

Qualcomm Dragonwing^™^ RB3 Gen 2 支持最多 16 个会话编码：

    ulimit -n 4096 && gst-launch-1.0 -e filesrc blocksize=460800 location=/opt/dump_640_480.yuv ! video/x-raw,format="NV12",width=640,height=480,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! v4l2h264enc capture-io-mode=4 output-io-mode=4 ! filesink location=/opt/enc_0.h264 \
    filesrc blocksize=460800 location=/opt/dump_640_480.yuv ! video/x-raw,format="NV12",width=640,height=480,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! v4l2h264enc capture-io-mode=4 output-io-mode=4 ! filesink location=/opt/enc_1.h264 \
    filesrc blocksize=460800 location=/opt/dump_640_480.yuv ! video/x-raw,format="NV12",width=640,height=480,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! v4l2h264enc capture-io-mode=4 output-io-mode=4 ! filesink location=/opt/enc_2.h264 \
    filesrc blocksize=460800 location=/opt/dump_640_480.yuv ! video/x-raw,format="NV12",width=640,height=480,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! v4l2h264enc capture-io-mode=4 output-io-mode=4 ! filesink location=/opt/enc_3.h264 \
    filesrc blocksize=460800 location=/opt/dump_640_480.yuv ! video/x-raw,format="NV12",width=640,height=480,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! v4l2h264enc capture-io-mode=4 output-io-mode=4 ! filesink location=/opt/enc_4.h264 \
    filesrc blocksize=460800 location=/opt/dump_640_480.yuv ! video/x-raw,format="NV12",width=640,height=480,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! v4l2h264enc capture-io-mode=4 output-io-mode=4 ! filesink location=/opt/enc_5.h264 \
    filesrc blocksize=460800 location=/opt/dump_640_480.yuv ! video/x-raw,format="NV12",width=640,height=480,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! v4l2h264enc capture-io-mode=4 output-io-mode=4 ! filesink location=/opt/enc_6.h264 \
    filesrc blocksize=460800 location=/opt/dump_640_480.yuv ! video/x-raw,format="NV12",width=640,height=480,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! v4l2h264enc capture-io-mode=4 output-io-mode=4 ! filesink location=/opt/enc_7.h264 \
    filesrc blocksize=460800 location=/opt/dump_640_480.yuv ! video/x-raw,format="NV12",width=640,height=480,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! v4l2h264enc capture-io-mode=4 output-io-mode=4 ! filesink location=/opt/enc_8.h264 \
    filesrc blocksize=460800 location=/opt/dump_640_480.yuv ! video/x-raw,format="NV12",width=640,height=480,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! v4l2h264enc capture-io-mode=4 output-io-mode=4 ! filesink location=/opt/enc_9.h264 \
    filesrc blocksize=460800 location=/opt/dump_640_480.yuv ! video/x-raw,format="NV12",width=640,height=480,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! v4l2h264enc capture-io-mode=4 output-io-mode=4 ! filesink location=/opt/enc_10.h264 \
    filesrc blocksize=460800 location=/opt/dump_640_480.yuv ! video/x-raw,format="NV12",width=640,height=480,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! v4l2h264enc capture-io-mode=4 output-io-mode=4 ! filesink location=/opt/enc_11.h264 \
    filesrc blocksize=460800 location=/opt/dump_640_480.yuv ! video/x-raw,format="NV12",width=640,height=480,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! v4l2h264enc capture-io-mode=4 output-io-mode=4 ! filesink location=/opt/enc_12.h264 \
    filesrc blocksize=460800 location=/opt/dump_640_480.yuv ! video/x-raw,format="NV12",width=640,height=480,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! v4l2h264enc capture-io-mode=4 output-io-mode=4 ! filesink location=/opt/enc_13.h264 \
    filesrc blocksize=460800 location=/opt/dump_640_480.yuv ! video/x-raw,format="NV12",width=640,height=480,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! v4l2h264enc capture-io-mode=4 output-io-mode=4 ! filesink location=/opt/enc_14.h264 \
    filesrc blocksize=460800 location=/opt/dump_640_480.yuv ! video/x-raw,format="NV12",width=640,height=480,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! v4l2h264enc capture-io-mode=4 output-io-mode=4 ! filesink location=/opt/enc_15.h264Copy to clipboard

## AV1 解码器和 4K VP9 解码器，240 fps 播放

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

使用 AV1 和 VP9 解码器运行解码用例。这些用例仅适用于 Dragonwing IQ-9075。

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

### AV1 用例

Note: 以下用例在 Ubuntu Server 上不受支持。

- 3840 × 2160

        gst-launch-1.0 -e filesrc location=/opt/SeaOtters_AV1_3840x2160_30_25.0Mbps_Main_no_audio_30.0.mp4 ! qtdemux ! av1parse ! v4l2av1dec capture-io-mode=4 output-io-mode=4 ! fpsdisplaysink video-sink="waylandsink fullscreen=true" -vCopy to clipboard
- 1920 × 1080

        gst-launch-1.0 -e filesrc location=/opt/CaribouHerd_AV1_1920x1080_30_39.38Mbps_Main_AAC_34.472.mp4 ! qtdemux ! av1parse ! v4l2av1dec capture-io-mode=4 output-io-mode=4 ! fpsdisplaysink video-sink="waylandsink fullscreen=true" -vCopy to clipboard
- 1280 × 720

        gst-launch-1.0 -e filesrc location=/opt/av1.mp4 ! qtdemux ! av1parse ! v4l2av1dec capture-io-mode=4 output-io-mode=4 ! fpsdisplaysink video-sink="waylandsink fullscreen=true" -vCopy to clipboard

### VP9 用例

3840 × 2160，240 fps

    gst-launch-1.0 -e filesrc location=/opt/test_UHD_240FPS.ivf ! ivfparse ! queue ! v4l2vp9dec capture-io-mode=4 output-io-mode=4 ! video/x-raw,format=NV12 ! queue ! fpsdisplaysink text-overlay=false video-sink="fakesink" -vCopy to clipboard

Last Published: Nov 05, 2025

[Previous Topic
摄像头](https://docs.qualcomm.com/bundle/publicresource/80-70022-50SC/topics/camera.md) [Next Topic
多摄像头/多客户端用例](https://docs.qualcomm.com/bundle/publicresource/80-70022-50SC/topics/multi-camera-multi-client-use-cases.md)