# Camera switch
Source: [https://docs.qualcomm.com/doc/80-70022-50/topic/camera-switch.html](https://docs.qualcomm.com/doc/80-70022-50/topic/camera-switch.html)
The **gst-camera-switch-example** application allows you to switch between two
cameras.
The following figure shows the pipeline, which demonstrates the camera switch between the
two cameras of the device without changing the state of the pipeline. The switching is
done in the Playing state after every 5 seconds.
For more information about the plugins used in this pipeline, see [Pipeline flow](https://docs.qualcomm.com/doc/80-70022-50/topic/camera-switch.html#camera-switch__section_bk4_zjb_pbc).
Figure : gst-camera-switch-example pipeline
qtiqmmfsrc
capsfilter
Waylandsink
capsfilter
encoder
h264parse
mp4mux
filesink
Qualcomm
Open source
## Run the application
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 respective command for any of the
following use cases:
- Camera
switch:
gst-camera-switch-example Copy to clipboard
- Encode the stream after switching (default
option):
gst-camera-switch-exampleCopy to clipboard
Note: This use case isn't supported in the current
release.
- Display the stream after
switching:
gst-camera-switch-example -dCopy 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-camera-switch-example --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 application generates the output as a preview or an encoded MP4 file.
Figure : Expected output for gst-camera-switch-example application

## Pipeline flow
The following table lists the plugins used in the camera switch
pipeline:| Pipeline | Description |
| --- | --- |
| Display preview | qtiqmmfsrc captures the camera live stream and uses capsfilter to create a branch for preview. The data is sent to the Wayland display sink (Waylandsink ) for preview. |
| Encode as MP4 file | qtiqmmfsrc captures the camera live stream and uses capsfilter to create a branch for encoding. The stream data is encoded. H264parse is used to parse the captured data. Mp4mux is used to multiplex the data. |
**Parent Topic:** [Run sample applications for a camera](https://docs.qualcomm.com/doc/80-70022-50/topic/camera-sample-applications.html)
Last Published: Feb 20, 2026
[Previous Topic
Camera burst capture](https://docs.qualcomm.com/bundle/publicresource/80-70022-50/topics/camera-burst-capture.md) [Next Topic
Wide dynamic range and electronic image stabilization](https://docs.qualcomm.com/bundle/publicresource/80-70022-50/topics/dynamic-range-and-image-stabilization.md)