# Camera

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

The Qualcomm IM SDK camera plugin, camsrc, acts as a client to the Qualcomm camera
        service. The camera use cases show the execution and display of the 1080p YUV streams from a
        live source.

For more information about the camera plugin, see [camera
                architecture](https://docs.qualcomm.com/doc/80-70022-50/topic/architecture.html#camera).

Before running the use case, ensure that you complete the preconditions mentioned in
                [GStreamer command-line use cases](https://docs.qualcomm.com/doc/80-70022-50/topic/gstreamer-application-use-cases.html).

### Single 1080p YUV stream from live source

Run the use case on the target
                device:

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

The content from the camera stream is displayed.

To stop the use case, use CTRL + C.

The following pipeline shows a single 1080p stream taken from the camera and sent to
                display.

<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="385" height="110.7091064453125" viewbox="0 0 385 110.7091064453125">
  <g id="Layer_1" data-name="Layer 1">
    <g>
      <rect x=".5" y=".499786376953125" width="384" height="109.70947265625" rx="7.499999999999996" ry="7.499999999999996" style="fill: #fafafa;"></rect>
      <path d="M377,1c3.85980224609375,0,7,3.14019775390625,7,7v94.7091064453125c0,3.85980224609375-3.14019775390625,7-7,7H8c-3.85980224609375,0-7-3.14019775390625-7-7V8c0-3.85980224609375,3.14019775390625-7,7-7h369M377,0H8C3.581756591796875,0,0,3.581710815429688,0,8v94.7091064453125c0,4.418289184570312,3.581756591796875,8,8,8h369c4.41827392578125,0,8-3.581710815429688,8-8V8c0-4.418289184570312-3.58172607421875-8-8-8h0Z" style="fill: #d2d7e1;"></path>
    </g>
  </g>
  <g id="Layer_2" data-name="Layer 2">
    <g>
      <g>
        <rect x="20" y="19.999986541937687" width="160" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(73.429733276367188 48.506690979003906)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">camsrc</tspan></text>
      </g>
      <g>
        <line x1="180" y1="44.999984741210938" x2="199.97662353515625" y2="44.999984741210938" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="198.955322265625 48.49041748046875 205 44.999984741210938 198.955322265625 41.509552001953125 198.955322265625 48.49041748046875"></polygon>
      </g>
      <g>
        <rect x="205" y="19.999986541937687" width="160" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(241.09771728515625 48.506690979003906)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">waylandsink</tspan></text>
      </g>
    </g>
    <g>
      <text transform="translate(285.00030517578125 94.091461181640625)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Open source</tspan></text>
      <rect x="264.749281690337739" y="81.999984741210938" width="15.999999999998181" height="16" rx="1.999999999999773" ry="1.999999999999773" style="fill: #007884;"></rect>
    </g>
  </g>
</svg>

### Three 720 YUV streams from live source

Run the use case on the target
                device:

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

The content from camera streams is displayed.

To stop the use case, use CTRL + C.
Note: With the GMSL camera, it's been observed that the display
                    doesn't work and the use case doesn't stop when using CTRL
                            + C.

The following pipeline shows three 720p streams taken from the camera and sent to
                display with each stream displayed at different positions on the screen.

<?xml version="1.0" encoding="UTF-8"?>
<svg id="Layer_2" data-name="Layer 2" xmlns="http://www.w3.org/2000/svg" width="385" height="227.37579345703125" viewbox="0 0 385 227.37579345703125">
  <g>
    <rect x=".5" y=".49981689453125" width="384" height="226.3759765625" rx="7.5" ry="7.5" style="fill: #fafafa;"></rect>
    <path d="M377,1c3.85980224609375,0,7,3.14019775390625,7,7v211.37579345703125c0,3.85980224609375-3.14019775390625,7-7,7H8c-3.85980224609375,0-7-3.14019775390625-7-7V8c0-3.85980224609375,3.14019775390625-7,7-7h369M377,0H8C3.581756591796875,0,0,3.581748962402344,0,8v211.37579345703125c0,4.418243408203125,3.581756591796875,8,8,8h369c4.41827392578125,0,8-3.581756591796875,8-8V8c0-4.418251037597656-3.58172607421875-8-8-8h0Z" style="fill: #d2d7e1;"></path>
  </g>
  <g>
    <polyline points="209.259033203125 35.000015258789062 190.5374755859375 35.000015258789062 190.5374755859375 168.50665283203125 209.259033203125 168.50665283203125" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></polyline>
    <polygon points="208.091796875 31.010948181152344 215 35.000015258789062 208.091796875 38.989082336426691 208.091796875 31.010948181152344"></polygon>
    <polygon points="208.091796875 172.495712280273438 215 168.50665283203125 208.091796875 164.517593383789062 208.091796875 172.495712280273438"></polygon>
  </g>
  <g>
    <rect x="9.99999819927325" y="75.000017059515812" width="160" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
    <text transform="translate(63.429733276367188 103.506721496582031)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">camsrc</tspan></text>
  </g>
  <g>
    <line x1="170" y1="100.000015258789062" x2="209.97662353515625" y2="100.000015258789062" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
    <polygon points="208.955322265625 103.490447998046875 215 100.000015258789062 208.955322265625 96.50958251953125 208.955322265625 103.490447998046875"></polygon>
  </g>
  <g>
    <g>
      <rect x="215.00000180072675" y="140.000018860242562" width="160" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
      <text transform="translate(251.09771728515625 168.506729125976562)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">waylandsink</tspan></text>
    </g>
    <g>
      <rect x="215.00000180072675" y="75.000017059515812" width="160" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
      <text transform="translate(251.09771728515625 103.506721496582031)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">waylandsink</tspan></text>
    </g>
    <g>
      <rect x="215.00000180072675" y="10.000015258789062" width="160" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
      <text transform="translate(251.09771728515625 38.506721496582031)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">waylandsink</tspan></text>
    </g>
  </g>
  <g>
    <text transform="translate(296.509765625 213.133636474609375)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Open source</tspan></text>
    <rect x="276.258725395957299" y="201.04215494791697" width="16" height="16" rx="2" ry="2" style="fill: #007884;"></rect>
  </g>
</svg>

### Request many streams with different fps from camera

Run the following use cases on the target device:

- Two streams with capture request mode at 30 fps/15
                    fps:

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

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

Note: This use case isn't supported in the current
                        release.
- Two streams with capture request mode at 5 fps/25 fps:
The smaller frame rate
                        is processed first and the camera updates the frame rate on the second
                        stream.

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

### Set sensor mode

Set the sensor mode in the camsrc
                plugin:

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

For `sensor-mode=<option>`, add the appropriate number for the
                sensor mode.

For example, for
                    imx766\_preview\_1080p30fps\_streaming\_sensor\_mode\_1 use case,
                run the following command to set the sensor mode as
                0:

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

## Single camera stream with socket

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

This use case shows how to store a camera stream in a socket. This camera stream from
        the socket is then encoded to AVC and stored in a file.

Run the use case on the target device:
- In console
                    1:

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

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

The following figure shows the flow of the pipeline execution:

Figure : 1080p camera stream sent to socket, read from socket, encoded to AVC and stored
                in file
            
            <?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="940" height="279.679533004760742" viewbox="0 0 940 279.679533004760742">
  <g id="Layer_1" data-name="Layer 1">
    <g>
      <rect x=".5" y=".500211715698242" width="939" height="278.67919921875" rx="7.5" ry="7.5" style="fill: #fafafa;"></rect>
      <path d="M932,1c3.859741210939319,0,7,3.140235900878906,7,7v263.679533004761652c0,3.859771728514716-3.140258789060681,6.999999999999091-7,6.999999999999091H8c-3.859771728515625,0-7-3.140228271484375-7-6.999999999999091V8c0-3.859764099121094,3.140228271484375-7,7-7h924M932,0H8C3.581771850585938,0,0,3.581647872924805,0,8v263.679533004761652c0,4.418334960936591,3.581771850585938,7.999999999999091,8,7.999999999999091h924c4.418334960939319,0,8-3.5816650390625,8-7.999999999999091V8c0-4.418352127075195-3.581665039060681-8-8-8h0Z" style="fill: #d2d7e1;"></path>
    </g>
    <line y1="121.614667892456055" x2="940" y2="121.614667892456055" style="fill: none; stroke: #d2d7e1; stroke-miterlimit: 10;"></line>
    <g>
      <g>
        <text transform="translate(742.92767333984375 257.77094841003418)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Qualcomm </tspan></text>
        <rect x="722.676673214342372" y="245.67945671081543" width="16" height="16" rx="2" ry="2" style="fill: #2a2aea;"></rect>
      </g>
      <g>
        <text transform="translate(841.509490966796875 257.77094841003418)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Open source</tspan></text>
        <rect x="821.258454627199171" y="245.67945671081543" width="16" height="16" rx="2" ry="2" style="fill: #007884;"></rect>
      </g>
    </g>
  </g>
  <g id="Layer_2" data-name="Layer 2">
    <g>
      <g>
        <rect x="297.5" y="51.614667892456055" width="160" height="50" rx="4" ry="4" style="fill: #2a2aea;"></rect>
        <text transform="translate(336.031280517578125 80.121370315551758)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">qtiqmmfsrc</tspan></text>
      </g>
      <g>
        <line x1="457.5" y1="76.614668806681948" x2="477.47662353515625" y2="76.614668806681948" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="476.455322265625 80.10510154594067 482.5 76.614668806681948 476.455322265625 73.124236067424135 476.455322265625 80.10510154594067"></polygon>
      </g>
      <g>
        <rect x="482.5" y="51.614667892456055" width="160" height="50" rx="4" ry="4" style="fill: #2a2aea;"></rect>
        <text transform="translate(515.082061767578125 80.121370315551758)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">qtisocketsink</tspan></text>
      </g>
    </g>
    <g>
      <g>
        <rect x="20" y="173.67951774597168" width="160" height="50" rx="4" ry="4" style="fill: #2a2aea;"></rect>
        <text transform="translate(56.097686767578125 202.186216354370117)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">qtisocketsrc</tspan></text>
      </g>
      <g>
        <line x1="180" y1="198.679522181944776" x2="199.976654052734375" y2="198.679522181944776" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="198.955352783203125 202.169954921202589 205 198.679522181944776 198.955352783203125 195.189089442686964 198.955352783203125 202.169954921202589"></polygon>
      </g>
      <g>
        <rect x="205" y="173.67951774597168" width="160" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(239.476604461669922 202.186216354370117)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">v4l2h264enc</tspan></text>
      </g>
      <g>
        <line x1="365" y1="198.679522181944776" x2="384.97662353515625" y2="198.679522181944776" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="383.955322265625 202.169954921202589 390 198.679522181944776 383.955322265625 195.189089442686964 383.955322265625 202.169954921202589"></polygon>
      </g>
      <g>
        <rect x="390" y="173.67951774597168" width="160" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(432.207061767578125 202.186216354370117)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">h264parse</tspan></text>
      </g>
      <g>
        <line x1="550" y1="198.679522181944776" x2="569.97662353515625" y2="198.679522181944776" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="568.955322265625 202.169954921202589 575 198.679522181944776 568.955322265625 195.189089442686964 568.955322265625 202.169954921202589"></polygon>
      </g>
      <g>
        <rect x="575" y="173.67951774597168" width="160" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(612.648468017578125 202.186216354370117)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">mpegtsmux</tspan></text>
      </g>
      <g>
        <line x1="735" y1="198.679522181944776" x2="754.97662353515625" y2="198.679522181944776" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="753.955322265625 202.169954921202589 760 198.679522181944776 753.955322265625 195.189089442686964 753.955322265625 202.169954921202589"></polygon>
      </g>
      <g>
        <rect x="760" y="173.67951774597168" width="160" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(792.2852783203125 202.186216354370117)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">tcpserversink</tspan></text>
      </g>
    </g>
    <text transform="translate(439.605470657348633 31.454511642456055)" style="font-family: Roboto-Bold, Roboto; font-size: 16px; font-weight: 700;"><tspan x="0" y="0">GST BIN</tspan></text>
    <text transform="translate(439.605470657348633 153.51936149597168)" style="font-family: Roboto-Bold, Roboto; font-size: 16px; font-weight: 700;"><tspan x="0" y="0">GST BIN</tspan></text>
  </g>
</svg>

## RTMP stream 

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

The use case uses ISP or RTSP camera feeds to generate RTMP stream. You can display
        the RTMP stream on a Waylandsink or save it as a file.

Run the following use cases on the target device:
- RTSP
                        source:

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

    In
                        this command, replace rtmp://192.168.1.171/live/01 with
                        the IP address of your device.

    The following figure shows the flow of
                        the pipeline execution:

Figure : Pipeline for RTMP stream with RTSP source
                        
                        <?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="720" height="150" viewbox="0 0 720 150">
  <g id="Layer_2" data-name="Layer 2">
    <g>
      <rect x=".5" y=".499847412109375" width="719" height="149" rx="7.499999999999999" ry="7.499999999999999" style="fill: #fafafa;"></rect>
      <path d="M712,1c3.85980224609375,0,7,3.140182495117188,7,7v134c0,3.859832763671875-3.14019775390625,7-7,7H8c-3.859817504882812,0-7-3.140167236328125-7-7V8c0-3.859817504882812,3.140182495117188-7,7-7h704M712,0H8C3.58172607421875,0,0,3.58172607421875,0,8v134c0,4.41827392578125,3.58172607421875,8,8,8h704c4.41827392578125,0,8-3.58172607421875,8-8V8c0-4.41827392578125-3.58172607421875-8-8-8h0Z" style="fill: #d2d7e1;"></path>
    </g>
  </g>
  <g id="Layer_3" data-name="Layer 3">
    <g>
      <g>
        <text transform="translate(619.2457275390625 125.676521301269531)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Open source</tspan></text>
        <rect x="598.99471443557195" y="113.585030793863552" width="16" height="16" rx="2" ry="2" style="fill: #007884;"></rect>
      </g>
      <g>
        <line x1="117.73546028137207" y1="58.415008544921875" x2="156.994476318359375" y2="58.415008544921875" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="155.82728385925293 62.404052734375 162.73546028137207 58.415008544921875 155.82728385925293 54.425933837890625 155.82728385925293 62.404052734375"></polygon>
      </g>
      <g>
        <line x1="257.735458374023438" y1="58.415008544921875" x2="296.994476318359375" y2="58.415008544921875" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="295.827285766601562 62.404052734375 302.735458374023438 58.415008544921875 295.827285766601562 54.425933837890625 295.827285766601562 62.404052734375"></polygon>
      </g>
      <g>
        <line x1="397.7354736328125" y1="58.415008544921875" x2="436.994476318359375" y2="58.415008544921875" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="435.8272705078125 62.404052734375 442.7354736328125 58.415008544921875 435.8272705078125 54.425933837890625 435.8272705078125 62.404052734375"></polygon>
      </g>
      <g>
        <line x1="547.7354736328125" y1="58.415008544921875" x2="586.994476318359375" y2="58.415008544921875" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="585.8272705078125 62.404052734375 592.7354736328125 58.415008544921875 585.8272705078125 54.425933837890625 585.8272705078125 62.404052734375"></polygon>
      </g>
      <g>
        <rect x="22.263871536564693" y="28.414999016727961" width="96" height="60" rx="3.999999999999998" ry="3.999999999999998" style="fill: #007884;"></rect>
        <text transform="translate(46.696746826171875 61.937103271484375)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">rtspsrc </tspan></text>
      </g>
      <g>
        <rect x="162.735460429779778" y="28.414999016727961" width="95" height="60" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(184.272476196289062 55.106658935546875)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">rtph264 </tspan><tspan x="5.52685546875" y="16.7998046875">depay </tspan></text>
      </g>
      <g>
        <rect x="302.735460429779778" y="28.414999016727961" width="95" height="60" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(317.166763305664062 62.506561279296875)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">h264parse</tspan></text>
      </g>
      <g>
        <rect x="442.735460429779778" y="28.414999016727961" width="105" height="60" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(474.252685546875 62.506378173828125)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">flvmux</tspan></text>
      </g>
      <g>
        <rect x="592.735460429779778" y="28.414999016727961" width="105" height="60" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(613.868896484375 62.506378173828125)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">rtmp2sink</tspan></text>
      </g>
    </g>
  </g>
</svg>
- Camera
                        source:

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

    The
                        following figure shows the flow of the pipeline execution:

Figure : Pipeline for RTMP stream with camera source
                        
                        <?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="840" height="150" viewbox="0 0 840 150">
  <g id="Layer_2" data-name="Layer 2">
    <g>
      <rect x=".5" y=".5" width="839" height="149" rx="7.5" ry="7.5" style="fill: #fafafa;"></rect>
      <path d="M832,1c3.86,0,7,3.14,7,7v134c0,3.86-3.14,7-7,7H8c-3.86,0-7-3.14-7-7V8c0-3.86,3.14-7,7-7h824M832,0H8C3.58,0,0,3.58,0,8v134c0,4.42,3.58,8,8,8h824c4.42,0,8-3.58,8-8V8c0-4.42-3.58-8-8-8h0Z" style="fill: #d2d7e1;"></path>
    </g>
  </g>
  <g id="Layer_3" data-name="Layer 3">
    <g>
      <g>
        <text transform="translate(643.43 119.31)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Qualcomm </tspan></text>
        <rect x="623.18" y="107.22" width="16" height="16" rx="2" ry="2" style="fill: #2a2aea;"></rect>
        <text transform="translate(742.01 119.31)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Open source</tspan></text>
        <rect x="721.76" y="107.22" width="16" height="16" rx="2" ry="2" style="fill: #007884;"></rect>
      </g>
      <g>
        <line x1="115.5" y1="56.78" x2="149.76" y2="56.78" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="148.59 60.77 155.5 56.78 148.59 52.79 148.59 60.77"></polygon>
      </g>
      <g>
        <line x1="250.5" y1="56.78" x2="284.76" y2="56.78" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="283.59 60.77 290.5 56.78 283.59 52.79 283.59 60.77"></polygon>
      </g>
      <g>
        <line x1="385.5" y1="56.78" x2="419.76" y2="56.78" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="418.59 60.77 425.5 56.78 418.59 52.79 418.59 60.77"></polygon>
      </g>
      <g>
        <line x1="530.5" y1="56.78" x2="564.76" y2="56.78" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="563.59 60.77 570.5 56.78 563.59 52.79 563.59 60.77"></polygon>
      </g>
      <g>
        <line x1="675.5" y1="56.78" x2="709.76" y2="56.78" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="708.59 60.77 715.5 56.78 708.59 52.79 708.59 60.77"></polygon>
      </g>
      <g>
        <rect x="19.5" y="26.78" width="96" height="60" rx="4" ry="4" style="fill: #2a2aea;"></rect>
        <text transform="translate(31.21 60.3)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">qtiqmmfsrc</tspan></text>
      </g>
      <g>
        <rect x="155.5" y="26.78" width="95" height="60" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(173.8 60.87)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">capsfilter</tspan></text>
      </g>
      <g>
        <rect x="290.5" y="26.78" width="95" height="60" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(298.17 60.87)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">v4l2h264enc</tspan></text>
      </g>
      <g>
        <rect x="425.5" y="26.78" width="105" height="60" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(444.93 60.87)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">h264parse</tspan></text>
      </g>
      <g>
        <rect x="570.5" y="26.78" width="105" height="60" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(602.02 60.87)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">flvmux</tspan></text>
      </g>
      <g>
        <rect x="715.5" y="26.78" width="105" height="60" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(736.63 60.87)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">rtmp2sink</tspan></text>
      </g>
    </g>
  </g>
</svg>

To see the output on the Waylandsink run the following
            command:

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

To save the output as a media file, connect to VLC and run the following command:

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

In this
            command, replace rtmp://192.168.1.171/live/01 with the IP address
            of your device.

## Troubleshooting

For any application, if the camera service doesn't work or fails during execution,
        see [Camera troubleshooting](https://docs.qualcomm.com/bundle/publicresource/topics/80-70022-17/troubleshooting.html) to restart it.

Last Published: Feb 20, 2026

[Previous Topic
Run multimedia use cases](https://docs.qualcomm.com/bundle/publicresource/80-70022-50/topics/multimedia-use-cases.md) [Next Topic
Video encode and decode](https://docs.qualcomm.com/bundle/publicresource/80-70022-50/topics/camera-and-video-encode.md)