#!/bin/bash
sudo gst-launch-1.0 \
    glvideomixer name=mix \
        sink_0::xpos=0 sink_0::ypos=0 sink_0::width=960 sink_0::height=540 \
        sink_1::xpos=960 sink_1::ypos=0 sink_1::width=960 sink_1::height=540 \
        sink_2::xpos=0 sink_2::ypos=540 sink_2::width=960 sink_2::height=540 \
        sink_3::xpos=960 sink_3::ypos=540 sink_3::width=960 sink_3::height=540 ! \
    fpsdisplaysink video-sink=glimagesink sync=false \
    v4l2src device=/dev/video0 ! video/x-raw,format=NV12,width=1280,height=720 ! glupload ! mix.sink_0 \
    v4l2src device=/dev/video1 ! video/x-raw,format=NV12,width=1280,height=720 ! glupload ! mix.sink_1 \
    v4l2src device=/dev/video2 ! video/x-raw,format=NV12,width=1280,height=720 ! glupload ! mix.sink_2 \
    v4l2src device=/dev/video3 ! video/x-raw,format=NV12,width=1280,height=720 ! glupload ! mix.sink_3
