# Video transformation
Source: [https://docs.qualcomm.com/doc/80-70020-50/topic/gst-transform-example.html](https://docs.qualcomm.com/doc/80-70020-50/topic/gst-transform-example.html)
The **gst-transform-example** application supports rotation, flipping, and scaling
operations.
You can use this application for a security camera. Adjust the orientation of the
displayed image using the flip and mirror operations on the CCTV camera. For more
information about the transformation properties, see [qtivtransform](https://docs.qualcomm.com/doc/80-70020-50/topic/qtivtransform.html).
The following figure shows the pipeline, which takes the captured video stream,
transforms it, and either displays it or saves it to a file. For information about the
plugins used in the pipeline, see [Pipeline flow](https://docs.qualcomm.com/doc/80-70020-50/topic/gst-transform-example.html#gst-transform-example__section_m3h_vz5_4bc).
Figure : gst-transform-example pipeline
## Prerequisites
- [Get started with the Qualcomm IM SDK](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-51/install-sdk.html)
for your Qualcomm Linux 1.5 or Ubuntu Server.
- Activate SSH on your Qualcomm Linux or Ubuntu to sign in with SSH and connect to
the target device. For instructions see:
- [Sign in using SSH](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-254/how_to.html#use-ssh) for Qualcomm
Linux
- [Sign in using SSH](https://docs.qualcomm.com/bundle/publicresource/topics/80-90441-1/Use_Ubuntu_on_RB3_Gen2_3.html#sign-in-to-the-rb3-gen-2-console-using-ssh) for Ubuntu
Server
Note: If SSH is already set up and Wi-Fi is
connected, skip this step.
- Use the HDMI port to connect the display to the device. For instructions, see
[Set up HDMI display](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-18/samples.html).
- Sign in to the target device using SSH.
- In the terminal of the target device, run the following commands from the SSH
shell of the target device to activate the display on the host computer:
- For
Linux:
export XDG_RUNTIME_DIR=/dev/socket/weston && export WAYLAND_DISPLAY=wayland-1Copy to clipboard
- For Ubuntu Server:
export XDG_RUNTIME_DIR=/run/user/$(id -u ubuntu)/ && export WAYLAND_DISPLAY=wayland-1 Copy to clipboard
- Connect the speaker to activate the audio on the target device. For
instructions, see [Set up audio hardware](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-16/enable-audio.html).
If you face
issues in recording the audio, run the following command in the terminal of
the target
device:
pactl set-default-source pal_source_speaker_micCopy to clipboard
- If you face issues with the camera or display, see [Camera troubleshooting](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-17/troubleshooting.html) and [Display troubleshooting](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-18/debug.html).
## Run the application
1. In the terminal of the target device, run the following use cases to rotate,
downscale, or flip the video:
- Use camera source and save output to a file.
- Perform operations such as rotate, flip, upscale/downscale
simultaneously:
gst-transform-example -r 90 -f 2 --output_width 1920 --output_height 1080 -o /etc/media/video_transform.mp4 -i .mp4Copy to clipboard
- Rotate:
gst-transform-example -r 90 --input_width 3840 --input_height 2160 -o .mp4Copy to clipboard
- Downscale/upscale:
gst-transform-example --input_width 3840 --input_height 2160 --output_width 1920 --output_height 1080 -o .mp4Copy to clipboard
- Flip:
gst-transform-example -f 2 --input_width 3840 --input_height 2160 -o .mp4Copy to clipboard
- Use file source and save output to a file.
- Perform operations such as rotate, flip, upscale/downscale
simultaneously:
gst-transform-example -r 90 -f 2 –i .mp4 --output_width 1920 --output_height 1080 -o .mp4Copy to clipboard
- Rotate:
gst-transform-example -r 90 -i .mp4 -o .mp4Copy to clipboard
- Downscale/upscale:
gst-transform-example -i .mp4 --output_width 1920 --output_height 1080 -o .mp4Copy to clipboard
- Flip:
gst-transform-example -f 2 -i .mp4 -o .mp4Copy to clipboard
2. To stop the use case, use CTRL +
C.
3. In the terminal of the target device, run the following command in the SSH shell
to display the available help
options:
gst-transform-example --helpCopy to clipboard
4. In the terminal of the host computer, run the following command to pull the
files from the target
device:
scp root@:/etc/media/Copy to clipboard
The following table provides a description of the command-line
parameters:| Command-line parameter | Description |
| --- | --- |
| `-h, --help` | Help |
| `--output_width` | Downscale/upscale width.
The default value is 1920.
You can scale from 1080 to 720 or from 720 to 1080.
|
| `--output_height` | Downscale/upscale height. The default value is 1080. |
| `-o` | Absolute path to generate the file. |
| `-r` | Image rotate. The values are 0, 90, 180, 270. |
| `--input_width` | Camera width. The default value is 1920. |
| `--input_height` | Camera height. The default value is 1080. |
| `-f` | Flip the image. The values are:
0: Don't flip (Default)
1: Flip horizontally
2: Flip vertically
3: Flip both horizontally and vertically
|
| `-I`, `--input_file` | Absolute path of the input file. For example, `-I /etc/media/inputfileh264.mp4` |
| `-o`,`--output_file` | Absolute path to generate the output file. For example, `-o /etc/media/video_transform.mp4` |
## Expected output
This pipeline supports simultaneous live preview and recording of the transformed
video stream.
It provides two outputs:
- A video recording that's stored as an MP4 file in the specified path.
- A preview on a display device.
Figure : Expected output for gst-transform-example application–Preview

## Pipeline flow
The following table lists the plugins used to run the video transforming
pipeline:| Plugin | Description |
| --- | --- |
| [qtiqmmfsrc](https://docs.qualcomm.com/doc/80-70020-50/topic/qtiqmmfsrc.html) and filesrc | Captures the video data. |
| capsfilter | Enforces constraints on the raw video data. |
| [qtivtransform](https://docs.qualcomm.com/doc/80-70020-50/topic/qtivtransform.html) | Transforms the video data. After transformation, capsfilter is applied again. |
| tee | Splits the transformed video data in two output paths:
Live preview
Save to file
|
| [Waylandsink](https://docs.qualcomm.com/doc/80-70020-50/topic/waylandsink.html) | Displays the video in live preview. |
| h264parse | Parses the encoded H.264 video stream. |
| mp4mux | Multiplexes the stream into an MP4 container. |
| filesink | Writes the video data to a file. |
## Related information
[Transform and Transcode use cases](https://docs.qualcomm.com/doc/80-70020-50/topic/transform-and-transcode-use-cases.html)
**Parent Topic:** [Run sample applications for video and audio](https://docs.qualcomm.com/doc/80-70020-50/topic/audio-sample-applications.html)
Last Published: Jan 30, 2026
[Previous Topic
Audio recording](https://docs.qualcomm.com/bundle/publicresource/80-70020-50/topics/gst-audio-encode-example-without-flac.md) [Next Topic
Video composition](https://docs.qualcomm.com/bundle/publicresource/80-70020-50/topics/gst-weston-composition-example.md)