# Add-remove streams at runtime
Source: [https://docs.qualcomm.com/doc/80-70020-50/topic/gst-add-remove-streams-runtime.html](https://docs.qualcomm.com/doc/80-70020-50/topic/gst-add-remove-streams-runtime.html)
The **gst-add-remove-streams-runtime** application allows you to add or remove
several camera streams dynamically during runtime.
The following figure shows the pipeline, which demonstrates the ability of the
application to add or remove the streams at runtime with camera reconfiguration. It
creates three streams and adds or removes them in different order.
For information about the plugins used in the pipeline, see [Pipeline flow](https://docs.qualcomm.com/doc/80-70020-50/topic/gst-add-remove-streams-runtime.html#gst-add-remove-streams-runtime__section_qpq_jmb_pbc).
Figure : gst-add-remove-streams-runtime 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 command to verify if
many streams can run
simultaneously:
gst-add-remove-streams-runtime Copy to clipboard
2. Use the following commands to run the application for various use cases:
- Default mode preview on the display:
gst-add-remove-streams-runtimeCopy to clipboard
- Preview the
stream:
gst-add-remove-streams-runtime -o DisplayCopy to clipboard
- Encode the
stream:
gst-add-remove-streams-runtime -o FileCopy 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-add-remove-streams-runtime --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
- If you choose to preview, the stream is displayed on the screen.
- If you choose to encode the stream, the encoded stream is saved at
/etc/media/video\_%d.mp4.
Figure : Expected output for gst-add-remove-streams-runtime
application–Preview

## Pipeline flow
The following table lists the plugins used in the
gst-add-remove-streams-runtime pipeline:
| Plugin | Description |
| --- | --- |
| [qtiqmmfsrc](https://docs.qualcomm.com/doc/80-70020-50/topic/qtiqmmfsrc.html) | Captures the video stream and feeds it into the capsfilter. |
| Capsfilter | Branches the source into two separate pipelines. In one pipeline, the output is sent to [Waylandsink](https://docs.qualcomm.com/doc/80-70020-50/topic/waylandsink.html) for display. |
| Capsfilter | In the other pipeline, the video undergoes the following: Encoded using v4l2h264enc . Parsed with h264parse. Multiplexed into an MP4 format with mp4mux. |
| | |
**Parent Topic:** [Dynamic configuration](https://docs.qualcomm.com/doc/80-70020-50/topic/dynamic-configuration.html)
Last Published: Jan 30, 2026
[Previous Topic
Activate-deactivate streams at runtime](https://docs.qualcomm.com/bundle/publicresource/80-70020-50/topics/gst-activate-deactivate-streams-runtime.md) [Next Topic
Camera frame processing](https://docs.qualcomm.com/bundle/publicresource/80-70020-50/topics/gst-appsink-example.md)