2

I am trying to composite three streams using the videomixer plugin of gstreamer. I found this thread Combine multiple images with gstreamer and I can managed to put side by side two of my streams, but I have no idea of how to add a third one. Can anyone help ?

The original command I use and works:

gst-launch-1.0 uridecodebin uri=http://old.koniclab.info/fileadmin/images/koniclab_logo_negro.png ! videoscale ! video/x-raw, width=320, height=240 ! imagefreeze ! videomixer name=m sink_1::xpos=320 ! autovideosink uridecodebin uri=http://old.koniclab.info/fileadmin/images/koniclab_logo_negro.png ! videoscale ! video/x-raw, width=320, height=240 ! imagefreeze ! m.

My version with two udp streams, also works:

gst-launch-1.0 -v udpsrc port=9000 caps='application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264' ! rtph264depay ! video/x-h264,width=640,height=480,framerate=30/1 ! h264parse ! avdec_h264 ! videoconvert ! videomixer name=m sink_1::xpos=640 ! autovideosink -v udpsrc port=9001 caps='application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264' ! rtph264depay ! video/x-h264,width=640,height=480,framerate=30/1 ! h264parse ! avdec_h264 ! videoconvert! m.

But how can I add a third stream ?

Community
  • 1
  • 1
alain baumann
  • 45
  • 1
  • 6

1 Answers1

2

Why stop at just 3, lets do 4 :)

gst-launch-1.0 uridecodebin uri=http://old.koniclab.info/fileadmin/images/koniclab_logo_negro.png ! videoscale ! video/x-raw, width=320, height=240 ! imagefreeze ! videomixer name=m sink_1::xpos=320 sink_2::ypos=240 sink_3::xpos=320 sink_3::ypos=240 ! autovideosink uridecodebin uri=http://old.koniclab.info/fileadmin/images/koniclab_logo_negro.png ! videoscale ! video/x-raw, width=320, height=240 ! imagefreeze ! m.  uridecodebin uri=http://old.koniclab.info/fileadmin/images/koniclab_logo_negro.png ! videoscale ! video/x-raw, width=320, height=240 ! imagefreeze ! m. uridecodebin uri=http://old.koniclab.info/fileadmin/images/koniclab_logo_negro.png ! videoscale ! video/x-raw, width=320, height=240 ! imagefreeze ! m.

Lets format it little nicer:

gst-launch-1.0 \
videomixer name=m sink_1::xpos=320 sink_2::ypos=240 sink_3::xpos=320 sink_3::ypos=240 ! autovideosink \
uridecodebin uri=http://old.koniclab.info/fileadmin/images/koniclab_logo_negro.png ! videoscale ! video/x-raw, width=320, height=240 ! imagefreeze ! m. \
uridecodebin uri=http://old.koniclab.info/fileadmin/images/koniclab_logo_negro.png ! videoscale ! video/x-raw, width=320, height=240 ! imagefreeze ! m. \
uridecodebin uri=http://old.koniclab.info/fileadmin/images/koniclab_logo_negro.png ! videoscale ! video/x-raw, width=320, height=240 ! imagefreeze ! m. \
uridecodebin uri=http://old.koniclab.info/fileadmin/images/koniclab_logo_negro.png ! videoscale ! video/x-raw, width=320, height=240 ! imagefreeze ! m.

There is no problem with starting of creation of elements which are at the end of processing.. with gst-launch you just define which elelemnts are linked to which other elements.. the rest gst-launch can figure outs on its own..

You just copy paste the part which creates the input whatever it is and link finally to m. .. then you need to add another sink_XX::some-pos=ZZZ.

I think you can figure out the rest.

HTH

nayana
  • 3,787
  • 3
  • 20
  • 51
  • Thank you, this works and does indeed look a nicely formatted. For some reason I get an error message saying that there is no glvideomixer element, but using videomixer works. – alain baumann Jul 14 '16 at 12:36
  • @alainbaumann changed to videomixer.. if it solves your problem you can accept the question with the tick below vote count, if you really like it you can also upvote – nayana Jul 14 '16 at 12:42