# Run TCP use cases

Control the GStD framework using a control application that's remotely interfacing through TCP.

## Prerequisites

- Enable `wlan0`. For instructions, see [Sign in using SSH](https://docs.qualcomm.com/bundle/publicresource/topics/80-70029-254/how_to.html#use-ssh).
- After the system restart, the Wi-Fi should be up and running.

ifconfig   // Note down wlan0_IP
        Copy to clipboard
- To configure TCP use cases, select an unused port:

vi /etc/default/gstd
             OPTARGS=" -a wlan0_IP -p 5001"     // Replace the port 5001 if the port is not free
        
             XDG_RUNTIME_DIR=/dev/socket/weston
        
             WAYLAND_DISPLAY=wayland-1
        
        systemctl daemon-reload
        systemctl restart gstd
        Copy to clipboard

## Single stream encode

1. Create the pipeline:

gst-client-1.0 -a 10.92.164.1 -p 5001 pipeline_create tcp_enc1 qtiqmmfsrc name=camsrc ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! h264parse ! queue ! mp4mux ! queue ! filesink location=/tmp/tcp_enc1.mp4
        Copy to clipboard
2. Control the pipeline:

    - Play the pipeline:

gst-client-1.0 -a 10.92.164.1 -p 5001 pipeline_play tcp_enc1
            Copy to clipboard
    - Send EOS:

gst-client-1.0 -a 10.92.164.1 -p 5001 event_eos tcp_enc1
            Copy to clipboard
    - Stop the pipeline:

gst-client-1.0 -a 10.92.164.1 -p 5001 pipeline_stop tcp_enc1
            Copy to clipboard

## Multistream encode

1. Create the pipeline:

gst-client-1.0 -a 10.92.164.1 -p 5001 pipeline_create tcp_enc2 qtiqmmfsrc name=camsrc video_0::type=preview ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! queue ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! queue ! h264parse ! mp4mux ! queue ! filesink location="/tmp/tcp_mux1.mp4" \ camsrc. ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! queue ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! queue ! h264parse ! mp4mux ! queue ! filesink location="/tmp/tcp_mux2.mp4"
        Copy to clipboard
2. Control the pipeline:

    - Play the pipeline:

gst-client-1.0 -a 10.92.164.1 -p 5001 pipeline_play tcp_enc2
            Copy to clipboard
    - Send EOS:

gst-client-1.0 -a 10.92.164.1 -p 5001 event_eos tcp_enc2
            Copy to clipboard
    - Stop the pipeline:

gst-client-1.0 -a 10.92.164.1 -p 5001 pipeline_stop tcp_enc2
            Copy to clipboard

## Single display

1. Create the pipeline:

gst-client-1.0 -a 10.92.164.1 -p 5001 pipeline_create tcp_dis1 qtiqmmfsrc name=camsrc video_0::type=preview ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! waylandsink fullscreen=true async=true sync=false
        Copy to clipboard
2. Control the pipeline:

    - Play the pipeline:

gst-client-1.0 -a 10.92.164.1 -p 5001 pipeline_play tcp_dis1
            Copy to clipboard
    - Pause the pipeline:

gst-client-1.0 -a 10.92.164.1 -p 5001 pipeline_pause tcp_dis1
            Copy to clipboard
    - Stop the pipeline:

gst-client-1.0 -a 10.92.164.1 -p 5001 pipeline_stop tcp_dis1
            Copy to clipboard

## Multi-display

1. Create the pipeline:

gst-client-1.0 -a 10.92.164.1 -p 5001 pipeline_create tcp_dis2 qtiqmmfsrc name=camsrc video_0::type=preview ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! waylandsink x=0 y=0 width=500 height=400 async=true sync=false camsrc. ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! waylandsink x=510 y=0 width=500 height=400 async=true sync=false
        Copy to clipboard
2. Control the pipeline:

    - Play the pipeline:

gst-client-1.0 -a 10.92.164.1 -p 5001 pipeline_play tcp_dis2
            Copy to clipboard
    - Pause the pipeline:

gst-client-1.0 -a 10.92.164.1 -p 5001 pipeline_pause tcp_dis2
            Copy to clipboard
    - Stop the pipeline:

gst-client-1.0 -a 10.92.164.1 -p 5001 pipeline_stop tcp_dis2
            Copy to clipboard

Last Published: Jun 03, 2026

[Previous Topic
Run local use cases](https://docs.qualcomm.com/bundle/publicresource/80-70029-50/topics/local-use-cases.md) [Next Topic
Run HTTP use cases](https://docs.qualcomm.com/bundle/publicresource/80-70029-50/topics/run-http-use-cases.md)