Need help with using OPUS over RTP

Carlos Rafael Giani dv at pseudoterminal.org
Sat Aug 3 01:04:37 PDT 2013


On 2013-08-03 09:14, Carlos Rafael Giani wrote:
> 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).
>
> So,
>
> 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.
>
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

Forgot one thing: you need to set the "do-lost" gstrtpjitterbuffer 
property to TRUE , otherwise opus' PLC will not kick in (it depends on 
packet loss events being generated from upstream, in this case, the 
jitter buffer).

Also, in 0.10, there is a memory leak in either the opus depayloader or 
the opus decoder element. I do not remember which one. Since 0.10 is 
abandoned and there will never be any more 0.10 releases, you'll have to 
pick the fix from the 0.10 git repo. (I strongly recommend to switch to 
1.0, since there were many fixes to other RTP elements as well.)


More information about the gstreamer-devel mailing list