Re: How to minimize delay in encoded audio streaming?
On mer, 2020-02-19 at 05:20 -0600, jeyp4 wrote:
> I am observing ~0.5 sec delay in speaking to mic and listening from speaker
> in following pipeline.
> gst-launch-1.0 pulsesrc ! audioconvert ! lamemp3enc ! decodebin !
> audioconvert ! autoaudiosink
> How can I minimize this delay?
> I noticed that below pipeline gives minimum delay.
> gst-launch-1.0 -v pulsesrc buffer-time=20000 ! volume volume=1.0 ! pulsesink
On pulsesrc, you want to reduce latency-time, currently it's 10ms, so not a big
contributor latency. On sink, setting the buffer-time is what reduce latency.
To gain more latency, just pick another compression method, MP3 is not designed
to achieve the lower possible latency. Have you considered Opus ? See frame-size
property on opusenc for the entire range of latency you can achieve.