Combining 2 Video Streams Side by Side, Getting Choppy Results

Nicolas Dufresne nicolas at ndufresne.ca
Tue Feb 16 15:06:55 UTC 2021


Le mardi 16 février 2021 à 02:50 -0500, Jim Ruxton a écrit :
> I am trying to combine 2 video streams. One from my laptop camera and one from
> an external webcam. I'm using the following pipeline and getting very choppy
> results. Neither my CPU or GPU seem to be working hard. Any ideas how to make
> this less choppy?
> ./gst-launch-1.0 v4l2src device=/dev/video4 ! videoscale ! videoconvert ! video/x-raw,format=YUY2, framerate=30/1, width=640, height=480! alpha alpha=1 ! videobox border-alpha=0 left=-640 ! 
> videomixer name=Mix ! videoconvert ! autovideosink v4l2src device=/dev/video2 ! videoscale ! videoconvert ! video/x-raw, format=YUY2, framerate=30/1, width=640, height=480! alpha alpha=1 ! videobox border-alpha=0 right=-640 ! Mix.

First recommendation, move away from videomixer and use compositor (videomixer
is just a backward shm on top of compositor). As you have a live pipeline, you
should release the composition pressure by configurating a latency on the
compositor element.  The latency is in nano-second, one of two frames of latency
should be fine in general, but the default is none, and would only worked with
perfectly synched sources which has accurate latency (v4l2src does not have
accurate latency, it simply claims 1 frame, alway).

Second recommendation, consider adding a queue before you display sink, this
will improve the timeout logic inside the compositor, by giving it a bit more
freedome (with thread seperation).

> Thanks,
> Jim
> 
> 
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20210216/bea760a2/attachment.htm>


More information about the gstreamer-devel mailing list