# Audio and video encode
Source: [https://docs.qualcomm.com/doc/80-70022-50/topic/gst-audio-video-encode.html](https://docs.qualcomm.com/doc/80-70022-50/topic/gst-audio-video-encode.html)
The **gst-audio-video-encode** application encodes audio and video data, which is
stored in a user-specified output file. A few use cases for this application are streaming
services, video conferencing, and surveillance systems.
The following figure shows the pipeline, which receives the video and audio feed,
encodes, and parses the video stream. It then captures the audio stream and encodes it
in MP3 format. Both streams are multiplexed and written to a file.
For information about the plugins used in the pipeline, see [Pipeline flow](https://docs.qualcomm.com/doc/80-70022-50/topic/gst-audio-video-encode.html#gst-audio-video-encode__section_mj1_yfn_4bc).
Figure : gst-audio-video-encode pipeline
## Run the application
The following table lists the actions that can be performed for the common use
cases of gst-audio-video-encode application:| Use case | Actions |
| --- | --- |
| Streaming services | Encode audio and video streams for live internet streaming. |
| 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. |
1. Ensure that you complete the [Prerequisites](https://docs.qualcomm.com/doc/80-70022-50/topic/mm_sample_apps_prerequisites.html).
2. In the terminal of the target device, run the use case:
gst-audio-video-encode -w -h -c -o /etc/media/.mp4Copy to clipboard
The following table provides a description of the command-line
parameters: | Command-line parameter | Description |
| --- | --- |
| `-w` | Specifies the camera width. |
| `-h` | Specifies the camera height. |
| `-c` | Specifies the video codec of the input file:
1 for AVC (H.264).
2 for HEVC (H.265).
|
| `output-file` | Provides the absolute path to the output file. |
For example, use the following commands to run different video encode
use cases:
- AVC:
gst-audio-video-encode -w 1920 -h 1080 -c 1 -o /etc/media/audiovideo.mp4Copy to clipboard
- HEVC:
gst-audio-video-encode -w 1920 -h 1080 -c 2 -o /etc/media/audiovideo.mp4Copy to clipboard
3. To stop the use case, use CTRL +
C.
4. In the terminal of the target device, run the following command in the SSH shell
to display the available help
options:
gst-audio-video-encode --helpCopy to clipboard
5. 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
## Expected output
The encoded audio and video streams multiplexed to an MP4 container and written to a
file.
## Pipeline flow
The following table lists the plugins used to run the audio and video stream
encoding pipeline:| Plugin | Description |
| --- | --- |
| [qtiqmmfsrc](https://docs.qualcomm.com/doc/80-70022-50/topic/qtiqmmfsrc.html) and capsfilter | Captures the media stream. |
| [v4l2h264enc](https://docs.qualcomm.com/doc/80-70022-50/topic/v4l2h264enc.html) | Encodes the video for AVC (H.264) format. |
| [v4l2h265enc](https://docs.qualcomm.com/doc/80-70022-50/topic/v4l2h265enc.html) | Encodes the video for HEVC (H.265) format. |
| h264parse | Parses the H.264 video stream. |
| h265parse | Parses the H.265 video stream. |
| [pulsesrc](https://docs.qualcomm.com/doc/80-70022-50/topic/pulsesrc.html) | Captures the audio from the stream, which is filtered using capsfilter. |
| audioconvert | Converts the audio for encoding. |
| lamemp3enc | Encodes the audio in MP3 format. |
| mp4mux | Multiplexes encoded video and audio into an MP4 container. |
| filesink | Writes the stream into a file. |
**Parent Topic:** [Run sample applications for video and audio](https://docs.qualcomm.com/doc/80-70022-50/topic/audio-sample-applications.html)
Last Published: Feb 20, 2026
[Previous Topic
Video playback](https://docs.qualcomm.com/bundle/publicresource/80-70022-50/topics/gst-video-playback-example.md) [Next Topic
Audio playback](https://docs.qualcomm.com/bundle/publicresource/80-70022-50/topics/gst-audio-decode-sample.md)