# Transform and Transcode use cases

The transcoding use cases show converting or transforming the video streams from one format to another.

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

Note

The Qualcomm Computer Vision SDK (fcv) engine is currently not supported.

## 1080p to 1080p–rotate (90/180/270)

The use case shows the rotation of scenes from a camera by 180 degrees. The rotated image is displayed on a local display device.

Note

To rotate the video at different angles, use the rotate property from the [qtivtransform](https://docs.qualcomm.com/doc/80-70029-50/topic/qtivtransform.html) plugin.

Use the following commands to run the use case on the target device:

- Transform the scene running on DSP using Qualcomm Computer Vision SDK (fcv) engine:

gst-launch-1.0 -e qtiqmmfsrc name=camsrc video_0::type=video video_1::type=preview ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! qtivtransform engine=fcv rotate=180 ! waylandsink fullscreen=true async=false sync=false
        Copy to clipboard
- Transform the scene running on the GPU using OpenGL ES:

gst-launch-1.0 -e qtiqmmfsrc name=camsrc video_0::type=video video_1::type=preview ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! qtivtransform engine=gles rotate=180 ! waylandsink fullscreen=true async=false sync=false
        Copy to clipboard

The host camera displays the transformed stream.

To stop the use case, use **CTRL + C**.

The following figure shows the flow of the pipeline execution:

<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="570" height="125.078651428222656" viewbox="0 0 570 125.078651428222656" aria-label="../../_images/pipeline_rotation_display_display_camera_source.svg">
  <g id="Layer_1" data-name="Layer 1">
    <g>
      <rect x=".5" y=".499992370605469" width="569" height="124.07861328125" rx="7.499999999999993" ry="7.499999999999993" style="fill: #fafafa;"></rect>
      <path d="M562,1c3.85980224609375,0,7,3.140220642089844,7,7v109.078651428222656c0,3.859786987304688-3.14019775390625,7-7,7H8c-3.859771728515625,0-7-3.140213012695312-7-7V8c0-3.859779357910156,3.140228271484375-7,7-7h554M562,0H8C3.58172607421875,0,0,3.581787109375,0,8v109.078651428222656c0,4.41827392578125,3.58172607421875,8,8,8h554c4.41827392578125,0,8-3.58172607421875,8-8V8c0-4.418212890625-3.58172607421875-8-8-8h0Z" style="fill: #d2d7e1;"></path>
    </g>
    <g>
      <g>
        <text transform="translate(372.92779541015625 101.170158386230469)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Qualcomm </tspan></text>
        <rect x="352.676807201771226" y="89.078651428222656" width="16" height="16" rx="2" ry="2" style="fill: #2a2aea;"></rect>
      </g>
      <g>
        <text transform="translate(471.50958251953125 101.170158386230469)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Open source</tspan></text>
        <rect x="451.258588614628025" y="89.078651428222656" 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="205" y="19.078673308335965" width="160" height="50.000000000000909" rx="4" ry="4" style="fill: #2a2aea;"></rect>
        <text transform="translate(236.753936767578125 47.585384368896484)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">qtivtransform</tspan></text>
      </g>
      <g>
        <line x1="365" y1="44.07867431640625" x2="384.259033203125" y2="44.07867431640625" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="383.091796875 48.067741394043878 390 44.07867431640625 383.091796875 40.089607238769531 383.091796875 48.067741394043878"></polygon>
      </g>
      <g>
        <line x1="180" y1="44.07867431640625" x2="199.259033203125" y2="44.07867431640625" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="198.091796875 48.067741394043878 205 44.07867431640625 198.091796875 40.089607238769531 198.091796875 48.067741394043878"></polygon>
      </g>
      <g>
        <rect x="390" y="19.078673308335965" width="160" height="50.000000000000909" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(426.097686767578125 47.585384368896484)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">waylandsink</tspan></text>
      </g>
      <g>
        <rect x="20" y="19.078673308335965" width="160" height="50.000000000000909" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(73.429718017578125 47.585384368896484)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">camsrc</tspan></text>
      </g>
    </g>
  </g>
</svg>
**Figure : Pipeline for displaying flipped and downscaled images–camera source**

### Offline 1080p stream to 1080p–rotate (90/180/270)

The use case shows the rotation of scenes from a file source by 180 degrees. The rotated scene is displayed on a local display device.

Note

To rotate the video at different angles, see the rotate property from [qtivtransform](https://docs.qualcomm.com/doc/80-70029-50/topic/qtivtransform.html).

Use the following commands to run the use case on the target device:

- Transform the scene running on DSP using Qualcomm Computer Vision SDK (fcv) engine:

gst-launch-1.0 -e filesrc location=/opt/<H264/AVC_file>.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw,format=NV12 ! qtivtransform engine=fcv rotate=180 ! queue ! waylandsink fullscreen=true
        Copy to clipboard
- Transform the scene running on the GPU using OpenGL ES:

gst-launch-1.0 -e filesrc location=/opt/<H264/AVC_file>.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw,format=NV12 ! qtivtransform engine=gles rotate=180 ! queue ! waylandsink fullscreen=true
        Copy to clipboard

The transformed stream from the file source is displayed.

To stop the use case, use **CTRL + C**.

The following figure shows the flow of the pipeline execution:

<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="935" height="156.877180099487305" viewbox="0 0 935 156.877180099487305" aria-label="../../_images/pipeline_rotation_display_display_file_source.svg">
  <g id="Layer_1" data-name="Layer 1">
    <g>
      <rect x=".5" y=".49989128112793" width="934" height="155.87744140625" rx="7.499999999999998" ry="7.499999999999998" style="fill: #fafafa;"></rect>
      <path d="M927,1c3.859741210939319,0,7,3.140237808227539,7,7.000001907348633v140.877178192138672c0,3.859756469726562-3.140258789060681,7-7,7H8c-3.859771728515625,0-7-3.140243530273438-7-7V8.000001907348633c0-3.859764099121094,3.140228271484375-7.000001907348633,7-7.000001907348633h919M927,0H8C3.581771850585938,0,0,3.581766128540039,0,8.000001907348633v140.877178192138672c0,4.418228149414062,3.581771850585938,8,8,8h919c4.418334960939319,0,8-3.581771850585938,8-8V8.000001907348633c0-4.418235778808594-3.581665039060681-8.000001907348633-8-8.000001907348633h0Z" style="fill: #d2d7e1;"></path>
    </g>
    <g>
      <g>
        <text transform="translate(737.9276123046875 132.968671798706055)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Qualcomm </tspan></text>
        <rect x="717.676625432772198" y="120.877180099487305" width="16" height="16" rx="2" ry="2" style="fill: #2a2aea;"></rect>
      </g>
      <g>
        <text transform="translate(836.509429931640625 132.968671798706055)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Open source</tspan></text>
        <rect x="816.258406845628997" y="120.877180099487305" width="16" height="16" rx="2" ry="2" style="fill: #007884;"></rect>
      </g>
    </g>
  </g>
  <g id="Layer_2" data-name="Layer 2">
    <text transform="translate(437.10546875 32.657386779785156)" style="font-family: Roboto-Bold, Roboto; font-size: 16px; font-weight: 700;"><tspan x="0" y="0">GST BIN</tspan></text>
    <g>
      <g>
        <rect x="20" y="50.877187728881836" width="130" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(63.082061767578125 79.38389778137207)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">filesrc</tspan></text>
      </g>
      <g>
        <line x1="150" y1="75.877187728881836" x2="169.976654052734375" y2="75.877187728881836" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="168.955352783203125 79.367620468139648 175 75.877187728881836 168.955352783203125 72.386754989624023 168.955352783203125 79.367620468139648"></polygon>
      </g>
      <g>
        <rect x="175" y="50.877187728881836" width="130" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(208.703166961669922 79.38389778137207)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">qtdemux</tspan></text>
      </g>
      <g>
        <line x1="305" y1="75.877187728881836" x2="324.976654052734375" y2="75.877187728881836" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="323.955352783203125 79.367620468139648 330 75.877187728881836 323.955352783203125 72.386754989624023 323.955352783203125 79.367620468139648"></polygon>
      </g>
      <g>
        <rect x="330" y="50.877187728881836" width="130" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(357.207061767578125 79.38389778137207)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">h264parse</tspan></text>
      </g>
      <g>
        <line x1="460" y1="75.877187728881836" x2="479.97662353515625" y2="75.877187728881836" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="478.955322265625 79.367620468139648 485 75.877187728881836 478.955322265625 72.386754989624023 478.955322265625 79.367620468139648"></polygon>
      </g>
      <g>
        <rect x="485" y="50.877187728881836" width="120" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(499.378936767578125 79.38389778137207)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">v4l2h264dec</tspan></text>
      </g>
      <g>
        <line x1="605" y1="75.877187728881836" x2="624.97662353515625" y2="75.877187728881836" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="623.955322265625 79.367620468139648 630 75.877187728881836 623.955322265625 72.386754989624023 623.955322265625 79.367620468139648"></polygon>
      </g>
      <g>
        <rect x="630" y="50.877187728881836" width="130" height="50" rx="4" ry="4" style="fill: #2a2aea;"></rect>
        <text transform="translate(646.753936767578125 79.38389778137207)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">qtivtransform</tspan></text>
      </g>
      <g>
        <line x1="760" y1="75.877187728881836" x2="779.97662353515625" y2="75.877187728881836" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="778.955322265625 79.367620468139648 785 75.877187728881836 778.955322265625 72.386754989624023 778.955322265625 79.367620468139648"></polygon>
      </g>
      <g>
        <rect x="785" y="50.877187728881836" width="130" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(806.09765625 79.38389778137207)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">waylandsink</tspan></text>
      </g>
    </g>
  </g>
</svg>
**Figure : Pipeline for 4k stream downscaled to 1080p, and rotated, and displayed–file source**

### 4K to 1080p–rotate (90/180/270) and downscale

The use case shows a 4k resolution video stream from a camera downscaled to 1080p and rotated by 180 degrees. The video is then displayed on a local display device.

Note

To rotate the video at different angles, see the rotate property from [qtivtransform](https://docs.qualcomm.com/doc/80-70029-50/topic/qtivtransform.html).

Use the following commands to run the use case on the target device:

- Qualcomm Computer Vision SDK (fcv) engine:

gst-launch-1.0 -e qtiqmmfsrc name=camsrc video_0::type=video video_1::type=preview ! video/x-raw,format=NV12,width=3840,height=2160,framerate=30/1 ! qtivtransform engine=fcv rotate=180 ! video/x-raw,format=NV12,width=1920,height=1080 ! waylandsink fullscreen=true
        Copy to clipboard
- GLES engine:

gst-launch-1.0 -e qtiqmmfsrc name=camsrc video_0::type=video video_1::type=preview ! video/x-raw,format=NV12,width=3840,height=2160,framerate=30/1 ! qtivtransform engine=gles rotate=180 ! video/x-raw,format=NV12,width=1920,height=1080 ! waylandsink fullscreen=true
        Copy to clipboard

The transformed stream from the camera is displayed.

To stop the use case, use **CTRL + C**.

The following figure shows the flow of the pipeline execution:

<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="570" height="126" viewbox="0 0 570 126" aria-label="../../_images/pipeline_4k_downscaled_1080p_camera_source.svg">
  <g id="Layer_1" data-name="Layer 1">
    <g>
      <rect x=".5" y=".49993896484375" width="569" height="125" rx="7.499999999999996" ry="7.499999999999996" style="fill: #fafafa;"></rect>
      <path d="M562,1c3.85980224609375,0,7,3.140213012695312,7,7v110c0,3.859786987304688-3.14019775390625,7-7,7H8c-3.859771728515625,0-7-3.140213012695312-7-7V8c0-3.859786987304688,3.140228271484375-7,7-7h554M562,0H8C3.58172607421875,0,0,3.581710815429688,0,8v110c0,4.418289184570312,3.58172607421875,8,8,8h554c4.41827392578125,0,8-3.581710815429688,8-8V8c0-4.418289184570312-3.58172607421875-8-8-8h0Z" style="fill: #d2d7e1;"></path>
    </g>
    <g>
      <g>
        <text transform="translate(369.60430908203125 102.091461181640625)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Qualcomm </tspan></text>
        <rect x="349.353327593402355" y="90" width="16" height="16" rx="2" ry="2" style="fill: #2a2aea;"></rect>
      </g>
      <g>
        <text transform="translate(468.18609619140625 102.091461181640625)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Open source</tspan></text>
        <rect x="447.935109006253697" y="90" width="16" height="16" rx="2" ry="2" style="fill: #007884;"></rect>
      </g>
    </g>
  </g>
  <g id="Layer_2" data-name="Layer 2">
    <g>
      <rect x="205" y="20.000006621324246" width="160" height="50.000000000000909" rx="4" ry="4" style="fill: #2a2aea;"></rect>
      <text transform="translate(236.910186767578125 48.506717681884766)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">qtivt</tspan><tspan x="31.1796875" y="0" style="letter-spacing: -.01953125em;">r</tspan><tspan x="36.28125" y="0">ansform</tspan></text>
      <g>
        <line x1="365" y1="45.000007629394531" x2="383.259033203125" y2="45.000007629394531" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="382.091796875 48.989074707032159 389 45.000007629394531 382.091796875 41.010940551757812 382.091796875 48.989074707032159"></polygon>
      </g>
      <g>
        <line x1="180" y1="45.000007629394531" x2="198.259033203125" y2="45.000007629394531" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="197.091796875 48.989074707032159 204 45.000007629394531 197.091796875 41.010940551757812 197.091796875 48.989074707032159"></polygon>
      </g>
      <rect x="390" y="20.000006621324246" width="160" height="50.000000000000909" rx="4" ry="4" style="fill: #007884;"></rect>
      <text transform="translate(425.199249267578125 48.506717681884766)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0" style="letter-spacing: -.01611328125em;">W</tspan><tspan x="13.9375" y="0" style="letter-spacing: -.00732421875em;">a</tspan><tspan x="22.5234375" y="0">ylandsink</tspan></text>
      <rect x="20" y="20.000006621324246" width="160" height="50.000000000000909" rx="4" ry="4" style="fill: #007884;"></rect>
      <text transform="translate(73.503936767578125 48.506717681884766)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">cams</tspan><tspan x="39.3515625" y="0" style="letter-spacing: -.00927734375em;">r</tspan><tspan x="44.6171875" y="0">c</tspan></text>
    </g>
  </g>
</svg>
**Figure : Pipeline for 4k image downscaled to 1080p, rotated, and displayed–camera source**

### Offline 4K to 1080p–rotate (90/180/270) and downscale

The pipeline shows a 4k resolution video stream from a file source downscaled to 1080p and rotated by 180 degrees. The video is then displayed on a local display device.

Note

To rotate the video at different angles, see the rotate property from [qtivtransform](https://docs.qualcomm.com/doc/80-70029-50/topic/qtivtransform.html).

Use the following commands to run the use case on the target device:

- Qualcomm Computer Vision SDK (fcv) engine:

gst-launch-1.0 -e filesrc location=/opt/<4K_H264/AVC_file>.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw,format=NV12 ! qtivtransform engine=fcv rotate=180 ! video/x-raw,format=NV12,width=1920,height=1080 ! waylandsink fullscreen=true
        Copy to clipboard
- GLES engine:

gst-launch-1.0 -e filesrc location=/opt/<4K_H264/AVC_file>.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw,format=NV12 ! qtivtransform engine=gles rotate=180 ! video/x-raw,format=NV12,width=1920,height=1080 ! waylandsink fullscreen=true
        Copy to clipboard

The transformed stream from the file source is displayed.

To stop the use case, use **CTRL + C**.

The following figure shows the flow of the pipeline execution:

<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="935" height="156.877180099487305" viewbox="0 0 935 156.877180099487305" aria-label="../../_images/pipeline_rotation_display_display_file_source.svg">
  <g id="Layer_1" data-name="Layer 1">
    <g>
      <rect x=".5" y=".49989128112793" width="934" height="155.87744140625" rx="7.499999999999998" ry="7.499999999999998" style="fill: #fafafa;"></rect>
      <path d="M927,1c3.859741210939319,0,7,3.140237808227539,7,7.000001907348633v140.877178192138672c0,3.859756469726562-3.140258789060681,7-7,7H8c-3.859771728515625,0-7-3.140243530273438-7-7V8.000001907348633c0-3.859764099121094,3.140228271484375-7.000001907348633,7-7.000001907348633h919M927,0H8C3.581771850585938,0,0,3.581766128540039,0,8.000001907348633v140.877178192138672c0,4.418228149414062,3.581771850585938,8,8,8h919c4.418334960939319,0,8-3.581771850585938,8-8V8.000001907348633c0-4.418235778808594-3.581665039060681-8.000001907348633-8-8.000001907348633h0Z" style="fill: #d2d7e1;"></path>
    </g>
    <g>
      <g>
        <text transform="translate(737.9276123046875 132.968671798706055)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Qualcomm </tspan></text>
        <rect x="717.676625432772198" y="120.877180099487305" width="16" height="16" rx="2" ry="2" style="fill: #2a2aea;"></rect>
      </g>
      <g>
        <text transform="translate(836.509429931640625 132.968671798706055)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Open source</tspan></text>
        <rect x="816.258406845628997" y="120.877180099487305" width="16" height="16" rx="2" ry="2" style="fill: #007884;"></rect>
      </g>
    </g>
  </g>
  <g id="Layer_2" data-name="Layer 2">
    <text transform="translate(437.10546875 32.657386779785156)" style="font-family: Roboto-Bold, Roboto; font-size: 16px; font-weight: 700;"><tspan x="0" y="0">GST BIN</tspan></text>
    <g>
      <g>
        <rect x="20" y="50.877187728881836" width="130" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(63.082061767578125 79.38389778137207)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">filesrc</tspan></text>
      </g>
      <g>
        <line x1="150" y1="75.877187728881836" x2="169.976654052734375" y2="75.877187728881836" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="168.955352783203125 79.367620468139648 175 75.877187728881836 168.955352783203125 72.386754989624023 168.955352783203125 79.367620468139648"></polygon>
      </g>
      <g>
        <rect x="175" y="50.877187728881836" width="130" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(208.703166961669922 79.38389778137207)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">qtdemux</tspan></text>
      </g>
      <g>
        <line x1="305" y1="75.877187728881836" x2="324.976654052734375" y2="75.877187728881836" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="323.955352783203125 79.367620468139648 330 75.877187728881836 323.955352783203125 72.386754989624023 323.955352783203125 79.367620468139648"></polygon>
      </g>
      <g>
        <rect x="330" y="50.877187728881836" width="130" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(357.207061767578125 79.38389778137207)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">h264parse</tspan></text>
      </g>
      <g>
        <line x1="460" y1="75.877187728881836" x2="479.97662353515625" y2="75.877187728881836" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="478.955322265625 79.367620468139648 485 75.877187728881836 478.955322265625 72.386754989624023 478.955322265625 79.367620468139648"></polygon>
      </g>
      <g>
        <rect x="485" y="50.877187728881836" width="120" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(499.378936767578125 79.38389778137207)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">v4l2h264dec</tspan></text>
      </g>
      <g>
        <line x1="605" y1="75.877187728881836" x2="624.97662353515625" y2="75.877187728881836" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="623.955322265625 79.367620468139648 630 75.877187728881836 623.955322265625 72.386754989624023 623.955322265625 79.367620468139648"></polygon>
      </g>
      <g>
        <rect x="630" y="50.877187728881836" width="130" height="50" rx="4" ry="4" style="fill: #2a2aea;"></rect>
        <text transform="translate(646.753936767578125 79.38389778137207)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">qtivtransform</tspan></text>
      </g>
      <g>
        <line x1="760" y1="75.877187728881836" x2="779.97662353515625" y2="75.877187728881836" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="778.955322265625 79.367620468139648 785 75.877187728881836 778.955322265625 72.386754989624023 778.955322265625 79.367620468139648"></polygon>
      </g>
      <g>
        <rect x="785" y="50.877187728881836" width="130" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(806.09765625 79.38389778137207)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">waylandsink</tspan></text>
      </g>
    </g>
  </g>
</svg>
**Figure : Pipeline for 4k stream downscaled to 1080p, and rotated, and displayed–file source**

### 1080p to 1080p–horizontal and vertical flip

The use case shows how to flip the scenes of a camera stream horizontally.

Note

To flip the scenes, in the following commands, replace `flip-horizontal` with `flip-vertical` and vice versa. For more information, see [qtivtransform](https://docs.qualcomm.com/doc/80-70029-50/topic/qtivtransform.html).

Use the following commands to run the use case on the target device:

- Qualcomm Computer Vision SDK (fcv) engine:

gst-launch-1.0 -e qtiqmmfsrc name=camsrc video_0::type=video video_1::type=preview ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! qtivtransform engine=fcv flip-horizontal=true ! waylandsink fullscreen=true
        Copy to clipboard
- GLES engine:

gst-launch-1.0 -e qtiqmmfsrc name=camsrc video_0::type=video video_1::type=preview ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! qtivtransform engine=gles flip-horizontal=true ! waylandsink fullscreen=true
        Copy to clipboard

The transformed stream from a camera is displayed.

To stop the use case, use **CTRL + C**.

The following figure shows the flow of the pipeline execution:

<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="570" height="125.078651428222656" viewbox="0 0 570 125.078651428222656" aria-label="../../_images/pipeline_rotation_display_display_camera_source.svg">
  <g id="Layer_1" data-name="Layer 1">
    <g>
      <rect x=".5" y=".499992370605469" width="569" height="124.07861328125" rx="7.499999999999993" ry="7.499999999999993" style="fill: #fafafa;"></rect>
      <path d="M562,1c3.85980224609375,0,7,3.140220642089844,7,7v109.078651428222656c0,3.859786987304688-3.14019775390625,7-7,7H8c-3.859771728515625,0-7-3.140213012695312-7-7V8c0-3.859779357910156,3.140228271484375-7,7-7h554M562,0H8C3.58172607421875,0,0,3.581787109375,0,8v109.078651428222656c0,4.41827392578125,3.58172607421875,8,8,8h554c4.41827392578125,0,8-3.58172607421875,8-8V8c0-4.418212890625-3.58172607421875-8-8-8h0Z" style="fill: #d2d7e1;"></path>
    </g>
    <g>
      <g>
        <text transform="translate(372.92779541015625 101.170158386230469)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Qualcomm </tspan></text>
        <rect x="352.676807201771226" y="89.078651428222656" width="16" height="16" rx="2" ry="2" style="fill: #2a2aea;"></rect>
      </g>
      <g>
        <text transform="translate(471.50958251953125 101.170158386230469)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Open source</tspan></text>
        <rect x="451.258588614628025" y="89.078651428222656" 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="205" y="19.078673308335965" width="160" height="50.000000000000909" rx="4" ry="4" style="fill: #2a2aea;"></rect>
        <text transform="translate(236.753936767578125 47.585384368896484)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">qtivtransform</tspan></text>
      </g>
      <g>
        <line x1="365" y1="44.07867431640625" x2="384.259033203125" y2="44.07867431640625" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="383.091796875 48.067741394043878 390 44.07867431640625 383.091796875 40.089607238769531 383.091796875 48.067741394043878"></polygon>
      </g>
      <g>
        <line x1="180" y1="44.07867431640625" x2="199.259033203125" y2="44.07867431640625" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="198.091796875 48.067741394043878 205 44.07867431640625 198.091796875 40.089607238769531 198.091796875 48.067741394043878"></polygon>
      </g>
      <g>
        <rect x="390" y="19.078673308335965" width="160" height="50.000000000000909" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(426.097686767578125 47.585384368896484)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">waylandsink</tspan></text>
      </g>
      <g>
        <rect x="20" y="19.078673308335965" width="160" height="50.000000000000909" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(73.429718017578125 47.585384368896484)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">camsrc</tspan></text>
      </g>
    </g>
  </g>
</svg>
**Figure : Pipeline for displaying flipped and downscaled images–camera source**

### Offline 1080p to 1080p–horizontal and vertical flip

The use case shows how to flip scenes horizontally.

Note

To flip the scenes, in the following commands, replace `flip-horizontal` with `flip-vertical` and vice versa. For more information, see [qtivtransform](https://docs.qualcomm.com/doc/80-70029-50/topic/qtivtransform.html).

Use the following commands to run the use case on the target device:

- Qualcomm Computer Vision SDK (fcv) engine:

gst-launch-1.0 -e filesrc location=/opt/<1080p_H264/AVC_file>.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw,format=NV12 ! qtivtransform engine=fcv flip-horizontal=true ! waylandsink fullscreen=true
        Copy to clipboard
- GLES engine:

gst-launch-1.0 -e filesrc location=/opt/<1080p_H264/AVC_file>.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw,format=NV12 ! qtivtransform engine=gles flip-horizontal=true ! waylandsink fullscreen=true
        Copy to clipboard

The transformed stream from a file source is displayed.

To stop the use case, use **CTRL + C**.

The following figure shows the flow of the pipeline execution:

<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="935" height="156.877180099487305" viewbox="0 0 935 156.877180099487305" aria-label="../../_images/pipeline_rotation_display_display_file_source.svg">
  <g id="Layer_1" data-name="Layer 1">
    <g>
      <rect x=".5" y=".49989128112793" width="934" height="155.87744140625" rx="7.499999999999998" ry="7.499999999999998" style="fill: #fafafa;"></rect>
      <path d="M927,1c3.859741210939319,0,7,3.140237808227539,7,7.000001907348633v140.877178192138672c0,3.859756469726562-3.140258789060681,7-7,7H8c-3.859771728515625,0-7-3.140243530273438-7-7V8.000001907348633c0-3.859764099121094,3.140228271484375-7.000001907348633,7-7.000001907348633h919M927,0H8C3.581771850585938,0,0,3.581766128540039,0,8.000001907348633v140.877178192138672c0,4.418228149414062,3.581771850585938,8,8,8h919c4.418334960939319,0,8-3.581771850585938,8-8V8.000001907348633c0-4.418235778808594-3.581665039060681-8.000001907348633-8-8.000001907348633h0Z" style="fill: #d2d7e1;"></path>
    </g>
    <g>
      <g>
        <text transform="translate(737.9276123046875 132.968671798706055)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Qualcomm </tspan></text>
        <rect x="717.676625432772198" y="120.877180099487305" width="16" height="16" rx="2" ry="2" style="fill: #2a2aea;"></rect>
      </g>
      <g>
        <text transform="translate(836.509429931640625 132.968671798706055)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Open source</tspan></text>
        <rect x="816.258406845628997" y="120.877180099487305" width="16" height="16" rx="2" ry="2" style="fill: #007884;"></rect>
      </g>
    </g>
  </g>
  <g id="Layer_2" data-name="Layer 2">
    <text transform="translate(437.10546875 32.657386779785156)" style="font-family: Roboto-Bold, Roboto; font-size: 16px; font-weight: 700;"><tspan x="0" y="0">GST BIN</tspan></text>
    <g>
      <g>
        <rect x="20" y="50.877187728881836" width="130" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(63.082061767578125 79.38389778137207)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">filesrc</tspan></text>
      </g>
      <g>
        <line x1="150" y1="75.877187728881836" x2="169.976654052734375" y2="75.877187728881836" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="168.955352783203125 79.367620468139648 175 75.877187728881836 168.955352783203125 72.386754989624023 168.955352783203125 79.367620468139648"></polygon>
      </g>
      <g>
        <rect x="175" y="50.877187728881836" width="130" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(208.703166961669922 79.38389778137207)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">qtdemux</tspan></text>
      </g>
      <g>
        <line x1="305" y1="75.877187728881836" x2="324.976654052734375" y2="75.877187728881836" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="323.955352783203125 79.367620468139648 330 75.877187728881836 323.955352783203125 72.386754989624023 323.955352783203125 79.367620468139648"></polygon>
      </g>
      <g>
        <rect x="330" y="50.877187728881836" width="130" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(357.207061767578125 79.38389778137207)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">h264parse</tspan></text>
      </g>
      <g>
        <line x1="460" y1="75.877187728881836" x2="479.97662353515625" y2="75.877187728881836" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="478.955322265625 79.367620468139648 485 75.877187728881836 478.955322265625 72.386754989624023 478.955322265625 79.367620468139648"></polygon>
      </g>
      <g>
        <rect x="485" y="50.877187728881836" width="120" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(499.378936767578125 79.38389778137207)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">v4l2h264dec</tspan></text>
      </g>
      <g>
        <line x1="605" y1="75.877187728881836" x2="624.97662353515625" y2="75.877187728881836" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="623.955322265625 79.367620468139648 630 75.877187728881836 623.955322265625 72.386754989624023 623.955322265625 79.367620468139648"></polygon>
      </g>
      <g>
        <rect x="630" y="50.877187728881836" width="130" height="50" rx="4" ry="4" style="fill: #2a2aea;"></rect>
        <text transform="translate(646.753936767578125 79.38389778137207)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">qtivtransform</tspan></text>
      </g>
      <g>
        <line x1="760" y1="75.877187728881836" x2="779.97662353515625" y2="75.877187728881836" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="778.955322265625 79.367620468139648 785 75.877187728881836 778.955322265625 72.386754989624023 778.955322265625 79.367620468139648"></polygon>
      </g>
      <g>
        <rect x="785" y="50.877187728881836" width="130" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(806.09765625 79.38389778137207)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">waylandsink</tspan></text>
      </g>
    </g>
  </g>
</svg>
**Figure : Pipeline for 4k stream downscaled to 1080p, and rotated, and displayed–file source**

### 4K to 1080p–horizontal and vertical flip with downscale

The use case shows how to downscale a 4k resolution video stream to 1080p and flip the scenes horizontally.

Note

To flip the scenes, in the following commands, replace `flip-horizontal` with `flip-vertical` and vice versa. For more information, see [qtivtransform](https://docs.qualcomm.com/doc/80-70029-50/topic/qtivtransform.html).

Use the following commands to run the use case on the target device:

- Qualcomm Computer Vision SDK (fcv) engine:

gst-launch-1.0 -e qtiqmmfsrc name=camsrc video_0::type=video video_1::type=preview ! video/x-raw,format=NV12,width=3840,height=2160,framerate=30/1 ! qtivtransform engine=fcv flip-vertical=true ! video/x-raw,format=NV12,width=1920,height=1080 ! waylandsink fullscreen=true
        Copy to clipboard
- GLES engine:

gst-launch-1.0 -e qtiqmmfsrc name=camsrc video_0::type=video video_1::type=preview ! video/x-raw,format=NV12,width=3840,height=2160,framerate=30/1 ! qtivtransform engine=gles flip-vertical=true ! video/x-raw,format=NV12,width=1920,height=1080 ! waylandsink fullscreen=true
        Copy to clipboard

The transformed stream from the camera is displayed.

To stop the use case, use **CTRL + C**.

The following figure shows the flow of the pipeline execution:

<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="570" height="125.078651428222656" viewbox="0 0 570 125.078651428222656" aria-label="../../_images/pipeline_rotation_display_display_camera_source.svg">
  <g id="Layer_1" data-name="Layer 1">
    <g>
      <rect x=".5" y=".499992370605469" width="569" height="124.07861328125" rx="7.499999999999993" ry="7.499999999999993" style="fill: #fafafa;"></rect>
      <path d="M562,1c3.85980224609375,0,7,3.140220642089844,7,7v109.078651428222656c0,3.859786987304688-3.14019775390625,7-7,7H8c-3.859771728515625,0-7-3.140213012695312-7-7V8c0-3.859779357910156,3.140228271484375-7,7-7h554M562,0H8C3.58172607421875,0,0,3.581787109375,0,8v109.078651428222656c0,4.41827392578125,3.58172607421875,8,8,8h554c4.41827392578125,0,8-3.58172607421875,8-8V8c0-4.418212890625-3.58172607421875-8-8-8h0Z" style="fill: #d2d7e1;"></path>
    </g>
    <g>
      <g>
        <text transform="translate(372.92779541015625 101.170158386230469)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Qualcomm </tspan></text>
        <rect x="352.676807201771226" y="89.078651428222656" width="16" height="16" rx="2" ry="2" style="fill: #2a2aea;"></rect>
      </g>
      <g>
        <text transform="translate(471.50958251953125 101.170158386230469)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Open source</tspan></text>
        <rect x="451.258588614628025" y="89.078651428222656" 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="205" y="19.078673308335965" width="160" height="50.000000000000909" rx="4" ry="4" style="fill: #2a2aea;"></rect>
        <text transform="translate(236.753936767578125 47.585384368896484)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">qtivtransform</tspan></text>
      </g>
      <g>
        <line x1="365" y1="44.07867431640625" x2="384.259033203125" y2="44.07867431640625" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="383.091796875 48.067741394043878 390 44.07867431640625 383.091796875 40.089607238769531 383.091796875 48.067741394043878"></polygon>
      </g>
      <g>
        <line x1="180" y1="44.07867431640625" x2="199.259033203125" y2="44.07867431640625" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="198.091796875 48.067741394043878 205 44.07867431640625 198.091796875 40.089607238769531 198.091796875 48.067741394043878"></polygon>
      </g>
      <g>
        <rect x="390" y="19.078673308335965" width="160" height="50.000000000000909" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(426.097686767578125 47.585384368896484)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">waylandsink</tspan></text>
      </g>
      <g>
        <rect x="20" y="19.078673308335965" width="160" height="50.000000000000909" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(73.429718017578125 47.585384368896484)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">camsrc</tspan></text>
      </g>
    </g>
  </g>
</svg>
**Figure : Pipeline for displaying flipped and downscaled images–camera source**

### Downscale 4K to 1080p and encode to AVC MP4

The use case uses two copies of a 4k resolution video stream. The first copy is encoded and multiplexed to an MP4 file. A second copy is shared with qtivtransform to downscale it to 1080p resolution. The 1080p stream is then encoded and multiplexed to an MP4 file on the device.

Use the following commands to run the use case on the target device:

- Qualcomm Computer Vision SDK (fcv) engine:

Note

This use case isn’t supported on the Ubuntu Server.

gst-launch-1.0 -e qtiqmmfsrc name=camsrc video_0::type=video video_1::type=preview ! video/x-raw,format=NV12,width=3840,height=2160,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! tee name=t_split t_split. ! queue ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! h264parse ! queue ! mp4mux ! queue ! filesink location=/opt/4k_video.mp4 t_split. ! qtivtransform engine=fcv ! 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 ! h264parse ! queue ! mp4mux ! queue ! filesink location=/opt/downscaled_1080p_video.mp4
        Copy to clipboard
- GLES engine:

gst-launch-1.0 -e qtiqmmfsrc name=camsrc video_0::type=video video_1::type=preview ! video/x-raw,format=NV12,width=3840,height=2160,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! tee name=t_split t_split. ! queue ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! h264parse ! queue ! mp4mux ! queue ! filesink location=/opt/4k_video.mp4 t_split. ! qtivtransform engine=gles ! 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 ! h264parse ! queue ! mp4mux ! queue ! filesink location=/opt/downscaled_1080p_video.mp4
        Copy to clipboard

To stop the use case, use **CTRL + C**.

Pull the recorded content from the target device and play content on the Linux host computer.

In the terminal of the host computer, run the following command:

scp root@<IP address of target device>:/opt/ <destination directory>
    Copy to clipboard

In the terminal of the host computer, run the following command to pull the file content:

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

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

You can play the MP4 files on a media player. The camera stream is displayed.

The following figure shows the flow of the pipeline execution:

<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="1181" height="206" viewbox="0 0 1181 206" aria-label="../../_images/pipeline_4kvideo_encoding_downscaling_1080p.svg">
  <g id="Layer_1" data-name="Layer 1">
    <g>
      <rect x=".5" y=".499893188476562" width="1180" height="205" rx="7.499999999999998" ry="7.499999999999998" style="fill: #fafafa;"></rect>
      <path d="M1173,1c3.85986328125,0,7,3.140153884887695,7,7v190c0,3.859848022460938-3.14013671875,7-7,7H8c-3.859846115112305,0-7-3.140151977539062-7-7V8c0-3.859846115112305,3.140153884887695-7,7-7h1165M1173,0H8C3.581692695617676,0,0,3.581692695617676,0,8v190c0,4.418304443359375,3.581692695617676,8,8,8h1165c4.418334960939319,0,8-3.581695556640625,8-8V8c0-4.418307304382324-3.581665039060681-8-8-8h0Z" style="fill: #d2d7e1;"></path>
    </g>
    <g>
      <g>
        <text transform="translate(983.928314208984375 182.091476440429688)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Qualcomm </tspan></text>
        <rect x="963.677313616941319" y="170" width="16" height="16" rx="2" ry="2" style="fill: #2a2aea;"></rect>
      </g>
      <g>
        <text transform="translate(1082.5101318359375 182.091476440429688)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Open source</tspan></text>
        <rect x="1062.259095029798118" y="170" 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>
        <line x1="666" y1="45" x2="685.259033203125" y2="45" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="684.091796875 48.989063262939453 691 45 684.091796875 41.010936737060547 684.091796875 48.989063262939453"></polygon>
      </g>
      <g>
        <rect x="691" y="20" width="140" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(723.207061767578125 48.506711006164551)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">h264parse</tspan></text>
      </g>
      <g>
        <line x1="831" y1="45" x2="850.259033203125" y2="45" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="849.091796875 48.989063262939453 856 45 849.091796875 41.010936737060547 849.091796875 48.989063262939453"></polygon>
      </g>
      <g>
        <rect x="856" y="20" width="140" height="50" rx="3.999999999999886" ry="3.999999999999886" style="fill: #007884;"></rect>
        <text transform="translate(894.62109375 48.506711006164551)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">mp4mux</tspan></text>
      </g>
      <g>
        <line x1="996" y1="45" x2="1015.259033203130457" y2="45" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="1014.091796875 48.989063262939453 1021 45 1014.091796875 41.010936737060547 1014.091796875 48.989063262939453"></polygon>
      </g>
      <g>
        <rect x="1021" y="20" width="140" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(1065.5665283203125 48.506711006164551)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">filesink</tspan></text>
      </g>
      <g>
        <rect x="526" y="20" width="140" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(550.476593017578125 48.506711006164551)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">v4l2h264enc</tspan></text>
      </g>
      <g>
        <rect x="526" y="100" width="140" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(550.476593017578125 128.5067138671875)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">v4l2h264enc</tspan></text>
      </g>
      <g>
        <line x1="666" y1="125" x2="685.259033203125" y2="125" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="684.091796875 128.989059448242188 691 125 684.091796875 121.010932922363281 684.091796875 128.989059448242188"></polygon>
      </g>
      <g>
        <rect x="691" y="100" width="140" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(723.207061767578125 128.5067138671875)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">h264parse</tspan></text>
      </g>
      <g>
        <line x1="831" y1="125" x2="850.259033203125" y2="125" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="849.091796875 128.989059448242188 856 125 849.091796875 121.010932922363281 849.091796875 128.989059448242188"></polygon>
      </g>
      <g>
        <rect x="856" y="100" width="140" height="50" rx="3.999999999999886" ry="3.999999999999886" style="fill: #007884;"></rect>
        <text transform="translate(894.62109375 128.5067138671875)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">mp4mux</tspan></text>
      </g>
      <g>
        <line x1="996" y1="125" x2="1015.259033203130457" y2="125" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="1014.091796875 128.989059448242188 1021 125 1014.091796875 121.010932922363281 1014.091796875 128.989059448242188"></polygon>
      </g>
      <g>
        <rect x="1021" y="100" width="140" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(1065.5665283203125 128.5067138671875)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">filesink</tspan></text>
      </g>
      <g>
        <rect x="185" y="60" width="140" height="50" rx="4" ry="4" style="fill: #007884;"></rect>
        <text transform="translate(243.910186767578125 88.506710052490234)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">tee</tspan></text>
      </g>
      <g>
        <polyline points="325 93.333335876464844 343.653106689453125 93.333335876464844 343.653106689453125 125 362.259002685546875 125" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></polyline>
        <polygon points="361.091827392578125 128.989059448242188 368 125 361.091827392578125 121.010932922363281 361.091827392578125 128.989059448242188"></polygon>
      </g>
      <g>
        <line x1="160" y1="85" x2="179.259017944335938" y2="85" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="178.091827392578125 88.989067077636719 185 85 178.091827392578125 81.010932922363281 178.091827392578125 88.989067077636719"></polygon>
      </g>
      <g>
        <rect x="368.000000000980435" y="100" width="140" height="50" rx="4" ry="4" style="fill: #2a2aea;"></rect>
        <text transform="translate(389.753936767578125 128.5067138671875)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">qtivtransform</tspan></text>
      </g>
      <g>
        <polyline points="520.259033203125 45 343.653106689453125 45 343.653106689453125 76.666664123535156 325 76.666664123535156" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></polyline>
        <polygon points="519.091796875 41.010936737060547 526 45 519.091796875 48.989063262939453 519.091796875 41.010936737060547"></polygon>
      </g>
      <g>
        <line x1="508" y1="125" x2="520.259033203125" y2="125" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="519.091796875 128.989059448242188 526 125 519.091796875 121.010932922363281 519.091796875 128.989059448242188"></polygon>
      </g>
      <g>
        <rect x="20" y="60" width="140" height="50" rx="3.999999999999999" ry="3.999999999999999" style="fill: #007884;"></rect>
        <text transform="translate(63.429718017578125 88.506710052490234)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">camsrc</tspan></text>
      </g>
    </g>
  </g>
</svg>
**Figure : Pipeline for 4k video–encoding and downscaling to 1080p**

### More transform and transcode use cases

Run the following use cases on the target device.

## Video transform use cases

- 4K@30 AVC → decode → rotate and downscale → 1080p@30 AVC

    - Qualcomm Computer Vision SDK (fcv) engine:

gst-launch-1.0 -e filesrc location=/opt/<4K_H264/AVC_file>.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw,format=NV12 ! qtivtransform engine=fcv rotate=90CCW ! video/x-raw,format=NV12,width=1920,height=1080 ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! h264parse ! queue ! mp4mux ! queue ! filesink location=/opt/video.mp4
            Copy to clipboard
    - GLES engine:

gst-launch-1.0 -e filesrc location=/opt/<4K_H264/AVC_file>.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw,format=NV12 ! qtivtransform engine=gles rotate=90CCW ! video/x-raw,format=NV12,width=1920,height=1080 ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! h264parse ! queue ! mp4mux ! queue ! filesink location=/opt/video.mp4
            Copy to clipboard
- 4K@30 AVC → decode → flip and downscale → 1080p@30 AVC

    - Qualcomm Computer Vision SDK (fcv) engine:

gst-launch-1.0 -e filesrc location=/opt/<4K_H264/AVC_file>.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw,format=NV12 ! qtivtransform engine=fcv flip-vertical=true ! video/x-raw,format=NV12,width=1920,height=1080 ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! h264parse ! queue ! mp4mux ! queue ! filesink location=/opt/video.mp4
            Copy to clipboard
    - GLES engine:

gst-launch-1.0 -e filesrc location=/opt/<4K_H264/AVC_file>.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw,format=NV12 ! qtivtransform engine=gles flip-vertical=true ! video/x-raw,format=NV12,width=1920,height=1080 ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! h264parse ! queue ! mp4mux ! queue ! filesink location=/opt/video.mp4
            Copy to clipboard
- Video\_qmmf\_Transform\_rotate\_counter\_clockwise\_3840 x 2160 @30fps

    - Qualcomm Computer Vision SDK (fcv) engine:

gst-launch-1.0 -e qtiqmmfsrc ! video/x-raw,format=NV12,width=3840,height=2160,framerate=30/1 ! qtivtransform engine=fcv rotate=90CCW ! queue ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! h264parse ! queue ! mp4mux ! queue ! filesink location=/opt/video.mp4
            Copy to clipboard
    - GLES engine:

gst-launch-1.0 -e qtiqmmfsrc ! video/x-raw,format=NV12,width=3840,height=2160,framerate=30/1 ! qtivtransform engine=gles rotate=90CCW ! queue ! video/x-raw,format=NV12,width=3840,height=2160,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! h264parse ! queue ! mp4mux ! queue ! filesink location=/opt/video.mp4
            Copy to clipboard
- Video\_qmmf\_Transform\_scale\_down\_3840 x 2160 @30fps\_to\_1080p

    - Qualcomm Computer Vision SDK (fcv) engine:

gst-launch-1.0 -e qtiqmmfsrc ! video/x-raw,format=NV12,width=3840,height=2160,framerate=30/1 ! qtivtransform engine=fcv ! queue ! 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 ! queue ! mp4mux ! queue ! filesink location=/opt/video.mp4
            Copy to clipboard
    - GLES engine:

gst-launch-1.0 -e qtiqmmfsrc ! video/x-raw,format=NV12,width=3840,height=2160,framerate=30/1 ! qtivtransform engine=gles ! queue ! 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 ! queue ! mp4mux ! queue ! filesink location=/opt/video.mp4
            Copy to clipboard
- Video\_qmmf\_Transform\_flip\_horizontal\_3840 x 2160 @30fps

    - Qualcomm Computer Vision SDK (fcv) engine:

gst-launch-1.0 -e qtiqmmfsrc ! video/x-raw,format=NV12,width=3840,height=2160,framerate=30/1 ! qtivtransform engine=fcv flip-horizontal=true ! video/x-raw,format=NV12,width=3840,height=2160,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! h264parse ! queue ! mp4mux ! queue ! filesink location=/opt/video_flip_h.mp4
            Copy to clipboard
    - GLES engine:

gst-launch-1.0 -e qtiqmmfsrc ! video/x-raw,format=NV12,width=3840,height=2160,framerate=30/1 ! qtivtransform engine=gles flip-horizontal=true ! video/x-raw,format=NV12,width=3840,height=2160,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! h264parse ! queue ! mp4mux ! queue ! filesink location=/opt/video_flip_h.mp4
            Copy to clipboard
- Video\_qmmf\_Transform\_flip\_vertical\_3840 x 2160 @30fps

    - Qualcomm Computer Vision SDK (fcv) engine:

gst-launch-1.0 -e qtiqmmfsrc ! video/x-raw,format=NV12,width=3840,height=2160,framerate=30/1 ! qtivtransform engine=fcv flip-vertical=true ! video/x-raw,format=NV12,width=3840,height=2160,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! h264parse ! queue ! mp4mux ! queue ! filesink location=/opt/video_flip_v.mp4
            Copy to clipboard
    - GLES engine:

gst-launch-1.0 -e qtiqmmfsrc ! video/x-raw,format=NV12,width=3840,height=2160,framerate=30/1 ! qtivtransform engine=gles flip-vertical=true ! video/x-raw,format=NV12,width=3840,height=2160,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! h264parse ! queue ! mp4mux ! queue ! filesink location=/opt/video_flip_v.mp4
            Copy to clipboard

## Video transcode use cases

- 4K@30 HEVC → decode → 4K@30 AVC encode:

gst-launch-1.0 -e filesrc location=/opt/<4K_H265/HEVC_file>.mp4 ! qtdemux ! queue ! h265parse ! v4l2h265dec capture-io-mode=4 output-io-mode=4 ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! queue ! h264parse ! mp4mux ! queue ! filesink location=/opt/offline_hevc_to_avc.mp4
        Copy to clipboard
- 4K@30 AVC → decode → 4K@30 HEVC encode:

gst-launch-1.0 -e filesrc location=/opt/<4K_H264/AVC_file>.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! v4l2h265enc capture-io-mode=4 output-io-mode=5 ! queue ! h265parse ! mp4mux ! queue ! filesink location="/opt/offline_avc_to_hevc.mp4"
        Copy to clipboard

## Dynamic cropping using qtivtransform

**Single 1080p file stream from which the ROI is cropped**

1. Display the stream:

gst-launch-1.0 filesrc location=/opt/<input_file>.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! queue ! qtivtransform flip-vertical=true crop="<480,270,960,540>" ! waylandsink fullscreen=true
        Copy to clipboard
2. Encode the stream data:

gst-launch-1.0 -e filesrc location=/opt/<input_file>.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! queue ! qtivtransform flip-horizontal=true crop="<480,270,960,540>" ! queue ! 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 ! queue ! mp4mux ! queue ! filesink location=/opt/offline_crop_vtransform.mp4
        Copy to clipboard

**Single 1080p camera stream from which ROI is cropped**

1. Display the stream:

gst-launch-1.0 -e qtiqmmfsrc ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! queue ! qtivtransform flip-horizontal=true crop="<480,270,960,540>" ! waylandsink fullscreen=true
        Copy to clipboard
2. Encode the stream data:

gst-launch-1.0 -e qtiqmmfsrc ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! qtivtransform flip-horizontal=true crop="<480,270,960,540>" ! queue ! 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 ! queue ! mp4mux ! queue ! filesink location=/opt/cam_crop_vtransform.mp4
        Copy to clipboard

## Related information

[Video transcoding](https://docs.qualcomm.com/doc/80-70029-50/topic/gst-video-transcode-example.html)

Last Published: Apr 02, 2026

[Previous Topic
Multi-camera/Multi-client use cases](https://docs.qualcomm.com/bundle/publicresource/80-70029-50/topics/multi-camera-multi-client-use-cases.md) [Next Topic
Video playback use cases](https://docs.qualcomm.com/bundle/publicresource/80-70029-50/topics/video-playback-use-cases.md)