# Live streaming over RTSP with two H.264 streams

Source: [https://docs.qualcomm.com/doc/80-88500-3/topic/64_Live_streaming_over_RTSP_with_two_H264_streams.html](https://docs.qualcomm.com/doc/80-88500-3/topic/64_Live_streaming_over_RTSP_with_two_H264_streams.html)

The topic describes the use case with two H264 streams, where one stream is stored and another is streamed live over RTSP.

To execute the use case, do the following:

1. Run RTSP server on target with `udpsrc`. 

        gst-rtsp-server -p 8900 -m /live "( udpsrc name=pay0 port=8554 caps=\"application/x-rtp,media=video,clockrate=90000,encodingname=H264,payload=96\" )" & gst-launch-1.0 -e qtiqmmfsrc name=qmmf camera=0 ! video/x-raw\(memory:GBM\),format=NV12,width=3840,height=2160,framerate=30/1 ! queue ! qtic2venc ! queue ! h264parse ! mp4mux ! queue ! filesink location=/data/output/mux1.mp4 qmmf. ! video/x-raw\(memory:GBM\),format=NV12,width=640,height=480,framerate=30/1 ! queue ! qtic2venc ! h264parse config-interval=-1 ! rtph264pay pt=96 ! udpsink host=127.0.0.1 port=8554
        Copy to clipboard

    The RTSP server is started on port number 8900. This server receives the video stream
          using `udpsrc`, processes the RTP payload, and then streams it over the
          network at port number 8900.
2. Run the following command to create a video stream for the RTSP server.

        gst-launch-1.0 -e qtiqmmfsrc name=qmmf ! video/x-h264,format=NV12,width=1920,height=1080,framerate=30/1 ! h264parse ! mp4mux ! queue ! filesink location="/data/mux.mp4" qmmf. ! video/x-h264,format=NV12,width=1920,height=1080,framerate=30/1 ! h264parse config-interval=1 ! rtph264pay pt=96 ! udpsink host=127.0.0.1 port=8554Copy to clipboard

    1. The `qtiqmmfsrc` GStreamer plug-in creates both 1080p AVC-encoded video streams.
    2. The first stream is processed by `h264parse`, packaged in an MP4 container by the `mp4mux` plug-in, and dumped to a file by the `filesink` plug-in.
    3. The second stream is processed by `h264parse`. `rtph264v` pay packages the buffers into an RTP payload for streaming, and the `udpsink` element sends this data to the `gst-rtsp-server`.

**Parent Topic:** Multimedia use cases

Last Published: Sep 26, 2023

Previous Topic
 
1080p video downscale to 720p Next Topic

Parallel 4K encode and 1080p decode