# Video transcoding Source: [https://docs.qualcomm.com/doc/80-70020-50/topic/gst-video-transcode-example.html](https://docs.qualcomm.com/doc/80-70020-50/topic/gst-video-transcode-example.html) The **gst-video-transcode-example** application supports video transcoding of AVC-to-HEVC or HEVC-to-AVC format. A few use cases can be video editing, security camera, and augmented reality. The following figure shows the pipeline, which reads the incoming stream, decodes and encodes it, and either displays the transcoded output on a screen, or saves it to a file. For information about the plugins used in this pipeline, see [Pipeline flow](https://docs.qualcomm.com/doc/80-70020-50/topic/gst-video-transcode-example.html#gst-video-transcode-example__section_rdl_ysg_4bc). Figure : gst-video-transcode-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 The following table lists the actions that can be performed for the common use cases of gst-video-transcode-example application:| Use case | Actions | | --- | --- | | Video editing | Rotate, flip, or resize videos. | | Security camera | Invert or rotate the video image to compensate for situations
where the camera is improperly mounted. | | Augmented reality | Scale or rotate the video feed to synchronize with the virtual
components. | To run the transcoding use cases, do the following: 1. Ensure that you input `AVC.mp4` and `HEVC.mp4` video files on the target device. 2. In the terminal of the target device, transcode the video file: gst-video-transcode-example -i /etc/media/.mp4 -c -o /etc/media/.mp4 Copy to clipboard The following table provides a description of the command-line parameters: | Command-line parameter | Description | | --- | --- | | `-1` | Specifies the absolute path to the MP4 input
file. | | `-c` | Specifies the video codec of the *input*file.

  • 1 = AVC (H.264)


  • 2 = HEVC (H.265)


| | `-o` | Specifies the absolute path to where the transcoded MP4
file is saved. | 3. Run the use cases for different video formats: - Transcode from AVC to HEVC: gst-video-transcode-example -i /etc/media/.mp4 -c 1 -o /etc/media/.mp4Copy to clipboard - Transcode from HEVC to AVC: gst-video-transcode-example -i /etc/media/.mp4 -c 2 -o /etc/media/.mp4Copy to clipboard 4. To stop the use case, use CTRL + C. 5. In the terminal of the target device, run the following command in the SSH shell to display the available help options: gst-video-transcode-example --helpCopy to clipboard ## Expected output The video stream is transcoded from H.264 to H.265 and back again to the H.264 format. ## Pipeline flow The following table lists the plugins used in the video transcoding pipeline: | Plugin | Description | | --- | --- | | filesrc | Reads the video streams. | | qtdemux | Demultiplexes the streams into separate audio and video
streams. | | h264parse | Parses the H.264 video stream. | | h265parse | Parses the H.265 video stream. | | [v4l2h264dec](https://docs.qualcomm.com/doc/80-70020-50/topic/v4l2h264dec.html) | Decodes the H.264 video stream using Video4Linux. | | [v4l2h265dec](https://docs.qualcomm.com/doc/80-70020-50/topic/v4l2h265dec.html) | Decodes the H.265 video stream using Video4Linux. | | [Waylandsink](https://docs.qualcomm.com/doc/80-70020-50/topic/waylandsink.html) | Displays the H.264 video stream on Wayland display. | | filesink | Writes the H.265 video to a YUV file for playback. | The following table provides information on how the decoded video streams are handled to generate the transcoded output:| Video format | Description | | --- | --- | | H.264 |

  1. v4l2h265enc encodes the decoded
    H.264 video into H.265 format.


  2. h265parse parses the H.265 video stream.


  3. mp4mux multiplexes the stream into an MP4
    container.


  4. filesink writes the stream data to a file.





The AVC (H.264) video is transcoded to HEVC (H.265)
format. | | H.265 |

  1. v4l2h264enc encodes the decoded
    H.265 video into H.264 format.


  2. h264parse parses the H.264 video stream.


  3. mp4mux multiplexes the stream into an MP4
    container.


  4. filesink writes the stream data to a file.





The HEVC (H.265) video is transcoded to AVC (H.264)
format. | ## 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-video playback](https://docs.qualcomm.com/bundle/publicresource/80-70020-50/topics/gst-audio-video-playback.md) [Next Topic Video playback](https://docs.qualcomm.com/bundle/publicresource/80-70020-50/topics/gst-video-playback-example.md)