Skip to content

Instantly share code, notes, and snippets.

@jason-shen
Last active July 31, 2022 17:01
Show Gist options
  • Save jason-shen/e43c639bb987371bfacb132a192d35e1 to your computer and use it in GitHub Desktop.
Save jason-shen/e43c639bb987371bfacb132a192d35e1 to your computer and use it in GitHub Desktop.
gstreamer video mix

#gstreamer mixer

gst-launch-1.0 -e \
videomixer name=mix background=1 \
        sink_1::xpos=0   sink_1::ypos=0 \
        sink_2::xpos=200 sink_2::ypos=0 \
        sink_3::xpos=0 sink_3::ypos=100 \
        sink_4::xpos=200 sink_4::ypos=100 \
    ! autovideosink \
uridecodebin uri='file:///Users/jason/Desktop/1.mp4' \
    ! videoscale \
    ! video/x-raw,width=200,height=100  \
    ! mix.sink_1 \
uridecodebin uri='file:///Users/jason/Desktop/1.mp4' \
    ! videoscale \
    ! video/x-raw,width=200,height=100  \
    ! mix.sink_2 \
uridecodebin uri='file:///Users/jason/Desktop/1.mp4' \
    ! videoscale \
    ! video/x-raw,width=200,height=100  \
    ! mix.sink_3 \
uridecodebin uri='file:///Users/jason/Desktop/1.mp4' \
    ! videoscale \
    ! video/x-raw,width=200,height=100  \
    ! mix.sink_4    
    ```

    ```
    gst-launch-1.0 filesrc location=/Users/jason/Desktop/1.mp4 ! decodebin ! queue ! \ videoconvert ! videobox border-alpha=0 right=-100 ! videomixer name=mix ! videoconvert ! \ autovideosink \
               filesrc location=/Users/jason/Desktop/1.mp4 ! decodebin ! queue ! videoconvert \ ! videobox border-alpha=0 left=-100 ! mix. \
               filesrc location=/Users/jason/Desktop/1.mp4 ! decodebin ! queue ! videoconvert \ ! videobox border-alpha=0 left=-200 ! mix.
               ```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment