<div dir="ltr"><div class="gmail_quote"><div>I faced similar issues a while back. A search in the group for something like "audiomixer gaps" should pull up the related posts.</div><div><br></div><div>If memory serves, I found that using "adder" instead of "audiomixer" eliminated the gaps. As did setting a non-zero latency in the audiomixer properties. However, in my case, the latency value only seemed to have any effect at all if I also placed a queue after the audiomixer.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Message: 1<br>
Date: Tue, 5 Jan 2021 09:37:25 -0500<br>
From: Guillaume Cartier <<a href="mailto:gucartier@gmail.com" target="_blank">gucartier@gmail.com</a>><br>
To: Discussion of the development of and with GStreamer<br>
<<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">gstreamer-devel@lists.freedesktop.org</a>><br>
Subject: Re: Gstreamer audio mixer issue<br>
Message-ID:<br>
<CAN4e_LmOgJ6_q4yQOSaaL2jD_LZi80hjM=PJR1rC=<a href="mailto:4qeGFabqQ@mail.gmail.com" target="_blank">4qeGFabqQ@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Hi dananjaya, we are also using GStreamer for a project that involves<br>
mixing multiple live sources together.<br>
<br>
For us, the audiomixer would very often generate what we called "gritches"<br>
that upon looking at the output in Audacity were revealed to be small<br>
silence gaps in the output. Reading the source code and playing with it has<br>
led to the gst_aggregator_pad_has_space function that has a test that I<br>
believe is incorrect (in all humbleness being fairly new to GStreamer) :<br>
<br>
if (self->priv->latency == 0)<br>
return FALSE;<br>
<br>
I think this test should only apply in the non-live case, but in any case<br>
the good news is that by setting latency to any value in our audiomixer<br>
element (even 1), this has solved most of our problems.<br>
<br>
PS: You could also replace audiomixer with liveadder which is a subclass of<br>
audiomixer that by default sets latency to 30ms.<br>
<br>
On Tue, Jan 5, 2021 at 6:51 AM dananjaya <<a href="mailto:pulzappcheck890@gmail.com" target="_blank">pulzappcheck890@gmail.com</a>> wrote:<br>
<br>
> Hi,<br>
> I am trying the below pipeline to capture 2 1080p usb video streams while<br>
> previewing, with 2 usb audio sources mixed together.<br>
><br>
> The issue is, the audio mixed and captured is containing lots of artifacts<br>
> such as click sounds. How can I resolve this issue.<br>
><br>
> gst-launch-1.0 -e mp4mux name=mux ! filesink location=feed1mp1080HS.mp4<br>
> v4l2src device=/dev/video1 ! tee name=t1 t1. ! queue ! video/x-raw,<br>
> width=1920, height=1080, framerate=30/1 ! nvvidconv ! queue ! nvv4l2h264enc<br>
> maxperf-enable=1 bitrate=4000000 profile=4 ! queue ! h264parse ! queue !<br>
> mux.video_0 audiomixer name=mixer ! audioconvert ! voaacenc ! aacparse !<br>
> mux.audio_0 pulsesrc<br>
> device="alsa_input.usb-VXIS_Inc_ezcap_U3_capture-02.analog-stereo" ! queue<br>
> !<br>
> audio/x-raw,width=16,depth=16,rate=44100,channel=1 ! queue ! mixer.sink_0<br>
> pulsesrc<br>
><br>
> device="alsa_input.usb-C-Media_Electronics_Inc._USB_Advanced_Audio_Device-00.analog-stereo"<br>
> ! queue ! audio/x-raw,width=16,depth=16,rate=44100,channel=1 ! queue !<br>
> mixer.sink_1 t1. ! queue ! video/x-raw, width=1920, height=1080,<br>
> framerate=30/1 ! nvvidconv ! queue !<br>
> "video/x-raw(memory:NVMM),width=959,height=540,framerate=30/1,format=NV12"<br>
> !<br>
> queue ! nvoverlaysink overlay-x=0 overlay-y=270 overlay-w=959 overlay-h=540<br>
> overlay=1 v4l2src device=/dev/video2 ! tee name=t2 t2. ! queue !<br>
> video/x-raw, width=1920, height=1080, framerate=30/1 ! nvvidconv ! queue !<br>
> nvv4l2h264enc maxperf-enable=1 bitrate=4000000 profile=4 ! queue !<br>
> h264parse<br>
> ! queue ! mp4mux ! filesink location=feed2mp1080HS.mp4 t2. ! queue !<br>
> video/x-raw, width=1920, height=1080, framerate=30/1 ! nvvidconv ! queue !<br>
> "video/x-raw(memory:NVMM),width=960,height=540,framerate=30/1,format=NV12"<br>
> !<br>
> queue ! nvoverlaysink overlay-x=960 overlay-y=270 overlay-w=960<br>
> overlay-h=540 overlay=2<br>
><br>
> Thanks in advance<br>
><br>
><br>
><br><br>
</blockquote></div></div>