<html><head>
    
  </head>
  <body><div>Le mardi 02 mars 2021 à 10:29 +0100, Michiel Konstapel a écrit :</div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><div class="moz-cite-prefix">On 16-02-2021 16:06, Nicolas Dufresne wrote:<br></div><div>  <meta http-equiv="content-type" content="text/html; charset=UTF-8"></div><div>Le mardi 16 février 2021 à 02:50 -0500, Jim Ruxton a écrit :</div><div> <br></div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><p>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?</p><pre><strong>./gst-launch-1.0 v4l2src device=/dev/video</strong><strong>4</strong><strong> ! videoscale ! videoconvert ! video/x-raw,format=YUY2, framerate=30/1, width=</strong><strong><font face="Liberation Mono, monospace"><font style="font-size: 10pt" size="2"><b>640</b></font></font></strong><strong>, height=</strong><strong><font face="Liberation Mono, monospace"><font style="font-size: 10pt" size="2"><b>480</b></font></font></strong><strong><font face="Liberation Mono, monospace"><font style="font-size: 10pt" size="2"><b>! </b></font></font></strong><strong><font face="Liberation Mono, monospace"><font style="font-size: 10pt" size="2"><b>alpha</b></font></font></strong><strong><font face="Liberation Mono, monospace"><font style="font-size: 10pt" size="2"><b> </b></font></font></strong><strong><font face="Liberation Mono, monospace"><font style="font-size: 10pt" size="2"><b>alpha=1</b></font></font></strong><strong> ! videobox border-alpha=0 left=-640 ! 
videomixer name=Mix ! videoconvert ! autovideosink v4l2src device=/dev/video</strong><strong><font face="Liberation Mono, monospace"><font style="font-size: 10pt" size="2"><b>2</b></font></font></strong><strong> ! videoscale ! videoconvert ! video/x-raw, format=YUY2, framerate=30/1, width=</strong><strong><font face="Liberation Mono, monospace"><font style="font-size: 10pt" size="2"><b>640</b></font></font></strong><strong>, height=</strong><strong><font face="Liberation Mono, monospace"><font style="font-size: 10pt" size="2"><b>480</b></font></font></strong><strong><font face="Liberation Mono, monospace"><font style="font-size: 10pt" size="2"><b>! </b></font></font></strong><strong><font face="Liberation Mono, monospace"><font style="font-size: 10pt" size="2"><b>alpha</b></font></font></strong><strong><font face="Liberation Mono, monospace"><font style="font-size: 10pt" size="2"><b> </b></font></font></strong><strong><font face="Liberation Mono, monospace"><font style="font-size: 10pt" size="2"><b>alpha=1</b></font></font></strong><strong> ! videobox border-alpha=0 right=-640 ! Mix.</strong></pre></blockquote><div><br></div><div>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).</div><div><br></div><div>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).</div><p><br></p><p>Interesting! Does any of the above apply to *gl*videomixer as well? Are there any specific considerations for using that in a live pipeline? Should we also give that more latency? I see the glmixerbin superclass has a property for that, also defaulting to zero.</p></blockquote><div><br></div><div>glvideomixer is based a GstVideoAggregator, hence works fine for livepipeline. The mixer bin is to help taking take of uploading the pixel to your GPU, as GPUs don't or rarely use linear / malloc pixel data.</div><div><br></div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><p>Kind regards,<br> Michiel<br></p><div> </div></blockquote><div><br></div><div><span></span></div></body></html>