# Camera encoding

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

The **gst-camera-encode-example** application allows you to record and encode a
        single camera stream.

Figure : Pipeline for camera encoding
            
            <?xml version="1.0" encoding="UTF-8"?>
<svg id="Layer_2" data-name="Layer 2" xmlns="http://www.w3.org/2000/svg" width="1005.282241821289062" height="132.666748046875" viewbox="0 0 1005.282241821289062 132.666748046875">
  <g>
    <rect x=".500015258789062" y=".49993896484375" width="1004.28173828125" height="131.66650390625" rx="7.5" ry="7.5" style="fill: #fafafa;"></rect>
    <path d="M997.282241821289062,1c3.85986328125,0,7,3.140121459960938,7,7v116.666748046875c0,3.85986328125-3.14013671875,7-7,7H8c-3.859870910644531,0-7-3.14013671875-7-7V8c0-3.859878540039062,3.140129089355469-7,7-7h989.282241821289062M997.282241821289062,0H8C3.581756591796875,0,0,3.581756591796875,0,8v116.666748046875c0,4.418243408203125,3.581756591796875,8,8,8h989.282241821289062c4.418334960939319,0,8-3.581756591796875,8-8V8c0-4.418243408203125-3.581665039060681-8-8-8h0Z" style="fill: #d2d7e1;"></path>
  </g>
  <g>
    <rect x="20.000017796282009" y="20.000024023436708" width="140" height="56.666700000001583" rx="4" ry="4" style="fill: #2a2aea;"></rect>
    <text transform="translate(48.531264513731003 53.0089111328125)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">qtiqmmfsrc</tspan></text>
    <rect x="184.16796516087561" y="20.000024023436708" width="140" height="56.666699999999764" rx="4" ry="4" style="fill: #007884;"></rect>
    <rect x="349.790245161162602" y="20.000024023436708" width="140.000000000002728" height="56.666699999999764" rx="4" ry="4" style="fill: #007884;"></rect>
    <rect x="845.282239283795207" y="20.000024023436708" width="140.000000000003638" height="56.666699999999764" rx="3.999999999989086" ry="3.999999999989086" style="fill: #007884;"></rect>
    <text transform="translate(220.7963827252388 53.009246826171875)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">capsfilter</tspan></text>
    <text transform="translate(374.2670858502388 53.009246826171875)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">v4l2h264enc</tspan></text>
    <rect x="514.987881562192342" y="20.000024023436708" width="140" height="56.666699999999764" rx="4" ry="4" style="fill: #007884;"></rect>
    <text transform="translate(547.1943319439888 53.009246826171875)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">h264parse</tspan></text>
    <rect x="680.095998157721624" y="20.000024023436708" width="140" height="56.666699999999764" rx="4" ry="4" style="fill: #007884;"></rect>
    <text transform="translate(718.7167928814888 53.009246826171875)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">mp4mux</tspan></text>
    <text transform="translate(889.8486288189888 53.009246826171875)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">filesink</tspan></text>
    <g>
      <line x1="325.105545043945312" y1="48.3333740234375" x2="342.697891235352472" y2="48.3333740234375" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
      <polygon points="341.530715942382812 52.322433471679688 348.438888549804688 48.3333740234375 341.530715942382812 44.344314575195312 341.530715942382812 52.322433471679688"></polygon>
    </g>
    <g>
      <line x1="160.834640502929688" y1="48.3333740234375" x2="178.426986694335938" y2="48.3333740234375" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
      <polygon points="177.259780883789062 52.322433471679688 184.167953491210938 48.3333740234375 177.259780883789062 44.344314575195312 177.259780883789062 52.322433471679688"></polygon>
    </g>
    <g>
      <line x1="490.733779907226562" y1="48.3333740234375" x2="508.326126098632812" y2="48.3333740234375" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
      <polygon points="507.158950805664062 52.322433471679688 514.067092895507812 48.3333740234375 507.158950805664062 44.344314575195312 507.158950805664062 52.322433471679688"></polygon>
    </g>
    <g>
      <line x1="655.834365844726562" y1="48.3333740234375" x2="673.426712036132812" y2="48.3333740234375" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
      <polygon points="672.259475708007812 52.322433471679688 679.167678833007812 48.3333740234375 672.259475708007812 44.344314575195312 672.259475708007812 52.322433471679688"></polygon>
    </g>
    <g>
      <line x1="821.051712036132812" y1="48.3333740234375" x2="838.644058227539062" y2="48.3333740234375" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
      <polygon points="837.476882934570312 52.322433471679688 844.385086059570312 48.3333740234375 837.476882934570312 44.344314575195312 837.476882934570312 52.322433471679688"></polygon>
    </g>
  </g>
  <g>
    <g>
      <text transform="translate(814.945144653320312 108.758255004882812)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Qualcomm </tspan></text>
      <rect x="794.694112675309952" y="96.666748046875" width="16" height="16" rx="2" ry="2" style="fill: #2a2aea;"></rect>
    </g>
    <g>
      <text transform="translate(913.526931762695312 108.758255004882812)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Open source</tspan></text>
      <rect x="893.275894088163113" y="96.666748046875" width="15.999999999996362" height="16" rx="1.999999999999545" ry="1.999999999999545" style="fill: #007884;"></rect>
    </g>
  </g>
</svg>

For information about the plugins used in this pipeline, see [Pipeline flow](https://docs.qualcomm.com/doc/80-70022-50/topic/camera-encode.html#camera-encode__section_nn5_cck_zcc).

## Run the application on the target device

1. Ensure that you complete the [Prerequisites](https://docs.qualcomm.com/doc/80-70022-50/topic/prerequisites-for-python-sample-applications.html).
2. Run the camera encode
                    script:

        gst-camera-encode.pyCopy to clipboard

To display the available help options, run the following command:

    gst-camera-encode.py -hCopy to clipboard

## Expected output

The output is saved in a file at /etc/media/recording.mp4

## Pipeline flow

The following table lists the plugins used in the camera encoding
                    pipeline:| Plugin | Description |
| :--- | :--- |
| [qtiqmmfsrc](https://docs.qualcomm.com/doc/80-70022-50/topic/qtiqmmfsrc.html) | <ul class="ul" id="camera-encode__ul_o43_szq_ndc"><br>                                    <li class="li">Captures the camera live stream.</li><br><br>                                    <li class="li">Capsfilter is applied to enforce constraints on the raw<br>                                        video data.</li><br><br>                                </ul> |
| [v4l2h264enc](https://docs.qualcomm.com/doc/80-70022-50/topic/v4l2h264enc.html) | Encodes the video using the H.264 format. |
| H264parse | Parses the video. |
| Mp4mux | Multiplexes the video into an MP4 container. |
| Filesink | Writes the video to a file. |

**Parent Topic:** [Run Python-based applications](https://docs.qualcomm.com/doc/80-70022-50/topic/python-sample-applications.html)

Last Published: Feb 20, 2026

[Previous Topic
Prerequisites](https://docs.qualcomm.com/bundle/publicresource/80-70022-50/topics/prerequisites-for-python-sample-applications.md) [Next Topic
Camera streaming using OpenCV](https://docs.qualcomm.com/bundle/publicresource/80-70022-50/topics/gst-camera-opencv-resize-py.md)