# Video composition use cases The video composition GStreamer use cases show how to read the video streams from the source, compose them, and then display them either side by side or picture-in-picture on a display device. Before you run the use cases, ensure that you complete the preconditions mentioned in [GStreamer command-line use cases](https://docs.qualcomm.com/doc/80-80021-50/topic/gstreamer-application-use-cases.html). ## 16 480p offline stream side by side composition The use case shows how to read 16 480p video streams from file sources and composing them side by side. These streams are then displayed as a single frame on a local display device. Run the use case on the target device: ulimit -n 4096 && gst-launch-1.0 qtivcomposer name=mix sink_0::position="<0, 0>" sink_0::dimensions="<480, 270>" sink_1::position="<480, 0>" sink_1::dimensions="<480, 270>" sink_2::position="<960, 0>" sink_2::dimensions="<480, 270>" sink_3::position="<1440, 0>" sink_3::dimensions="<480, 270>" sink_4::position="<0, 270>" sink_4::dimensions="<480, 270>" sink_5::position="<480, 270>" sink_5::dimensions="<480, 270>" sink_6::position="<960, 270>" sink_6::dimensions="<480, 270>" sink_7::position="<1440, 270>" sink_7::dimensions="<480, 270>" sink_8::position="<0, 540>" sink_8::dimensions="<480, 270>" sink_9::position="<480, 540>" sink_9::dimensions="<480, 270>" sink_10::position="<960, 540>" sink_10::dimensions="<480, 270>" sink_11::position="<1440, 540>" sink_11::dimensions="<480, 270>" sink_12::position="<0, 810>" sink_12::dimensions="<480, 270>" sink_13::position="<480, 810>" sink_13::dimensions="<480, 270>" sink_14::position="<960, 810>" sink_14::dimensions="<480, 270>" sink_15::position="<1440, 810>" sink_15::dimensions="<480, 270>" mix. ! queue ! waylandsink sync=true fullscreen=true filesrc location=/tmp/Animals_000_720p_180s_30FPS.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! queue ! mix. filesrc location=/tmp/Animals_000_720p_180s_30FPS.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! queue ! mix. filesrc location=/tmp/Animals_000_720p_180s_30FPS.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! queue ! mix. filesrc location=/tmp/Animals_000_720p_180s_30FPS.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! queue ! mix. filesrc location=/tmp/Animals_000_720p_180s_30FPS.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! queue ! mix. filesrc location=/tmp/Animals_000_720p_180s_30FPS.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! queue ! mix. filesrc location=/tmp/Animals_000_720p_180s_30FPS.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! queue ! mix. filesrc location=/tmp/Animals_000_720p_180s_30FPS.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! queue ! mix. filesrc location=/tmp/Animals_000_720p_180s_30FPS.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! queue ! mix. filesrc location=/tmp/Animals_000_720p_180s_30FPS.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! queue ! mix. filesrc location=/tmp/Animals_000_720p_180s_30FPS.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! queue ! mix. filesrc location=/tmp/Animals_000_720p_180s_30FPS.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! queue ! mix. filesrc location=/tmp/Animals_000_720p_180s_30FPS.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! queue ! mix. filesrc location=/tmp/Animals_000_720p_180s_30FPS.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! queue ! mix. filesrc location=/tmp/Animals_000_720p_180s_30FPS.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! queue ! mix. filesrc location=/tmp/Animals_000_720p_180s_30FPS.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! queue ! mix. Copy to clipboard To stop the use case, use **CTRL + C**. Qualcomm Open source filesrc qtdemux h264parse V4l2h264dec filesrc qtdemux h264parse V4l2h264dec filesrc qtdemux h264parse V4l2h264dec filesrc qtdemux h264parse V4l2h264dec filesrc qtdemux h264parse V4l2h264dec filesrc qtdemux h264parse V4l2h264dec filesrc qtdemux h264parse V4l2h264dec filesrc qtdemux h264parse V4l2h264dec filesrc qtdemux h264parse V4l2h264dec filesrc qtdemux h264parse V4l2h264dec filesrc qtdemux h264parse V4l2h264dec filesrc qtdemux h264parse V4l2h264dec qtivcomposer Waylandsink **Figure : Pipeline for side by side display of 16 480p video streams–file sources** ## 1080p + 1080p offline picture-in-picture composition This use case shows the composition of two 1080p streams to get a picture-in-picture display. The two 1080p streams are read from two file sources. Run the use case on the target device: gst-launch-1.0 -e qtivcomposer name=mixer sink_0::position="<0, 0>" sink_0::dimensions="<1280, 720>" sink_1::position="<590, 310>" sink_1::dimensions="<640, 360>" mixer. ! queue ! waylandsink fullscreen=true filesrc location=/tmp/Animals_000_720p_180s_30FPS.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mixer. filesrc location=/tmp/Animals_000_720p_180s_30FPS.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mixer. Copy to clipboard To stop the use case, use **CTRL + C**. Qualcomm Open source qtdemux h264parse filesrc filesrc qtdemux h264parse v4l2h264dec qtivcomposer waylandsink v4l2h264dec **Figure : Pipeline for picture-in-picture display of 1080p streams–file source** ## 1080p live camera and 1080p offline picture-in-picture composition The use case shows the composition of two 1080p streams to get a picture-in-picture display. The first 1080p stream is read from a file source. The second stream is collected from a camera. Run the use case on the target device: gst-launch-1.0 -e qtivcomposer name=mixer sink_0::position="<0, 0>" sink_0::dimensions="<1280, 720>" sink_1::position="<590, 310>" sink_1::dimensions="<640, 360>" mixer. ! queue ! waylandsink fullscreen=true qtiqmmfsrc name=camsrc video_0::type=video video_1::type=preview ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! mixer. filesrc location=/opt/<1080p_H264/AVC_file>.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw, format=NV12 ! mixer. Copy to clipboard To stop the use case, use **CTRL + C**. Qualcomm Open source filesrc qtdemux h264parse v4l2h264dec qtivcomposer waylandsink camsrc **Figure : Pipeline for picture-in-picture display of 1080p streams–file source and camera source** ### Related information [Video composition](https://docs.qualcomm.com/doc/80-80021-50/topic/gst-weston-composition-example.html) Last Published: Mar 26, 2026 [Previous Topic Audio-video use cases](https://docs.qualcomm.com/bundle/publicresource/80-80021-50/topics/audio-video-use-cases.md) [Next Topic Video overlay use cases](https://docs.qualcomm.com/bundle/publicresource/80-80021-50/topics/overlay-use-cases.md)