How to minimize delay in encoded audio streaming?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to minimize delay in encoded audio streaming?

jeyp4
This post was updated on .
Hi

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 buffer-time=20000

Problem is, I want to use encoding pipeline.


--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
gstreamer-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to minimize delay in encoded audio streaming?

Nicolas Dufresne-5
On mer, 2020-02-19 at 05:20 -0600, jeyp4 wrote:

> Hi
>
> 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
> buffer-time=20000

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.

>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to minimize delay in encoded audio streaming?

jeyp4
This post was updated on .
Thank you

gst-launch-1.0 pulsesrc buffer-time=20000 ! opusenc frame-size=20 ! opusdec ! pulsesink buffer-time=20000 -v

works very good

I am trying to short-cut this pipeline. If it is interesting to you, can you help me in this.
http://gstreamer-devel.966125.n4.nabble.com/Short-cutting-OPUS-encoding-decoding-pipeline-tp4693408.html

--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
gstreamer-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel