Need help with using OPUS over RTP
Carlos Rafael Giani
dv at pseudoterminal.org
Sat Aug 3 00:14:26 PDT 2013
On 2013-08-03 02:07, envion wrote:
> Hi, I'm currently trying to get as low latency as possible for audio over my
> Ethernet LAN. So I found out about OPUS (formet CELT) and have been trying
> to use it.
> I can stream the test sound if I do like this:
> gst-launch-0.10 audiotestsrc ! audioconvert ! opusenc ! rtpopuspay !
> udpsink host=reciver port=5000
> gst-launch-0.10 udpsrc caps=$AUDIO_CAPS port=5000 ! rtpopusdepay ! opusdec !
> I've problems with streaming other from ex pulsesrc. Should I convert it to
> a WAV format before sending it to opusenc ? Yeah, a push in the right
> direction would be nice :)
> View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Need-help-with-using-OPUS-over-RTP-tp4661409.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
You should put an audioresample element right between audioconvert and
opusenc, since Opus only supports a fixed set of sample rates.
Also, I recommend you use a jitter buffer. It does introduce some
latency, but handles incoming out-of-order packets as well as packet
losses (which Opus can conceal).
Client: gst-launch-0.10 audiotestsrc ! audioconvert ! audioresample !
opusenc ! rtpopuspay ! udpsink host=reciver port=5000
Server: udpsrc caps=$AUDIO_CAPS port=5000 ! gstrtpjitterbuffer
latency=200 ! rtpopusdepay ! opusdec plc=true ! alsasink
"latency" is the jitter buffer size in milliseconds. The bigger the
buffer, the better it can compensate for the network effects mentioned
before, but the more latency you'll get. Be aware that Opus packets by
default cover 20ms of audio data each, so in a 200ms buffer, you can fit
up 10 packets. Keep that in mind when you choose a buffer size.
More information about the gstreamer-devel